# General Usage

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

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

**Page:** 41

---

## [Eval in Turing model](https://discourse.julialang.org/t/eval-in-turing-model/132397)

<div class="topic-metadata">

**Author:** [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Replies:** 4\
**Last updated:** [September 16, 2025, 11:08pm UTC](https://discourse.julialang.org/t/eval-in-turing-model/132397 "2025-09-16T23:08:52Z")

</div>

Hi, all. I am confusing if I use eval function like eval(Meta.parse("sigma ~ Normal(0,1)")) does it will affect the speed of model?

---

## [Preventing Enzyme from differentiating through constant computations](https://discourse.julialang.org/t/preventing-enzyme-from-differentiating-through-constant-computations/132445)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 1\
**Last updated:** [September 16, 2025, 5:58pm UTC](https://discourse.julialang.org/t/preventing-enzyme-from-differentiating-through-constant-computations/132445 "2025-09-16T17:58:27Z")

</div>

I am training a neural network by computing the gradient of the loss with Enzyme. Part of my computations involve associated Legendre polynomials. I did not believe these to be a crucial part of the differentiation becau…

---

## [Version v1.11.7 fails to build from source](https://discourse.julialang.org/t/version-v1-11-7-fails-to-build-from-source/132443)

<div class="topic-metadata">

**Author:** [@Dylan\_Thurston](https://discourse.julialang.org/u/Dylan_Thurston)\
**Replies:** 5\
**Last updated:** [September 16, 2025, 3:43pm UTC](https://discourse.julialang.org/t/version-v1-11-7-fails-to-build-from-source/132443 "2025-09-16T15:43:18Z")

</div>

I tried to update to the latest v1.11.7, and it fails to build from source (on my Debian GNU/Linux system). I get a lot of error messages, starting with complaints about SIZE\_MAX being undefined when compiling src/debugi…

---

## [Julia error in MobaXterm](https://discourse.julialang.org/t/julia-error-in-mobaxterm/132440)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 1\
**Last updated:** [September 16, 2025, 2:15pm UTC](https://discourse.julialang.org/t/julia-error-in-mobaxterm/132440 "2025-09-16T14:15:13Z")

</div>

Julia gives this error when started using the Bash prompt in MobaXterm\\ \_ \_ \_ ()\_ | Documentation: https://docs.julialang.org () | () () | \_ \_ | | \_\_ \_ | Type “?” for help, “\]?” for …

---

## [Best practices for real-time LabVIEW ↔ Julia data exchange](https://discourse.julialang.org/t/best-practices-for-real-time-labview-julia-data-exchange/132319)

<div class="topic-metadata">

**Author:** [@Frauke](https://discourse.julialang.org/u/Frauke)\
**Replies:** 22\
**Last updated:** [September 16, 2025, 9:18am UTC](https://discourse.julialang.org/t/best-practices-for-real-time-labview-julia-data-exchange/132319 "2025-09-16T09:18:15Z")

</div>

Hi everyone, I am currently working on a project where I want to integrate LabVIEW with Julia. The basic idea is that LabVIEW acquires some signals from hardware, Julia processes the data (e.g., simple computations like…

---

## [Find the max element of a numeric vector iteratively with mask and early break](https://discourse.julialang.org/t/find-the-max-element-of-a-numeric-vector-iteratively-with-mask-and-early-break/130233)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 10\
**Last updated:** [September 16, 2025, 9:01am UTC](https://discourse.julialang.org/t/find-the-max-element-of-a-numeric-vector-iteratively-with-mask-and-early-break/130233 "2025-09-16T09:01:36Z")

</div>

This is an elementary question about algorithm. My algorithm is probably already usable but I wonder if there is a faster algorithm that can be implemented with Julia (e.g. even not using findmax) import Random; Rando…

---

## [Is there an abstract interface for parameter/function estimation?](https://discourse.julialang.org/t/is-there-an-abstract-interface-for-parameter-function-estimation/132407)

<div class="topic-metadata">

**Author:** [@johtok](https://discourse.julialang.org/u/johtok)\
**Replies:** 2\
**Last updated:** [September 15, 2025, 9:41pm UTC](https://discourse.julialang.org/t/is-there-an-abstract-interface-for-parameter-function-estimation/132407 "2025-09-15T21:41:06Z")

</div>

Hi everyone. Like how “AbstractDifferentiation.jl” serves as a common interface for differentiation and enables quick testing of different backends, does anything similar exist for estimation of parameters/functions in U…

---

## [Function to determine number of parameters in a differential equation model function](https://discourse.julialang.org/t/function-to-determine-number-of-parameters-in-a-differential-equation-model-function/132377)

<div class="topic-metadata">

**Author:** [@macmy048](https://discourse.julialang.org/u/macmy048)\
**Replies:** 2\
**Last updated:** [September 15, 2025, 3:48pm UTC](https://discourse.julialang.org/t/function-to-determine-number-of-parameters-in-a-differential-equation-model-function/132377 "2025-09-15T15:48:19Z")

</div>

I want a function to determine the number of parameters in a differential equation model but I’ve been unable to figure out what function I’m looking for. Here’s a MWE (differential equation from this example) where cou…

---

## [Julia in IntelliJ, using language server](https://discourse.julialang.org/t/julia-in-intellij-using-language-server/118634)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 7\
**Last updated:** [September 15, 2025, 12:39pm UTC](https://discourse.julialang.org/t/julia-in-intellij-using-language-server/118634 "2025-09-15T12:39:37Z")

</div>

A colleague of mine recently tried out using IntelliJ IDEA’s LSP4JL plugin and the Julia LanguageServer.jl package, and discovered it works pretty well. I tried it too and had pretty good results. It works far better, …

---

## [One type with branches or a union of types?](https://discourse.julialang.org/t/one-type-with-branches-or-a-union-of-types/132380)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 7\
**Last updated:** [September 15, 2025, 11:58am UTC](https://discourse.julialang.org/t/one-type-with-branches-or-a-union-of-types/132380 "2025-09-15T11:58:19Z")

</div>

I do have types that basically split into two subtypes based on parameter values. The current implementation goes like that : struct A{T} x::T s::Bool function A(x::Real) xf = float(x) return…

---

## [Identical method redefinition suspiciously optimizes runtime and allocations](https://discourse.julialang.org/t/identical-method-redefinition-suspiciously-optimizes-runtime-and-allocations/132156)

<div class="topic-metadata">

**Author:** [@afleming](https://discourse.julialang.org/u/afleming)\
**Replies:** 25\
**Last updated:** [September 15, 2025, 12:39am UTC](https://discourse.julialang.org/t/identical-method-redefinition-suspiciously-optimizes-runtime-and-allocations/132156 "2025-09-15T00:39:19Z")

</div>

I am using Revise.jl to work on a package for my research, and am noticing that “revising” a file to identical code with different variable names causes a function to stop allocating. I am not sure how many details othe…

---

## [Error when precompiling packages that rely on PythonCall](https://discourse.julialang.org/t/error-when-precompiling-packages-that-rely-on-pythoncall/132371)

<div class="topic-metadata">

**Author:** [@opsssi](https://discourse.julialang.org/u/opsssi)\
**Replies:** 3\
**Last updated:** [September 14, 2025, 9:36pm UTC](https://discourse.julialang.org/t/error-when-precompiling-packages-that-rely-on-pythoncall/132371 "2025-09-14T21:36:02Z")

</div>

Hi! I have a problem when trying to use the Package OptimizationSciPy.jl (and I got the same error previously when trying to install other packages that require PythonCall. ▶ versioninfo ▶ \]add OptimizationSciPy ▶ err Wha…

---

## [Access to UNet encoder backbone in Metalhead](https://discourse.julialang.org/t/access-to-unet-encoder-backbone-in-metalhead/132375)

<div class="topic-metadata">

**Author:** [@cirobr](https://discourse.julialang.org/u/cirobr)\
**Replies:** 0\
**Last updated:** [September 14, 2025, 7:23pm UTC](https://discourse.julialang.org/t/access-to-unet-encoder-backbone-in-metalhead/132375 "2025-09-14T19:23:26Z")

</div>

Cheers, In Metalhead, consider the following model: bb = backbone( ResNet(50) ) model = UNet((256,256), 3, 10, bb) Need to get access to a specific activation map from the model’s encoder (actually, to a specific acti…

---

## [Makie: Is there an easy way to combine several figures into a new figure without re-plotting?](https://discourse.julialang.org/t/makie-is-there-an-easy-way-to-combine-several-figures-into-a-new-figure-without-re-plotting/64874)

<div class="topic-metadata">

**Author:** [@DenisTitov](https://discourse.julialang.org/u/DenisTitov)\
**Replies:** 8\
**Last updated:** [September 14, 2025, 9:42am UTC](https://discourse.julialang.org/t/makie-is-there-an-easy-way-to-combine-several-figures-into-a-new-figure-without-re-plotting/64874 "2025-09-14T09:42:23Z")

</div>

I have several figures with many plots in each that I want to combine into a composite figure. I can do this by re-plotting everything from scratch into a new figure but this is a bit inconvenient for large figures and …

---

## [What is your DispatchDoctor workflow?](https://discourse.julialang.org/t/what-is-your-dispatchdoctor-workflow/132362)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 0\
**Last updated:** [September 14, 2025, 2:57am UTC](https://discourse.julialang.org/t/what-is-your-dispatchdoctor-workflow/132362 "2025-09-14T02:57:29Z")

</div>

I wonder what ways people have found to use DispatchDoctor.jl? I’m wondering how to wrap large sections of code. For example an entire module. Each file in my package contains a module. The most convenient is to do @st…

---

## [Why won't this simple differential equation work correctly?](https://discourse.julialang.org/t/why-wont-this-simple-differential-equation-work-correctly/132344)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 5\
**Last updated:** [September 13, 2025, 7:30pm UTC](https://discourse.julialang.org/t/why-wont-this-simple-differential-equation-work-correctly/132344 "2025-09-13T19:30:52Z")

</div>

Hello, I am new to differential equations and I am trying to implement as simple differential equation model describe here. The basic model is described in equation 4. I am able to reproduce the expected behavior of cas…

---

## [Praise: CUDA.allowscalar(false) is great](https://discourse.julialang.org/t/praise-cuda-allowscalar-false-is-great/132355)

<div class="topic-metadata">

**Author:** [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Replies:** 0\
**Last updated:** [September 13, 2025, 6:22pm UTC](https://discourse.julialang.org/t/praise-cuda-allowscalar-false-is-great/132355 "2025-09-13T18:22:54Z")

</div>

One single line makes me substantially more productive (at writing GPU code), and I’d like to highlight how much I love this pattern. I’ve had vague ideas on how to express this kind of concept before, but CUDA.allowscal…

---

## [ForwardDiff.jl Jacobian with NonlinearSolve.jl](https://discourse.julialang.org/t/forwarddiff-jl-jacobian-with-nonlinearsolve-jl/132353)

<div class="topic-metadata">

**Author:** [@Jskacines](https://discourse.julialang.org/u/Jskacines)\
**Replies:** 1\
**Last updated:** [September 13, 2025, 5:39pm UTC](https://discourse.julialang.org/t/forwarddiff-jl-jacobian-with-nonlinearsolve-jl/132353 "2025-09-13T17:39:14Z")

</div>

Hello, I am new to Julia, so let me know if i’m missing any basics. I am using NonlinearSolve.jl to solve a nonlinear system, and I wish to take the jacobian of this solution with respect to input parameters. The code …

---

## [Mutating a flag in a nonmutating struct](https://discourse.julialang.org/t/mutating-a-flag-in-a-nonmutating-struct/132341)

<div class="topic-metadata">

**Author:** [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)\
**Replies:** 5\
**Last updated:** [September 13, 2025, 1:04pm UTC](https://discourse.julialang.org/t/mutating-a-flag-in-a-nonmutating-struct/132341 "2025-09-13T13:04:18Z")

</div>

Dear Julia Community. I have a struct that contains both Bool flags and arrays. I want to be able to change the value of some of the Bool flags, but I would like to avoid having a mutable struct, which I believe can cr…

---

## [Precompilation in a sandbox](https://discourse.julialang.org/t/precompilation-in-a-sandbox/132312)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 1\
**Last updated:** [September 13, 2025, 5:25am UTC](https://discourse.julialang.org/t/precompilation-in-a-sandbox/132312 "2025-09-13T05:25:03Z")

</div>

I’m making sandboxed and reproducible Julia builds. One way I do this is by compiling each Julia package using Pkg.API.precompile(). I ensure that $JULIA\_DEPOT is set to a list of paths which contains compiled/v1.11/Logg…

---

## [VSCode - debugger crashes when I am using TestItems](https://discourse.julialang.org/t/vscode-debugger-crashes-when-i-am-using-testitems/132329)

<div class="topic-metadata">

**Author:** [@tdm](https://discourse.julialang.org/u/tdm)\
**Replies:** 0\
**Last updated:** [September 13, 2025, 3:15am UTC](https://discourse.julialang.org/t/vscode-debugger-crashes-when-i-am-using-testitems/132329 "2025-09-13T03:15:20Z")

</div>

Using Julia debugger in VSCode is generally buggy (as other posts attest), but I have not seen this problem reported yet: If I am using TestItems (see below) then it’s impossible to debug - The debugger crashes on start…

---

## [Writing a macro that generates a function](https://discourse.julialang.org/t/writing-a-macro-that-generates-a-function/132315)

<div class="topic-metadata">

**Author:** [@SeSodesa](https://discourse.julialang.org/u/SeSodesa)\
**Replies:** 19\
**Last updated:** [September 12, 2025, 4:53pm UTC](https://discourse.julialang.org/t/writing-a-macro-that-generates-a-function/132315 "2025-09-12T16:53:55Z")

</div>

I would like to do define a macro that allows me sum together vector-like structs, whose fields might be heterogeneous in terms of their types. I tried something like the following inside of a module: """ A heterogeneou…

---

## [How to control Optimization.solve() termination smartly](https://discourse.julialang.org/t/how-to-control-optimization-solve-termination-smartly/132182)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 1\
**Last updated:** [September 12, 2025, 12:08pm UTC](https://discourse.julialang.org/t/how-to-control-optimization-solve-termination-smartly/132182 "2025-09-12T12:08:11Z")

</div>

I am using Optimization.jl to train a neural network. I’d like to be able to terminate the convergence based on the behavior of the loss as evaluated on a validation dataset, rather than just setting a limit for number o…

---

## [Error in Using DataInterpolations.jl and Enzyme.jl for Real-Time Interpolation and Gradient Computation in ODE Problems](https://discourse.julialang.org/t/error-in-using-datainterpolations-jl-and-enzyme-jl-for-real-time-interpolation-and-gradient-computation-in-ode-problems/132244)

<div class="topic-metadata">

**Author:** [@chooron](https://discourse.julialang.org/u/chooron)\
**Replies:** 1\
**Last updated:** [September 12, 2025, 12:05pm UTC](https://discourse.julialang.org/t/error-in-using-datainterpolations-jl-and-enzyme-jl-for-real-time-interpolation-and-gradient-computation-in-ode-problems/132244 "2025-09-12T12:05:57Z")

</div>

Hello, I currently have an ODE problem where I need to use DataInterpolations.jl to interpolate and obtain real-time values, which are then used for computing du. Next, I need to use Enzyme.jl to compute the gradients of…

---

## [How to call a function with a keyword argument whose name is stored in a variable](https://discourse.julialang.org/t/how-to-call-a-function-with-a-keyword-argument-whose-name-is-stored-in-a-variable/113744)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 4\
**Last updated:** [September 12, 2025, 7:13am UTC](https://discourse.julialang.org/t/how-to-call-a-function-with-a-keyword-argument-whose-name-is-stored-in-a-variable/113744 "2025-09-12T07:13:16Z")

</div>

If someone need it.. or for myself when I will forget it :wink: This snippet allows to call a function with a keyword argument whose name is stored in a variable: foo(x;extra=0) = x+extra keyword = "extra" foo(2,extra=…

---

## [Recommendations for comparing printouts e.g. \`@code\_\`](https://discourse.julialang.org/t/recommendations-for-comparing-printouts-e-g-code/132308)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 3\
**Last updated:** [September 12, 2025, 1:46am UTC](https://discourse.julialang.org/t/recommendations-for-comparing-printouts-e-g-code/132308 "2025-09-12T01:46:20Z")

</div>

Looking for an offline tool with a nice UI for highlighting differences between 2 or more chunks of text. Bonus if I can hide some intermediate lines in the comparison. Could be a Julia package for strings, could be some…

---

## [Passing arguments separately versus packing them into a struct](https://discourse.julialang.org/t/passing-arguments-separately-versus-packing-them-into-a-struct/132291)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 5\
**Last updated:** [September 12, 2025, 1:38am UTC](https://discourse.julialang.org/t/passing-arguments-separately-versus-packing-them-into-a-struct/132291 "2025-09-12T01:38:09Z")

</div>

I regularly have a large number of arguments to carry around, where each of the arguments has a concrete type, but where the concrete types can be different (multiple dispatch). The arguments are typically more complica…

---

## [How does Julia handle precompilation?](https://discourse.julialang.org/t/how-does-julia-handle-precompilation/132251)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 5\
**Last updated:** [September 11, 2025, 8:05pm UTC](https://discourse.julialang.org/t/how-does-julia-handle-precompilation/132251 "2025-09-11T20:05:38Z")

</div>

I am trying to make an app using PackageCompiler.jl I would like to use a precompile\_statements\_file. My understanding is that I basically call julia --trace-compile=precompile\_statements.jl --project=@. precompile.jl…

---

## [How to create an Objective C Library Wrapper](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299)

<div class="topic-metadata">

**Author:** [@skolari93](https://discourse.julialang.org/u/skolari93)\
**Replies:** 5\
**Last updated:** [September 11, 2025, 7:42pm UTC](https://discourse.julialang.org/t/how-to-create-an-objective-c-library-wrapper/132299 "2025-09-11T19:42:06Z")

</div>

I want to write a wrapper for an Objective C library (Syphon Framework). I am not sure how to proceed and which packages to use. I did build the library in my directory for testing. But I am not sure how to proceed, as …

---

## [Taking power with float exponent x^y is slower than exp(y\*log(x))?](https://discourse.julialang.org/t/taking-power-with-float-exponent-x-y-is-slower-than-exp-y-log-x/132270)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 8\
**Last updated:** [September 11, 2025, 4:27pm UTC](https://discourse.julialang.org/t/taking-power-with-float-exponent-x-y-is-slower-than-exp-y-log-x/132270 "2025-09-11T16:27:28Z")

</div>

Updated results: There was some sloppiness on my benchmark approach. The discrepancy isn’t that large. julia\> @benchmark x^1.5 setup=(x=rand()) samples=100000 BenchmarkTools.Trial: 100000 samples with 998 evaluations pe…

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

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