# General Usage

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

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

**Page:** 59

---

## [Performance discrepancy for different ways of piping/composing functions for handling runtime dispatch](https://discourse.julialang.org/t/performance-discrepancy-for-different-ways-of-piping-composing-functions-for-handling-runtime-dispatch/129773)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 9\
**Last updated:** [June 13, 2025, 4:30am UTC](https://discourse.julialang.org/t/performance-discrepancy-for-different-ways-of-piping-composing-functions-for-handling-runtime-dispatch/129773 "2025-06-13T04:30:29Z")

</div>

MWE (tested on Julia 1.11.5): julia\> foo1(::Val{N}) where {N} = N foo1 (generic function with 1 method) julia\> foo2(n::Int) = Val(n) foo2 (generic function with 1 method) julia\> a = Val.(rand(Int, 1000)); julia\> usin…

---

## [Speed of \`hasmethod\` with and without kwargs](https://discourse.julialang.org/t/speed-of-hasmethod-with-and-without-kwargs/129847)

<div class="topic-metadata">

**Author:** [@mmkrusniak](https://discourse.julialang.org/u/mmkrusniak)\
**Replies:** 3\
**Last updated:** [June 12, 2025, 11:53pm UTC](https://discourse.julialang.org/t/speed-of-hasmethod-with-and-without-kwargs/129847 "2025-06-12T23:53:28Z")

</div>

I’m a novice at writing high-performance code with Julia (1.11). I have an unknown function from a user, and I want to check if it accepts any of several possible sets of keyword names. But for reasons unknown to me, ha…

---

## [PReLU with long compilation time](https://discourse.julialang.org/t/prelu-with-long-compilation-time/129783)

<div class="topic-metadata">

**Author:** [@cirobr](https://discourse.julialang.org/u/cirobr)\
**Replies:** 1\
**Last updated:** [June 12, 2025, 6:24pm UTC](https://discourse.julialang.org/t/prelu-with-long-compilation-time/129783 "2025-06-12T18:24:35Z")

</div>

Cheers, I have implemented a PReLU nonlinearity that seems to be working quite well in my models, except for the fact the model’s compilation time (\*) is way longer than the equivalent model with ReLU instead. Given my…

---

## [Somewhere somehow Julia caches the path to Python, and I do not understand why](https://discourse.julialang.org/t/somewhere-somehow-julia-caches-the-path-to-python-and-i-do-not-understand-why/129814)

<div class="topic-metadata">

**Author:** [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Replies:** 13\
**Last updated:** [June 12, 2025, 4:42pm UTC](https://discourse.julialang.org/t/somewhere-somehow-julia-caches-the-path-to-python-and-i-do-not-understand-why/129814 "2025-06-12T16:42:45Z")

</div>

How, I ran into some strange behavior with Julia. I have a software package that works like this Julia user code starts (via dlopen) a C library that instantiates an embedded Python Python user code does the same Eve…

---

## [Python & Julia Environment Setup](https://discourse.julialang.org/t/python-julia-environment-setup/129837)

<div class="topic-metadata">

**Author:** [@GA-Brady](https://discourse.julialang.org/u/GA-Brady)\
**Replies:** 0\
**Last updated:** [June 12, 2025, 2:26pm UTC](https://discourse.julialang.org/t/python-julia-environment-setup/129837 "2025-06-12T14:26:11Z")

</div>

I’m building a data analysis pipeline using Julia. However, there are some Python3 specific packages that I need. The python packages automatically output files, which I intend to access via Julia. I am aware that tool…

---

## [DifferentialEquations.jl: Malloc errors in ODEProblems](https://discourse.julialang.org/t/differentialequations-jl-malloc-errors-in-odeproblems/129684)

<div class="topic-metadata">

**Author:** [@k-ray-liu](https://discourse.julialang.org/u/k-ray-liu)\
**Replies:** 6\
**Last updated:** [June 12, 2025, 10:59am UTC](https://discourse.julialang.org/t/differentialequations-jl-malloc-errors-in-odeproblems/129684 "2025-06-12T10:59:30Z")

</div>

Hi there, I’m having memory related problem when running the solver for ODEProblems, with the DifferentialEquations.jl package. It’s very inconsistent when the problem will arise (I’m scanning across a large number of …

---

## [UndefVarError for closure defined in a function](https://discourse.julialang.org/t/undefvarerror-for-closure-defined-in-a-function/129809)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 6\
**Last updated:** [June 12, 2025, 10:48am UTC](https://discourse.julialang.org/t/undefvarerror-for-closure-defined-in-a-function/129809 "2025-06-12T10:48:31Z")

</div>

Hi all. I’m working on an EM algorithm which will necessarily call many optimization solves (using Optim.jl). That means that I’ll need to optimize various functions while holding other values constant. The obvious way t…

---

## [Engineering formatting with SI prefixes using Formatting.jl](https://discourse.julialang.org/t/engineering-formatting-with-si-prefixes-using-formatting-jl/103107)

<div class="topic-metadata">

**Author:** [@owiecc](https://discourse.julialang.org/u/owiecc)\
**Replies:** 3\
**Last updated:** [June 12, 2025, 7:55am UTC](https://discourse.julialang.org/t/engineering-formatting-with-si-prefixes-using-formatting-jl/103107 "2025-06-12T07:55:15Z")

</div>

I am trying to use pretty formatting engineering with Formatting.jl but I fail. Is it possible to automatically format numbers with SI prefixes and, ideally, be able to select precision? E.g.: 0.01 → 10m 0.022 → 22m …

---

## [I want help about combination problem](https://discourse.julialang.org/t/i-want-help-about-combination-problem/129821)

<div class="topic-metadata">

**Author:** [@nunf](https://discourse.julialang.org/u/nunf)\
**Replies:** 5\
**Last updated:** [June 12, 2025, 7:48am UTC](https://discourse.julialang.org/t/i-want-help-about-combination-problem/129821 "2025-06-12T07:48:27Z")

</div>

I have array of 1-38 I want to choose 11 of them, so it will have 1203322288 possibility. and I want to do some calculation on all combination. If I loop one by one through all combination It will take very long time. …

---

## [Flux error](https://discourse.julialang.org/t/flux-error/129818)

<div class="topic-metadata">

**Author:** [@Smara\_Kazenango](https://discourse.julialang.org/u/Smara_Kazenango)\
**Replies:** 1\
**Last updated:** [June 11, 2025, 8:43pm UTC](https://discourse.julialang.org/t/flux-error/129818 "2025-06-11T20:43:19Z")

</div>

using Flux.Data: DataLoader I am getting error that Data is not defined?

---

## [Cannot solve sylvester equation with sparse matrix](https://discourse.julialang.org/t/cannot-solve-sylvester-equation-with-sparse-matrix/129787)

<div class="topic-metadata">

**Author:** [@Giorgos\_Vretinaris](https://discourse.julialang.org/u/Giorgos_Vretinaris)\
**Replies:** 3\
**Last updated:** [June 11, 2025, 4:02pm UTC](https://discourse.julialang.org/t/cannot-solve-sylvester-equation-with-sparse-matrix/129787 "2025-06-11T16:02:47Z")

</div>

Hello, I have a peculiar situation where I am trying to solve AX + XB = C but A is sparse, for example think of A as a differential operator. But, this isn’t allowed, I have a small working example here: begin A = …

---

## [Julia (AcceleratedKernels) vs JAX time comparison](https://discourse.julialang.org/t/julia-acceleratedkernels-vs-jax-time-comparison/129781)

<div class="topic-metadata">

**Author:** [@mcp](https://discourse.julialang.org/u/mcp)\
**Replies:** 21\
**Last updated:** [June 11, 2025, 1:54pm UTC](https://discourse.julialang.org/t/julia-acceleratedkernels-vs-jax-time-comparison/129781 "2025-06-11T13:54:33Z")

</div>

Hi everyone! Following this topic, I’d like to understand how to write an efficient CPU/GPU agnostic code using AcceleratedKernels.jl. My problem is writing the joint PDF of two random variables, one of which is condit…

---

## [How to check if a dataframe column exists](https://discourse.julialang.org/t/how-to-check-if-a-dataframe-column-exists/129802)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 5\
**Last updated:** [June 11, 2025, 1:54pm UTC](https://discourse.julialang.org/t/how-to-check-if-a-dataframe-column-exists/129802 "2025-06-11T13:54:07Z")

</div>

Hi, how to properly check if a column is present in a dataframe ? E.g. verify col1, col3. using DataFrames df = DataFrame(col1 = \[1, 2\], col2 = \[2, 1\])

---

## [OpenSSL\_jll error after PyCall-importing a module which uses libcrypto](https://discourse.julialang.org/t/openssl-jll-error-after-pycall-importing-a-module-which-uses-libcrypto/129806)

<div class="topic-metadata">

**Author:** [@polhager](https://discourse.julialang.org/u/polhager)\
**Replies:** 0\
**Last updated:** [June 11, 2025, 1:53pm UTC](https://discourse.julialang.org/t/openssl-jll-error-after-pycall-importing-a-module-which-uses-libcrypto/129806 "2025-06-11T13:53:15Z")

</div>

So OpenSSL\_jll uses libcrypto and libssl, both of which are downloaded as artifacts. libssl has a dependency on libcrypto, so when loading libssl the system also looks for libcrypto. During normal usage, everything works…

---

## [How should one make a struct that handles a HTTP.jl server?](https://discourse.julialang.org/t/how-should-one-make-a-struct-that-handles-a-http-jl-server/129799)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 0\
**Last updated:** [June 11, 2025, 10:10am UTC](https://discourse.julialang.org/t/how-should-one-make-a-struct-that-handles-a-http-jl-server/129799 "2025-06-11T10:10:21Z")

</div>

HTTP.server says it can’t be finalizerd. ERROR: objects of type HTTP.Servers.Server{HTTP.Servers.Listener{Nothing, Sockets.TCPServer}} cannot be finalized So if I have a struct like mutable struct M reciverClient::HT…

---

## [KeyError on the first time I import my (in development) package with Revise](https://discourse.julialang.org/t/keyerror-on-the-first-time-i-import-my-in-development-package-with-revise/129797)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 0\
**Last updated:** [June 11, 2025, 9:16am UTC](https://discourse.julialang.org/t/keyerror-on-the-first-time-i-import-my-in-development-package-with-revise/129797 "2025-06-11T09:16:47Z")

</div>

I am developing a package that uses PythonCall. The first time I import my package I get the error: ERROR: InitError: KeyError: key Base.PkgId(Base.UUID("6099a3de-0909-46bc-b1f4-468b9a2dfc0d"), "PythonCall") not found …

---

## [Defining \`show\` method for all \`MIME\` types at once threw an error for \`display\`](https://discourse.julialang.org/t/defining-show-method-for-all-mime-types-at-once-threw-an-error-for-display/129790)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 2\
**Last updated:** [June 10, 2025, 9:33pm UTC](https://discourse.julialang.org/t/defining-show-method-for-all-mime-types-at-once-threw-an-error-for-display/129790 "2025-06-10T21:33:44Z")

</div>

MWE (tested on Julia 1.11.5): julia\> struct MyT{T} a::T end julia\> import Base: show julia\> Base.show(io::IO, ::MIME, obj::MyT) = print(io, typeof(obj), "(...)") julia\> MyT(1) Error showing value of…

---

## [Iterable signature, revisited](https://discourse.julialang.org/t/iterable-signature-revisited/129647)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 14\
**Last updated:** [June 10, 2025, 8:48pm UTC](https://discourse.julialang.org/t/iterable-signature-revisited/129647 "2025-06-10T20:48:11Z")

</div>

There have been a few threads over the years about how to declare a function argument as “iterable” somehow, for example in Iterable type signature? . For me (at least in my latest situation) the important part isn’t th…

---

## [Mac M2 Ultra brought to its knees](https://discourse.julialang.org/t/mac-m2-ultra-brought-to-its-knees/129747)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 18\
**Last updated:** [June 10, 2025, 3:36am UTC](https://discourse.julialang.org/t/mac-m2-ultra-brought-to-its-knees/129747 "2025-06-10T03:36:26Z")

</div>

This is the platform. I run a simulation which solves repeatedly a sparse system of complex linear equations. It can do ~60k system per frequency in around 4-5 seconds. If I start julia on two of these simultaneously,…

---

## [InexactError when saving compressed CSV file (but not if I save it uncompressed)](https://discourse.julialang.org/t/inexacterror-when-saving-compressed-csv-file-but-not-if-i-save-it-uncompressed/129784)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [June 10, 2025, 3:08pm UTC](https://discourse.julialang.org/t/inexacterror-when-saving-compressed-csv-file-but-not-if-i-save-it-uncompressed/129784 "2025-06-10T15:08:58Z")

</div>

x is a 15M x 243 DataFrame: julia\> x 14259735×243 DataFrame Row │ C R Y pr\_m1\_yl4 pr\_m2\_yl4 pr\_m3\_yl4 pr\_m4\_yl4 p ⋯ │ Int64 Int64 Int64 Float64 Float64 Float64 Float64 F…

---

## [Understanding Tullio performances](https://discourse.julialang.org/t/understanding-tullio-performances/129760)

<div class="topic-metadata">

**Author:** [@mcp](https://discourse.julialang.org/u/mcp)\
**Replies:** 12\
**Last updated:** [June 10, 2025, 12:25pm UTC](https://discourse.julialang.org/t/understanding-tullio-performances/129760 "2025-06-10T12:25:57Z")

</div>

Hi everyone! I’m new to Julia and I’m trying to translate a JAX code in Julia using Tullio macro that makes the code simple and clean. However, I’m not able to get the same performances even with simple functions. Here…

---

## [NonlinearSolve with in-place mutation of intermediate variables](https://discourse.julialang.org/t/nonlinearsolve-with-in-place-mutation-of-intermediate-variables/129771)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 2\
**Last updated:** [June 9, 2025, 9:21pm UTC](https://discourse.julialang.org/t/nonlinearsolve-with-in-place-mutation-of-intermediate-variables/129771 "2025-06-09T21:21:31Z")

</div>

I’m working on an economic model involving a dynamic programming problem. Solving this problem involves mutating several large’ish (e.g., 100 x 3 x 15 x 200) arrays at each iteration. To make the code efficient, I se…

---

## [Examples of tools that embed Julia in the wild?](https://discourse.julialang.org/t/examples-of-tools-that-embed-julia-in-the-wild/129720)

<div class="topic-metadata">

**Author:** [@MDSW](https://discourse.julialang.org/u/MDSW)\
**Replies:** 0\
**Last updated:** [June 7, 2025, 2:44am UTC](https://discourse.julialang.org/t/examples-of-tools-that-embed-julia-in-the-wild/129720 "2025-06-07T02:44:27Z")

</div>

Are there any public examples of apps or tools that use the embedding API? I’m interested in how these have been packaged for deployment, especially the inclusion of the Julia runtime libraries, cross-platform delivery, …

---

## [PackageCompiler app using a lot of RAM](https://discourse.julialang.org/t/packagecompiler-app-using-a-lot-of-ram/129599)

<div class="topic-metadata">

**Author:** [@victor\_vhrn](https://discourse.julialang.org/u/victor_vhrn)\
**Replies:** 3\
**Last updated:** [June 7, 2025, 7:48pm UTC](https://discourse.julialang.org/t/packagecompiler-app-using-a-lot-of-ram/129599 "2025-06-07T19:48:55Z")

</div>

I created an App via PackageCompiler.jl, but running the app is using way more memory than what is used with the code running in the REPL. I removed all using statements from my code and only import what’s necessary. Add…

---

## [Approaches to sentinel values in immutables](https://discourse.julialang.org/t/approaches-to-sentinel-values-in-immutables/129675)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 71\
**Last updated:** [June 9, 2025, 9:25am UTC](https://discourse.julialang.org/t/approaches-to-sentinel-values-in-immutables/129675 "2025-06-09T09:25:06Z")

</div>

What are some approaches to define sentinel values in immutables without introducing type instabilities? Am asking for DynamicExpressions.jl to try to reduce allocations in the branch allowing n-degree nodes. Some conte…

---

## [Issue with Atom Selection mddf calculation (ComplexMixtures.jl from python)](https://discourse.julialang.org/t/issue-with-atom-selection-mddf-calculation-complexmixtures-jl-from-python/129604)

<div class="topic-metadata">

**Author:** [@SnehaSahuvs4](https://discourse.julialang.org/u/SnehaSahuvs4)\
**Replies:** 10\
**Last updated:** [June 9, 2025, 9:43am UTC](https://discourse.julialang.org/t/issue-with-atom-selection-mddf-calculation-complexmixtures-jl-from-python/129604 "2025-06-09T09:43:55Z")

</div>

Hi @lmiq I’m encountering an issue when calculating the center of mass using cm.select(). Specifically, it seems that the selection is not correctly including all the specified residues. For example, whether I use: pr…

---

## [How do you like to save your data and how much customizability do you like/need?](https://discourse.julialang.org/t/how-do-you-like-to-save-your-data-and-how-much-customizability-do-you-like-need/129707)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 5\
**Last updated:** [June 8, 2025, 2:39pm UTC](https://discourse.julialang.org/t/how-do-you-like-to-save-your-data-and-how-much-customizability-do-you-like-need/129707 "2025-06-08T14:39:01Z")

</div>

I’m making an application that controls a spectrometer (among other things). The program is likely to be saving dozens if not hundreds of spectra, each being about 0.5MB. There’s also some positional metadata that comes…

---

## [Memory issue that is solved by manually calling GC.gc()](https://discourse.julialang.org/t/memory-issue-that-is-solved-by-manually-calling-gc-gc/129690)

<div class="topic-metadata">

**Author:** [@kockahonza](https://discourse.julialang.org/u/kockahonza)\
**Replies:** 2\
**Last updated:** [June 8, 2025, 1:10pm UTC](https://discourse.julialang.org/t/memory-issue-that-is-solved-by-manually-calling-gc-gc/129690 "2025-06-08T13:10:30Z")

</div>

Hi, so my problem is pretty much the title, currently my code runs and does not fail but I would quite like to get to the bottom of this as this I find it somewhat concerning. Sadly I cannot provide a MWE for this as it …

---

## [How to use \`which\`](https://discourse.julialang.org/t/how-to-use-which/129731)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 1\
**Last updated:** [June 8, 2025, 5:19am UTC](https://discourse.julialang.org/t/how-to-use-which/129731 "2025-06-08T05:19:36Z")

</div>

The manual for the which function gives the following 3 variants: help?\> which search: which @which which(f, types) Returns the method of f (a Method object) that would be called for arguments of the given types. …

---

## [More flexible parametric types](https://discourse.julialang.org/t/more-flexible-parametric-types/129671)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 13\
**Last updated:** [June 7, 2025, 9:07pm UTC](https://discourse.julialang.org/t/more-flexible-parametric-types/129671 "2025-06-07T21:07:06Z")

</div>

I would like to have the functionality displayed in the definition of S₂. This code obviously does not work (and I understand why), but what would be the closest thing to accomplishing such functionality? Thanks! Back…

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

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