# General Usage

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

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

**Page:** 84

---

## [Avoiding allocations in jacobian system](https://discourse.julialang.org/t/avoiding-allocations-in-jacobian-system/126376)

<div class="topic-metadata">

**Author:** [@AP9](https://discourse.julialang.org/u/AP9)\
**Replies:** 2\
**Last updated:** [February 27, 2025, 10:26am UTC](https://discourse.julialang.org/t/avoiding-allocations-in-jacobian-system/126376 "2025-02-27T10:26:06Z")

</div>

Why is the below function allocating, and how can I optimize it so it does not allocate? β = 100 S(x) = 1/(1+exp(-β\*x)) S\_prime(x) = β\*S(x)\*(1-S(x)) function jacobian\_system(u, p, n) ω, ω\_A, A = p x, y, s = u …

---

## [Filtering private API](https://discourse.julialang.org/t/filtering-private-api/126349)

<div class="topic-metadata">

**Author:** [@s\_amap](https://discourse.julialang.org/u/s_amap)\
**Replies:** 1\
**Last updated:** [February 27, 2025, 9:54am UTC](https://discourse.julialang.org/t/filtering-private-api/126349 "2025-02-27T09:54:55Z")

</div>

A bit of a naive question regarding documenter indexing : I have a package with a public API, and some internal developer functions that are mostly of no interest to users, with a few potential exceptions for power user…

---

## [Docker image build OOM](https://discourse.julialang.org/t/docker-image-build-oom/126148)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [February 27, 2025, 6:40am UTC](https://discourse.julialang.org/t/docker-image-build-oom/126148 "2025-02-27T06:40:13Z")

</div>

I’m trying to package a Julia app as a docker image. Since, as of writing this, package relocatability is not solved; hence, this is the only way to share an app. In my dockerfile I run: ###############################…

---

## [Using a neural network inside a function for DifferentialEquations.jl solve](https://discourse.julialang.org/t/using-a-neural-network-inside-a-function-for-differentialequations-jl-solve/126359)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 1\
**Last updated:** [February 27, 2025, 12:29am UTC](https://discourse.julialang.org/t/using-a-neural-network-inside-a-function-for-differentialequations-jl-solve/126359 "2025-02-27T00:29:14Z")

</div>

I’m trying to use a neural network as a component of a differential equation to be solved by ODEsolve: begin # Import needed packages using Flux using ForwardDiff using DifferentialEquations end begin function f2(…

---

## [How to link to a type definition?](https://discourse.julialang.org/t/how-to-link-to-a-type-definition/126332)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [February 26, 2025, 9:53pm UTC](https://discourse.julialang.org/t/how-to-link-to-a-type-definition/126332 "2025-02-26T21:53:18Z")

</div>

How can I link to a type definition in a docstring? Not working: """ calculate\_AIC\_matrices!(body\_aero::BodyAerodynamics, model::\[Model\](@ref), core\_radius\_fraction::Float64, …

---

## [How to Collapse Dendrogram Branches to n Number of Leaves](https://discourse.julialang.org/t/how-to-collapse-dendrogram-branches-to-n-number-of-leaves/126323)

<div class="topic-metadata">

**Author:** [@ZVerdup](https://discourse.julialang.org/u/ZVerdup)\
**Replies:** 3\
**Last updated:** [February 26, 2025, 5:36pm UTC](https://discourse.julialang.org/t/how-to-collapse-dendrogram-branches-to-n-number-of-leaves/126323 "2025-02-26T17:36:43Z")

</div>

Hi, I need some guidance on how to handle the readability of dendrograms plotted using thousands of observations. I want to use to dendrogram to decide how many clusters I should use for further analysis. My current str…

---

## [Segmentation Fault in REPL when using PyCall and networkx](https://discourse.julialang.org/t/segmentation-fault-in-repl-when-using-pycall-and-networkx/126334)

<div class="topic-metadata">

**Author:** [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Replies:** 0\
**Last updated:** [February 26, 2025, 11:00am UTC](https://discourse.julialang.org/t/segmentation-fault-in-repl-when-using-pycall-and-networkx/126334 "2025-02-26T11:00:09Z")

</div>

I tried to use networkx via PyCall today. This triggered a segment fault. It does not seem to be problem will running this as a script. \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.or…

---

## [Migrating from Ansys to Julia](https://discourse.julialang.org/t/migrating-from-ansys-to-julia/126138)

<div class="topic-metadata">

**Author:** [@emil\_hedevang\_sgre](https://discourse.julialang.org/u/emil_hedevang_sgre)\
**Replies:** 6\
**Last updated:** [February 26, 2025, 10:06am UTC](https://discourse.julialang.org/t/migrating-from-ansys-to-julia/126138 "2025-02-26T10:06:38Z")

</div>

Hi all. Together with a colleague I am exploring how to migrate certain finite element computations from Ansys Mechanical to something in the Julia world. The computations are fairly standard: Suppose that a solid struc…

---

## [Franklin.jl for engineering content](https://discourse.julialang.org/t/franklin-jl-for-engineering-content/126263)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 3\
**Last updated:** [February 26, 2025, 4:30am UTC](https://discourse.julialang.org/t/franklin-jl-for-engineering-content/126263 "2025-02-26T04:30:41Z")

</div>

I am coming to my limits while trying to port this Quarto document to Franklin.jl. I have little knowledge of HTML and CSS. From reading the documentations and the GitHub issues, I did not find a way to generate a figur…

---

## [Autodiffing with Enzyme through a DifferentialEquations ODEproblem](https://discourse.julialang.org/t/autodiffing-with-enzyme-through-a-differentialequations-odeproblem/126257)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 8\
**Last updated:** [February 25, 2025, 10:19pm UTC](https://discourse.julialang.org/t/autodiffing-with-enzyme-through-a-differentialequations-odeproblem/126257 "2025-02-25T22:19:52Z")

</div>

I’m trying to autodiff an ODE problem that I’m solving with DifferentialEquations.jl. Here’s my code: begin # Import needed packages using DifferentialEquations using Enzyme #using Zygote #using SciMLSensitivity en…

---

## [Shasums in SHA](https://discourse.julialang.org/t/shasums-in-sha/126310)

<div class="topic-metadata">

**Author:** [@dimsinel](https://discourse.julialang.org/u/dimsinel)\
**Replies:** 1\
**Last updated:** [February 25, 2025, 9:05pm UTC](https://discourse.julialang.org/t/shasums-in-sha/126310 "2025-02-25T21:05:56Z")

</div>

Hello everyone. I am trying to get the shasums of a tarball through SHA\< but I just don t seem to do it right, SHA.sha256 and linux shasum give diferent results. Am I using the wrong function? Here’s what I do: julia\>…

---

## [How to Obtain Efficient Garbage Collection of C-Ptrs](https://discourse.julialang.org/t/how-to-obtain-efficient-garbage-collection-of-c-ptrs/126307)

<div class="topic-metadata">

**Author:** [@ejmeitz](https://discourse.julialang.org/u/ejmeitz)\
**Replies:** 5\
**Last updated:** [February 25, 2025, 8:52pm UTC](https://discourse.julialang.org/t/how-to-obtain-efficient-garbage-collection-of-c-ptrs/126307 "2025-02-25T20:52:22Z")

</div>

I am working with a C++ wrapper where the most common type is a wrapper around a shared pointer to memory. Essentially an array view. Lets call this type MyArray. My general question is given function which returns MyAr…

---

## [Window values in Images.jl](https://discourse.julialang.org/t/window-values-in-images-jl/126301)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 0\
**Last updated:** [February 25, 2025, 5:07pm UTC](https://discourse.julialang.org/t/window-values-in-images-jl/126301 "2025-02-25T17:07:36Z")

</div>

Hello :grinning:, I’m using Images.jl in Pluto.jl. I have matrix assimilated as images with values ranging from about 0 to 4. When I plot these images using Images.jl, all values greater than 1 are “clamped” to 1, and t…

---

## [Non Commercial licensing in mainstream Julia Packages](https://discourse.julialang.org/t/non-commercial-licensing-in-mainstream-julia-packages/125832)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 15\
**Last updated:** [February 25, 2025, 3:57pm UTC](https://discourse.julialang.org/t/non-commercial-licensing-in-mainstream-julia-packages/125832 "2025-02-25T15:57:46Z")

</div>

Just saw my first rejection from our company’s Nexus license compatibility checker for non-commercial use license. Is there a way to adopt a philosophy to not include licenses into mainstream packages that prohibit no…

---

## [Ver 1.11, Global Main.FTYPE does not exist](https://discourse.julialang.org/t/ver-1-11-global-main-ftype-does-not-exist/126171)

<div class="topic-metadata">

**Author:** [@ttidrick](https://discourse.julialang.org/u/ttidrick)\
**Replies:** 4\
**Last updated:** [February 25, 2025, 3:06pm UTC](https://discourse.julialang.org/t/ver-1-11-global-main-ftype-does-not-exist/126171 "2025-02-25T15:06:57Z")

</div>

Hi All, on: Julia 1.11 code: include(“…/src/mfbd.jl”) using Main.MFBD where: MFBD is the module name for mfbd.jl yields: ErrorException; ‘Global Main.FTYPE does not exist and cannot be assigned. Declare it using g…

---

## [Using @btime and printing a Vector{Vector} yields infinite loop](https://discourse.julialang.org/t/using-btime-and-printing-a-vector-vector-yields-infinite-loop/126289)

<div class="topic-metadata">

**Author:** [@Bernd\_Blasius](https://discourse.julialang.org/u/Bernd_Blasius)\
**Replies:** 3\
**Last updated:** [February 25, 2025, 2:38pm UTC](https://discourse.julialang.org/t/using-btime-and-printing-a-vector-vector-yields-infinite-loop/126289 "2025-02-25T14:38:35Z")

</div>

The following code produces an infinite loop using BenchmarkTools v = Vector{Vector}(undef,1) @btime println(v) Is this a bug or intended behaviour?

---

## [Julia/ SearchLight.Migrations , how to add foreign key?](https://discourse.julialang.org/t/julia-searchlight-migrations-how-to-add-foreign-key/126292)

<div class="topic-metadata">

**Author:** [@andreh](https://discourse.julialang.org/u/andreh)\
**Replies:** 0\
**Last updated:** [February 25, 2025, 12:58pm UTC](https://discourse.julialang.org/t/julia-searchlight-migrations-how-to-add-foreign-key/126292 "2025-02-25T12:58:08Z")

</div>

I am using Genie Framework and Julia to set up a basic database Migration This is how my module looks inside the folder db/migrations module CreateTableRolesUsers import SearchLight.Migrations: create\_table, column, p…

---

## [DataInspector + bonito](https://discourse.julialang.org/t/datainspector-bonito/126249)

<div class="topic-metadata">

**Author:** [@aTrotier](https://discourse.julialang.org/u/aTrotier)\
**Replies:** 3\
**Last updated:** [February 25, 2025, 11:15am UTC](https://discourse.julialang.org/t/datainspector-bonito/126249 "2025-02-25T11:15:06Z")

</div>

How can I get an interactive html that show the label of scatter using DataInspector ? @sdanisch ## interactive plot works function makie\_plot\_2() fig=Figure() ax=Axis(fig\[1,1\],title = "test") scatter!(ax,rand(10),rand…

---

## [Dagger + Dates = snakemake?](https://discourse.julialang.org/t/dagger-dates-snakemake/126111)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 3\
**Last updated:** [February 25, 2025, 9:42am UTC](https://discourse.julialang.org/t/dagger-dates-snakemake/126111 "2025-02-25T09:42:25Z")

</div>

I have a folder data with samples (csv files), I want to compute some statistics for each file and then make a summary. In snakemake you can define rules how to produce the output file from the inputs, and snakemake will…

---

## [Interpolations.jl interpolation evaluation causes allocation](https://discourse.julialang.org/t/interpolations-jl-interpolation-evaluation-causes-allocation/126279)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 3\
**Last updated:** [February 25, 2025, 6:07am UTC](https://discourse.julialang.org/t/interpolations-jl-interpolation-evaluation-causes-allocation/126279 "2025-02-25T06:07:23Z")

</div>

In the following MWE, all interpolation evaluations cause 1 allocation. I want to get rid of this allocation for optimal performance. What should I do to achieve this? using Interpolations, BenchmarkTools # Create test…

---

## [Cfunction: closures are not supported on this platform](https://discourse.julialang.org/t/cfunction-closures-are-not-supported-on-this-platform/126051)

<div class="topic-metadata">

**Author:** [@mpeters2](https://discourse.julialang.org/u/mpeters2)\
**Replies:** 1\
**Last updated:** [February 25, 2025, 12:29am UTC](https://discourse.julialang.org/t/cfunction-closures-are-not-supported-on-this-platform/126051 "2025-02-25T00:29:27Z")

</div>

I’ve been helping out on a wrapper for QT6, and I’m having problems with callbacks. Specifically, I get an error stating that “cfunction: closures are not supported on this platform”, and from what I gather, this seems …

---

## [Turning a string containing Unicode code points to a normal string](https://discourse.julialang.org/t/turning-a-string-containing-unicode-code-points-to-a-normal-string/126273)

<div class="topic-metadata">

**Author:** [@lance\_xwq](https://discourse.julialang.org/u/lance_xwq)\
**Replies:** 2\
**Last updated:** [February 24, 2025, 11:03pm UTC](https://discourse.julialang.org/t/turning-a-string-containing-unicode-code-points-to-a-normal-string/126273 "2025-02-24T23:03:20Z")

</div>

For example, given that '\\u03BC' is 'μ', how should I turn "\\\\u03BCm" to "μm"? Thanks for any suggestions!

---

## [How to use CairoMakie.contourf!](https://discourse.julialang.org/t/how-to-use-cairomakie-contourf/113781)

<div class="topic-metadata">

**Author:** [@SeSodesa](https://discourse.julialang.org/u/SeSodesa)\
**Replies:** 12\
**Last updated:** [February 24, 2025, 8:42pm UTC](https://discourse.julialang.org/t/how-to-use-cairomakie-contourf/113781 "2025-02-24T20:42:57Z")

</div>

I cannot for the life of me figure out what the heck I need to pass to CairoMakie.contourf!. What I have tried thus far produces an error: """ Plots and electric field of two point charges with a countour plot on the sa…

---

## [Precompilation keeps repeating](https://discourse.julialang.org/t/precompilation-keeps-repeating/126250)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 13\
**Last updated:** [February 24, 2025, 7:21pm UTC](https://discourse.julialang.org/t/precompilation-keeps-repeating/126250 "2025-02-24T19:21:23Z")

</div>

Hi! When I’m using Julia on my Slurm HPC, it keeps redoing the precompilation. For example, if I’m running a julia script in terminal, and then running a pluto notebook under the same project (though under a different no…

---

## [Error in testset libraries/cusparse/interfaces](https://discourse.julialang.org/t/error-in-testset-libraries-cusparse-interfaces/126256)

<div class="topic-metadata">

**Author:** [@jgforbes](https://discourse.julialang.org/u/jgforbes)\
**Replies:** 0\
**Last updated:** [February 24, 2025, 5:40pm UTC](https://discourse.julialang.org/t/error-in-testset-libraries-cusparse-interfaces/126256 "2025-02-24T17:40:50Z")

</div>

I am seeing repeated errors when running test CUDA as show below. Is this a significant issue and if so, is there a fix? Here is my configuration: ulia\> CUDA.versioninfo() CUDA runtime 12.6, artifact installation CU…

---

## [Looping within a quote block in a macro](https://discourse.julialang.org/t/looping-within-a-quote-block-in-a-macro/126246)

<div class="topic-metadata">

**Author:** [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Replies:** 3\
**Last updated:** [February 24, 2025, 5:04pm UTC](https://discourse.julialang.org/t/looping-within-a-quote-block-in-a-macro/126246 "2025-02-24T17:04:08Z")

</div>

Hi, I have a bit of a beginner question regarding macros. I’m well aware that macros are tricky and in many cases can just be replaced by functions, but I think for one application I have they can significantly reduce b…

---

## [@tturbo on function call](https://discourse.julialang.org/t/tturbo-on-function-call/126224)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 4\
**Last updated:** [February 24, 2025, 3:15pm UTC](https://discourse.julialang.org/t/tturbo-on-function-call/126224 "2025-02-24T15:15:28Z")

</div>

a=randn(5\*10^7) b=randn(5\*10^7) f(a::Float64,b::Float64)::Float64 = sin(a) + cos(b) @time @tturbo @. sin(a) + cos(b) # .05 seconds @time @tturbo @. f(a,b) # 1 second Is it possible to get the @tturbo speedu…

---

## [Dividing Julia file in sections (VS code)](https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001)

<div class="topic-metadata">

**Author:** [@eilbuga](https://discourse.julialang.org/u/eilbuga)\
**Replies:** 3\
**Last updated:** [February 24, 2025, 3:01pm UTC](https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001 "2025-02-24T15:01:03Z")

</div>

Hi everyone, I was wondering if you can divide your Julia file in sections. I use this a lot when coding in Python so I don’t have to run every piece of code all the time. In Python VS code we can use #%% to divide in s…

---

## [Sk for advice on implementing a progress bar while running an MPI (Message Passing Interface)](https://discourse.julialang.org/t/sk-for-advice-on-implementing-a-progress-bar-while-running-an-mpi-message-passing-interface/126240)

<div class="topic-metadata">

**Author:** [@Iron\_Kim](https://discourse.julialang.org/u/Iron_Kim)\
**Replies:** 4\
**Last updated:** [February 24, 2025, 8:46am UTC](https://discourse.julialang.org/t/sk-for-advice-on-implementing-a-progress-bar-while-running-an-mpi-message-passing-interface/126240 "2025-02-24T08:46:51Z")

</div>

Rank 0 Progress: \[==\> \] 20% Rank 1 Progress: \[=====\> \] 45% Rank 2 Progress: \[==========\> \] 60% … Rank 19 Progress: \[=====================\> \] 95% I want to imp…

---

## [Parametric type without type parameters](https://discourse.julialang.org/t/parametric-type-without-type-parameters/126218)

<div class="topic-metadata">

**Author:** [@azoviktor](https://discourse.julialang.org/u/azoviktor)\
**Replies:** 3\
**Last updated:** [February 24, 2025, 1:57am UTC](https://discourse.julialang.org/t/parametric-type-without-type-parameters/126218 "2025-02-24T01:57:29Z")

</div>

I want to create a parametric type that would depend on a lot of parameters (e.g. 3 integer types) struct MyType{T\<:Integer, S\<:Integer, U\<:Integer} t::T s::S u::U end For the multiple dispatch I plan to use only…

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

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