# General Usage

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

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

**Page:** 97

---

## [Can MLJ \`Stack\` already trained models?](https://discourse.julialang.org/t/can-mlj-stack-already-trained-models/124506)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 5\
**Last updated:** [January 10, 2025, 4:48am UTC](https://discourse.julialang.org/t/can-mlj-stack-already-trained-models/124506 "2025-01-10T04:48:48Z")

</div>

The doc at Model Stacking · MLJ shows how to stack models, but the base models are trained at the same time. Is there a way to use already-trained models and only train the metalearner?

---

## [How to get the vector of vertices and connectivity](https://discourse.julialang.org/t/how-to-get-the-vector-of-vertices-and-connectivity/124563)

<div class="topic-metadata">

**Author:** [@Mizu49](https://discourse.julialang.org/u/Mizu49)\
**Replies:** 3\
**Last updated:** [January 10, 2025, 1:43am UTC](https://discourse.julialang.org/t/how-to-get-the-vector-of-vertices-and-connectivity/124563 "2025-01-10T01:43:53Z")

</div>

How can I obtain the vectors of the vertices and connectivity from the primitive geometry defined by Meshes.jl? julia\> b = Meshes.Box((0.0, 0.0, 0.0), (1.0, 1.0, 1.0)) Box ├─ min: Point(x: 0.0 m, y: 0.0 m, z: 0.0 m) └─…

---

## [Avoid allocation for local array](https://discourse.julialang.org/t/avoid-allocation-for-local-array/124602)

<div class="topic-metadata">

**Author:** [@ocp](https://discourse.julialang.org/u/ocp)\
**Replies:** 6\
**Last updated:** [January 9, 2025, 8:17pm UTC](https://discourse.julialang.org/t/avoid-allocation-for-local-array/124602 "2025-01-09T20:17:45Z")

</div>

I’m curious if there is a way to have a small, local array without allocations. Here is a short, contrived example: julia\> function foo(x) arr = \[1.0, 2.0, 3.0\] if x \< 1 arr\[1\] \*= x…

---

## [ForwardMethods.jl: Composition made easy(ish) (I'm not the author)](https://discourse.julialang.org/t/forwardmethods-jl-composition-made-easy-ish-im-not-the-author/124454)

<div class="topic-metadata">

**Author:** [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)\
**Replies:** 5\
**Last updated:** [January 9, 2025, 6:45pm UTC](https://discourse.julialang.org/t/forwardmethods-jl-composition-made-easy-ish-im-not-the-author/124454 "2025-01-09T18:45:24Z")

</div>

I’m not the author of this package but I found this really useful in my work just now and I thought it deserves some more love. It allows you to forward a number of methods for your wrapper types in one macro, and even i…

---

## [Using SNOPT in Julia](https://discourse.julialang.org/t/using-snopt-in-julia/124573)

<div class="topic-metadata">

**Author:** [@nico](https://discourse.julialang.org/u/nico)\
**Replies:** 2\
**Last updated:** [January 9, 2025, 6:39pm UTC](https://discourse.julialang.org/t/using-snopt-in-julia/124573 "2025-01-09T18:39:41Z")

</div>

Hi All! I have been trying to set up the optimization package SNOPT in Julia. I tried with SNOW.jl, and SNOPT.jl but I did not succeed to set up the packages and get them to work. I tried in Linux (Ubuntu). Does anyo…

---

## [Error Importing \`OptimalTransport\`: \`UndefVarError: \_iszero\` Not Defined in \`LinearAlgebra\`](https://discourse.julialang.org/t/error-importing-optimaltransport-undefvarerror-iszero-not-defined-in-linearalgebra/124574)

<div class="topic-metadata">

**Author:** [@josemanuel22](https://discourse.julialang.org/u/josemanuel22)\
**Replies:** 1\
**Last updated:** [January 9, 2025, 12:49pm UTC](https://discourse.julialang.org/t/error-importing-optimaltransport-undefvarerror-iszero-not-defined-in-linearalgebra/124574 "2025-01-09T12:49:03Z")

</div>

Hello Julia Community, I’m encountering an error when trying to import the OptimalTransport package, and I’m not sure how to resolve it. Below is the error message I receive: Failed to precompile OptimalTransport \[7e02…

---

## [Numerical accuracy/machine accuracy and roundness in Julia](https://discourse.julialang.org/t/numerical-accuracy-machine-accuracy-and-roundness-in-julia/124541)

<div class="topic-metadata">

**Author:** [@Ofenblech](https://discourse.julialang.org/u/Ofenblech)\
**Replies:** 12\
**Last updated:** [January 9, 2025, 10:26am UTC](https://discourse.julialang.org/t/numerical-accuracy-machine-accuracy-and-roundness-in-julia/124541 "2025-01-09T10:26:50Z")

</div>

Dear community, I am new to the forum and I’m looking for a good option for how I can round Julia’s machine accuracy for polynomials or simplify the numbers in the system. I am concerned with the following problems: I …

---

## [Async UDP socket usage](https://discourse.julialang.org/t/async-udp-socket-usage/124401)

<div class="topic-metadata">

**Author:** [@mchitre](https://discourse.julialang.org/u/mchitre)\
**Replies:** 8\
**Last updated:** [January 9, 2025, 7:55am UTC](https://discourse.julialang.org/t/async-udp-socket-usage/124401 "2025-01-09T07:55:22Z")

</div>

We have a problem with async usage of UDP sockets, so I made a MWE to demonstrate it. We run a simple UDP echo deamon with socat: socat -v PIPE udp-recvfrom:9809,fork This listens on port 9809 and echoes back to the s…

---

## [Other kinds of tests](https://discourse.julialang.org/t/other-kinds-of-tests/124523)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 3\
**Last updated:** [January 9, 2025, 7:19am UTC](https://discourse.julialang.org/t/other-kinds-of-tests/124523 "2025-01-09T07:19:12Z")

</div>

Pass/fail tests go in test/runtests.jl. But there are other kinds of tests. A cryptographer may want to publish his cryptanalysis code, but users of the crypto library shouldn’t have to depend on the packages used in cr…

---

## [Should InexactError be thrown when converting from Int64 to Float64?](https://discourse.julialang.org/t/should-inexacterror-be-thrown-when-converting-from-int64-to-float64/124531)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 4\
**Last updated:** [January 9, 2025, 7:13am UTC](https://discourse.julialang.org/t/should-inexacterror-be-thrown-when-converting-from-int64-to-float64/124531 "2025-01-09T07:13:57Z")

</div>

Converting from Float64 to Int64 works fine if the number is an integer, otherwise a InexactError is thrown, and the user is required to use a function such as round or floor to perform the conversion in general. julia\> …

---

## [Any suggestions for implementing parametric unit conversions?](https://discourse.julialang.org/t/any-suggestions-for-implementing-parametric-unit-conversions/124560)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 0\
**Last updated:** [January 9, 2025, 1:58am UTC](https://discourse.julialang.org/t/any-suggestions-for-implementing-parametric-unit-conversions/124560 "2025-01-09T01:58:24Z")

</div>

I have the following table of unit conversions for wave attenuation rates. For example, The unitless quantity (units of “1”) is known as the loss tangent. In the spirit of Unitful.jl and/or DynamicQuantities.jl o…

---

## [Timeout function](https://discourse.julialang.org/t/timeout-function/124496)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 5\
**Last updated:** [January 9, 2025, 2:16am UTC](https://discourse.julialang.org/t/timeout-function/124496 "2025-01-09T02:16:47Z")

</div>

Hello, is this a good way to create timeout function? struct TimeoutError \<: Exception end function timeout(f::Function, nsec) task = current\_task() timer = Timer(nsec) do t Base.throwto(task, TimeoutEr…

---

## [In Pipe.@pipe, |\> followed by .|\> Gives an error](https://discourse.julialang.org/t/in-pipe-pipe-followed-by-gives-an-error/47174)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 8\
**Last updated:** [January 8, 2025, 11:34pm UTC](https://discourse.julialang.org/t/in-pipe-pipe-followed-by-gives-an-error/47174 "2025-01-08T23:34:35Z")

</div>

|\> followed by .|\> Gives an error @pipe 2 |\> \_ .+ (1:3) #Works @pipe 2 .+ (1:3) .|\> \_^2 #Works @pipe 2 |\> \_ .+ (1:3) .|\> \_^2 #Gives Erro…

---

## [Could you implement Linear Types in Julia?](https://discourse.julialang.org/t/could-you-implement-linear-types-in-julia/124556)

<div class="topic-metadata">

**Author:** [@The\_Mastermage](https://discourse.julialang.org/u/The_Mastermage)\
**Replies:** 0\
**Last updated:** [January 8, 2025, 11:17pm UTC](https://discourse.julialang.org/t/could-you-implement-linear-types-in-julia/124556 "2025-01-08T23:17:56Z")

</div>

I was watching the video 2024 LLVM Dev Mtg - Implementing Linear / Non-destructible Types in Vale and Mojo by on of the Devs developing Mojo and Vale (which is really cool btw. check it out). And he was talking about Li…

---

## [Trying to implement VAE using Lux and reactant](https://discourse.julialang.org/t/trying-to-implement-vae-using-lux-and-reactant/124353)

<div class="topic-metadata">

**Author:** [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Replies:** 12\
**Last updated:** [January 8, 2025, 9:02pm UTC](https://discourse.julialang.org/t/trying-to-implement-vae-using-lux-and-reactant/124353 "2025-01-08T21:02:21Z")

</div>

Just had a lot of fun implementing VAE (Variational AutoEncoder) with Lux and Reactant, it barely works, little summary of errors, Reactant : errors with: 'stablehlo.transpose' op using value defined outside the region…

---

## [Registered package not made available](https://discourse.julialang.org/t/registered-package-not-made-available/124461)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 4\
**Last updated:** [January 8, 2025, 8:55pm UTC](https://discourse.julialang.org/t/registered-package-not-made-available/124461 "2025-01-08T20:55:37Z")

</div>

My new package PackageMaker.jl was registered yesterday, it appeared on juliahub.com in short time, but it is not yet available for installation from the general registry. (@PackageMaker) pkg\> add PackageMaker ERROR: Th…

---

## [AbstractArrayStyle{Any} versus AbstractArrayStyle{N} broadcast style](https://discourse.julialang.org/t/abstractarraystyle-any-versus-abstractarraystyle-n-broadcast-style/124526)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [January 8, 2025, 8:40pm UTC](https://discourse.julialang.org/t/abstractarraystyle-any-versus-abstractarraystyle-n-broadcast-style/124526 "2025-01-08T20:40:33Z")

</div>

Suppose a package defines an array type SomeArray which, like Array, supports arbitrary dimensionality: struct SomeArray{N} \<: AbstractArray{Float32, N} end # the element type doesn't matter here, it's merely an exampl…

---

## [Understanding package extension dependency constraints](https://discourse.julialang.org/t/understanding-package-extension-dependency-constraints/124542)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 0\
**Last updated:** [January 8, 2025, 4:52pm UTC](https://discourse.julialang.org/t/understanding-package-extension-dependency-constraints/124542 "2025-01-08T16:52:22Z")

</div>

I’m currently working on extensions for a package where my extensions add methods to an existing function in my main package. I have multiple extensions that add such methods. Some need only one additional package, some…

---

## [Where does LanguageServer store its cache?](https://discourse.julialang.org/t/where-does-languageserver-store-its-cache/124547)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [January 8, 2025, 6:34pm UTC](https://discourse.julialang.org/t/where-does-languageserver-store-its-cache/124547 "2025-01-08T18:34:36Z")

</div>

When running LanguageServer (in Neovim), the LSP log shows messages like Downloading cache files... … Package FFTW (7a1cc6ca-52ef-59f5-83cd-3a7055c09341) is cached. … Done loading FFTW from cache... Where does Language…

---

## [Cconvert and unsafe\_convert with immutable struct containing a pointer](https://discourse.julialang.org/t/cconvert-and-unsafe-convert-with-immutable-struct-containing-a-pointer/124479)

<div class="topic-metadata">

**Author:** [@luke-kiernan](https://discourse.julialang.org/u/luke-kiernan)\
**Replies:** 5\
**Last updated:** [January 8, 2025, 5:21pm UTC](https://discourse.julialang.org/t/cconvert-and-unsafe-convert-with-immutable-struct-containing-a-pointer/124479 "2025-01-08T17:21:36Z")

</div>

Follow up question from Ccall with a C struct containing a pointer: how do I make this cconvert/unsafe\_convert dance work when the struct is immutable? Re-assigning dm.data to pointer(m) inside unsafe\_convert is then out…

---

## [Glob with variable names](https://discourse.julialang.org/t/glob-with-variable-names/57982)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 2\
**Last updated:** [January 8, 2025, 4:26pm UTC](https://discourse.julialang.org/t/glob-with-variable-names/57982 "2025-01-08T16:26:12Z")

</div>

I am trying out some pattern matching with glob. When I try it using subfolders it works if the subfolder is hardcoded, but not when the subfolder is a variable. The purpose of the code is to delete files older than a …

---

## [DSP.jl loading error](https://discourse.julialang.org/t/dsp-jl-loading-error/124345)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 3\
**Last updated:** [January 8, 2025, 2:18pm UTC](https://discourse.julialang.org/t/dsp-jl-loading-error/124345 "2025-01-08T14:18:26Z")

</div>

In trying to sort out a problem I tried loading DSP.jl into a fresh project on both 1.11.2 and 1.10.7. The error message from 1.10.7 is given below. As I am on Windows 11 I am not sure why it is giving me an error mess…

---

## [Weird \`ERROR: LoadError: ArgumentError: Platform \`riscv64-linux-gnu-libgfortran5\` is not an officially supported platform\` when loading package](https://discourse.julialang.org/t/weird-error-loaderror-argumenterror-platform-riscv64-linux-gnu-libgfortran5-is-not-an-officially-supported-platform-when-loading-package/124537)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 5\
**Last updated:** [January 8, 2025, 1:56pm UTC](https://discourse.julialang.org/t/weird-error-loaderror-argumenterror-platform-riscv64-linux-gnu-libgfortran5-is-not-an-officially-supported-platform-when-loading-package/124537 "2025-01-08T13:56:29Z")

</div>

I tried running my package on a compute I haven’t used for two weeks: using Catalyst but got a weird error I do not understand: \[ Info: Precompiling Catalyst \[479239e8-5488-4da2-87a7-35f2df7eef83\] (cache misses: inclu…

---

## [Vscode crash on debug with "unknown command" on 1.11.2](https://discourse.julialang.org/t/vscode-crash-on-debug-with-unknown-command-on-1-11-2/124514)

<div class="topic-metadata">

**Author:** [@dimsinel](https://discourse.julialang.org/u/dimsinel)\
**Replies:** 4\
**Last updated:** [January 8, 2025, 1:46pm UTC](https://discourse.julialang.org/t/vscode-crash-on-debug-with-unknown-command-on-1-11-2/124514 "2025-01-08T13:46:05Z")

</div>

Hello. I am on vscode 1.96.2 w/ julia ext 1.127.2 – but the exact same thing happens prerelease 1.136.1. The simplest code simply crashes the debugger – and I don’t even need to create breakpoints for this to happen. …

---

## [Understanding dependencies of packages extensions](https://discourse.julialang.org/t/understanding-dependencies-of-packages-extensions/115237)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [January 8, 2025, 12:53pm UTC](https://discourse.julialang.org/t/understanding-dependencies-of-packages-extensions/115237 "2025-01-08T12:53:30Z")

</div>

I have a package and I’m extending a function to create plots. The main package depends on another third package, let’s say StaticArrays for simplicity, and the extension also uses the functions of StaticArrays. Should S…

---

## [Contextual dispatch on Julia 1.12?](https://discourse.julialang.org/t/contextual-dispatch-on-julia-1-12/124535)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 1\
**Last updated:** [January 8, 2025, 11:36am UTC](https://discourse.julialang.org/t/contextual-dispatch-on-julia-1-12/124535 "2025-01-08T11:36:21Z")

</div>

Apparently Cassette.jl is broken on Julia 1.12. I was wondering if anyone knows of another way to get contextual dispatch in upcoming Julia versions? This is to support writing a borrow checker for Julia: Package for Ru…

---

## [Poor performance of SIMD vectorization in the latest version of Julia (v1.11.2)](https://discourse.julialang.org/t/poor-performance-of-simd-vectorization-in-the-latest-version-of-julia-v1-11-2/124406)

<div class="topic-metadata">

**Author:** [@Mikel\_Antonana](https://discourse.julialang.org/u/Mikel_Antonana)\
**Replies:** 19\
**Last updated:** [January 8, 2025, 11:17am UTC](https://discourse.julialang.org/t/poor-performance-of-simd-vectorization-in-the-latest-version-of-julia-v1-11-2/124406 "2025-01-08T11:17:27Z")

</div>

I have observed poor performance of our SIMD-vectorized numerical integration method when using the latest version of Julia (1.11.2). To show this, I am attaching two precision diagrams obtained by running this Jupyter …

---

## [How to work around unsupported rational coefficients in AbstractAlgebra for polynomial rings in Julia?](https://discourse.julialang.org/t/how-to-work-around-unsupported-rational-coefficients-in-abstractalgebra-for-polynomial-rings-in-julia/124495)

<div class="topic-metadata">

**Author:** [@Rowing0914](https://discourse.julialang.org/u/Rowing0914)\
**Replies:** 2\
**Last updated:** [January 8, 2025, 7:37am UTC](https://discourse.julialang.org/t/how-to-work-around-unsupported-rational-coefficients-in-abstractalgebra-for-polynomial-rings-in-julia/124495 "2025-01-08T07:37:38Z")

</div>

I’m working with the AbstractAlgebra.jl library in Julia and encountered an issue when defining an ideal in a polynomial ring with rational coefficients. Here’s the minimal example: using AbstractAlgebra # Integer coef…

---

## [How to use Infiltrator?](https://discourse.julialang.org/t/how-to-use-infiltrator/124305)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 9\
**Last updated:** [January 8, 2025, 6:16am UTC](https://discourse.julialang.org/t/how-to-use-infiltrator/124305 "2025-01-08T06:16:09Z")

</div>

I have a startup.jl that looks like this: try using Revise catch e @warn "Error initializing Revise" end try using Infiltrator catch e @warn "Error initializing Infiltrator" end I put @infiltrate in a function …

---

## [How to set reuse Julia session from terminal process?](https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389)

<div class="topic-metadata">

**Author:** [@pxshen](https://discourse.julialang.org/u/pxshen)\
**Replies:** 3\
**Last updated:** [January 8, 2025, 3:47am UTC](https://discourse.julialang.org/t/how-to-set-reuse-julia-session-from-terminal-process/124389 "2025-01-08T03:47:12Z")

</div>

I’ve py frontend that calls something like julia -e "runmyapp()" which exits upon completion. Is there way to reuse such sessions? My julia program takes minutes to compile which gets repeated. Thanks!

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

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