# General Usage

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

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

**Page:** 98

---

## [EOFError when extracting from a ZipFile inside a function](https://discourse.julialang.org/t/eoferror-when-extracting-from-a-zipfile-inside-a-function/124511)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 5\
**Last updated:** [January 7, 2025, 10:12pm UTC](https://discourse.julialang.org/t/eoferror-when-extracting-from-a-zipfile-inside-a-function/124511 "2025-01-07T22:12:14Z")

</div>

I am trying to download a Zip file and extract a few files. When I run this code outside of a function, it works great. However, when wrapped in a function I get an EOFError. I’ve included the two versions below. Any ad…

---

## [Persistent tree data structure as an alternative to Rust-like borrow checker](https://discourse.julialang.org/t/persistent-tree-data-structure-as-an-alternative-to-rust-like-borrow-checker/124485)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 9\
**Last updated:** [January 7, 2025, 9:57pm UTC](https://discourse.julialang.org/t/persistent-tree-data-structure-as-an-alternative-to-rust-like-borrow-checker/124485 "2025-01-07T21:57:57Z")

</div>

Hi, @MilesCranmer, I’m opening this as a separate thread so the other thread can focus on your thoughts about a Rust-like borrow checker for Julia. I made an example of a Node type with a splice method that replaces a s…

---

## [GLMakie error: cannot get context in Julia 1.11.\*, but works in Julia 1.10.\*](https://discourse.julialang.org/t/glmakie-error-cannot-get-context-in-julia-1-11-but-works-in-julia-1-10/124509)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 2\
**Last updated:** [January 7, 2025, 7:44pm UTC](https://discourse.julialang.org/t/glmakie-error-cannot-get-context-in-julia-1-11-but-works-in-julia-1-10/124509 "2025-01-07T19:44:53Z")

</div>

Plotting with GLMakie causes a crash. I don’t understand what is missing: julia\> VERSION v"1.11.2" glxinfo | grep “OpenGL version” OpenGL version string: 4.6.0 NVIDIA 470.256.02 using Colors using Distributions …

---

## [Accessors.jl - "Dynamic" version of @reset](https://discourse.julialang.org/t/accessors-jl-dynamic-version-of-reset/124493)

<div class="topic-metadata">

**Author:** [@kampfkoloss](https://discourse.julialang.org/u/kampfkoloss)\
**Replies:** 3\
**Last updated:** [January 7, 2025, 4:35pm UTC](https://discourse.julialang.org/t/accessors-jl-dynamic-version-of-reset/124493 "2025-01-07T16:35:06Z")

</div>

Hi, I want to use @reset in Accessors.jl to update some immutable data. The issue is that I have a “path” to the object which changes dynamically, and in my actual code it is impossible to “hard-code” this path. A minim…

---

## [How to interpolate a scalar field?](https://discourse.julialang.org/t/how-to-interpolate-a-scalar-field/124499)

<div class="topic-metadata">

**Author:** [@Valery](https://discourse.julialang.org/u/Valery)\
**Replies:** 1\
**Last updated:** [January 7, 2025, 3:18pm UTC](https://discourse.julialang.org/t/how-to-interpolate-a-scalar-field/124499 "2025-01-07T15:18:20Z")

</div>

I want to get a polynomial scalar field that interpolate z as a function of x and y. # consider an integer k, # then the goal is that a called function f(x\[k\],y\[k\]) # would approximate z\[k\]. # abscissa example with dum…

---

## [Instability after reducing number of equations in DifferentialEquations.jl](https://discourse.julialang.org/t/instability-after-reducing-number-of-equations-in-differentialequations-jl/124133)

<div class="topic-metadata">

**Author:** [@diffeqslvr](https://discourse.julialang.org/u/diffeqslvr)\
**Replies:** 10\
**Last updated:** [January 7, 2025, 2:56pm UTC](https://discourse.julialang.org/t/instability-after-reducing-number-of-equations-in-differentialequations-jl/124133 "2025-01-07T14:56:51Z")

</div>

I have a large set of differential equations (O(10000)) which I try to solve using Tsit5() and DifferentialEquations.jl. sol = solve( prob, Tsit5(), dtmax = 0.1, maxiters = 100000, progress = true, saveat = 0.01, …

---

## [\[pre-ANN\] StackEnvs.jl](https://discourse.julialang.org/t/pre-ann-stackenvs-jl/124487)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 0\
**Last updated:** [January 7, 2025, 12:19am UTC](https://discourse.julialang.org/t/pre-ann-stackenvs-jl/124487 "2025-01-07T00:19:40Z")

</div>

StackEnvs.jl From the README: StackEnvs provides tools for minimal management of a shared environment that is meant to be used from your “stacked environment” but never to be active itself. This is useful if you are d…

---

## [Using Oscar takes a long time to import (~1 minute) — Is this expected behavior?](https://discourse.julialang.org/t/using-oscar-takes-a-long-time-to-import-1-minute-is-this-expected-behavior/124494)

<div class="topic-metadata">

**Author:** [@Rowing0914](https://discourse.julialang.org/u/Rowing0914)\
**Replies:** 2\
**Last updated:** [January 7, 2025, 12:32pm UTC](https://discourse.julialang.org/t/using-oscar-takes-a-long-time-to-import-1-minute-is-this-expected-behavior/124494 "2025-01-07T12:32:33Z")

</div>

Hello, I noticed that importing the Oscar.jl package in Julia using using Oscar takes quite a long time, around a minute. Here’s a simple reproducible example: julia Copy code @time using Oscar On my machine, it con…

---

## [FunctionWrappers.jl -\> ERROR: LoadError: TypeError: in cfunction, expected Union{}, got a value of type Nothing](https://discourse.julialang.org/t/functionwrappers-jl-error-loaderror-typeerror-in-cfunction-expected-union-got-a-value-of-type-nothing/112447)

<div class="topic-metadata">

**Author:** [@mcmuffin6o](https://discourse.julialang.org/u/mcmuffin6o)\
**Replies:** 4\
**Last updated:** [January 7, 2025, 11:49am UTC](https://discourse.julialang.org/t/functionwrappers-jl-error-loaderror-typeerror-in-cfunction-expected-union-got-a-value-of-type-nothing/112447 "2025-01-07T11:49:04Z")

</div>

The more I investigated this error, the more confused I got. It’s to the point where I don’t even think I could give an accurate reproduction procedure. All I know and all I want to share with people that search for thi…

---

## [How to fix some parameters when least-squares-fitting using \`NonlinearSolve\`?](https://discourse.julialang.org/t/how-to-fix-some-parameters-when-least-squares-fitting-using-nonlinearsolve/124451)

<div class="topic-metadata">

**Author:** [@thudjx](https://discourse.julialang.org/u/thudjx)\
**Replies:** 4\
**Last updated:** [January 7, 2025, 9:28am UTC](https://discourse.julialang.org/t/how-to-fix-some-parameters-when-least-squares-fitting-using-nonlinearsolve/124451 "2025-01-07T09:28:03Z")

</div>

I have 2 questions: I find there are two different practices when performing lsqfit. One defines a function without a sideeffect, as done here; the other defines a function that mutates a predefined variable, examplifi…

---

## [Broadcasting performance](https://discourse.julialang.org/t/broadcasting-performance/123392)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 13\
**Last updated:** [January 6, 2025, 9:39am UTC](https://discourse.julialang.org/t/broadcasting-performance/123392 "2025-01-06T09:39:27Z")

</div>

f(x) = sin(x)cos(x)tan(x)exp(x)sin(x)cos(x)tan(x)exp(x) X = randn(100\_000\_000) @time f.(X) # 4 seconds @time @threads for x in X; f(x) end # .8 seconds 16 threads @time @turbo f.(X) …

---

## [Multiple page plots](https://discourse.julialang.org/t/multiple-page-plots/124481)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 5\
**Last updated:** [January 6, 2025, 9:41pm UTC](https://discourse.julialang.org/t/multiple-page-plots/124481 "2025-01-06T21:41:28Z")

</div>

As shown in the following plot, Makie’s GridLayout is ideal for making a small multiple plot as described by Edward Tufte as a way to make plots more informative by increasing their “data density”. This is especially hel…

---

## [How to compute TanhExp / TeLU function accurately?](https://discourse.julialang.org/t/how-to-compute-tanhexp-telu-function-accurately/124464)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 10\
**Last updated:** [January 6, 2025, 5:07pm UTC](https://discourse.julialang.org/t/how-to-compute-tanhexp-telu-function-accurately/124464 "2025-01-06T17:07:34Z")

</div>

A new paper advocates using the TeLU activation function, x \\cdot \\tanh (e^x), for neural networks, also proposed in this paper under the name TanhExp. The intermediate result e^x grows very fast for large x, even thoug…

---

## [Two activation methods differ on results](https://discourse.julialang.org/t/two-activation-methods-differ-on-results/124386)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 2\
**Last updated:** [January 6, 2025, 4:27pm UTC](https://discourse.julialang.org/t/two-activation-methods-differ-on-results/124386 "2025-01-06T16:27:04Z")

</div>

When activating projects, I’m seeing some different results for a couple of methods I thought were supposed to be essentially the same. This runs fine: % julia --project=examples -e 'using MyProj' jul…

---

## [RCall: function / method conflict with R functions](https://discourse.julialang.org/t/rcall-function-method-conflict-with-r-functions/124370)

<div class="topic-metadata">

**Author:** [@hatmatrix](https://discourse.julialang.org/u/hatmatrix)\
**Replies:** 11\
**Last updated:** [January 6, 2025, 4:17pm UTC](https://discourse.julialang.org/t/rcall-function-method-conflict-with-r-functions/124370 "2025-01-06T16:17:18Z")

</div>

Hello everyone, I am trying to figure out the resolution order of conflicting methods, particularly as it regards to the theme function in ggplot2 from R and Plots in Julia. Following up on the question here: I’ve tr…

---

## [Matlab-like code-loading?](https://discourse.julialang.org/t/matlab-like-code-loading/124469)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 1\
**Last updated:** [January 6, 2025, 4:20pm UTC](https://discourse.julialang.org/t/matlab-like-code-loading/124469 "2025-01-06T16:20:37Z")

</div>

Users of my package need to write small functions and small scripts that invoke those functions. The users are familiar with Matlab, and I would like to mimic Matlab’s code-loading protocol to ease the users’ learning c…

---

## [Intermittent non-Julia error](https://discourse.julialang.org/t/intermittent-non-julia-error/124465)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 5\
**Last updated:** [January 6, 2025, 4:06pm UTC](https://discourse.julialang.org/t/intermittent-non-julia-error/124465 "2025-01-06T16:06:42Z")

</div>

I have a deved copy of XLSX.jl which I’m working on. It currently passes all tests. When I try to use it in my own code, it works some of the time and fails others. This is not a run time failure that produces a normal J…

---

## [JuliaHub Datasets](https://discourse.julialang.org/t/juliahub-datasets/105669)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 4\
**Last updated:** [January 6, 2025, 3:27pm UTC](https://discourse.julialang.org/t/juliahub-datasets/105669 "2025-01-06T15:27:56Z")

</div>

This may not be the right place to ask this question, but I think a lot of people who are very active in this forum work at/founded JuliaHub so just posting here for now. I see that there is the ability to load datasets…

---

## [Project.toml with dev used](https://discourse.julialang.org/t/project-toml-with-dev-used/124431)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 2\
**Last updated:** [January 6, 2025, 3:10pm UTC](https://discourse.julialang.org/t/project-toml-with-dev-used/124431 "2025-01-06T15:10:09Z")

</div>

I have a package that has dependencies on packages from the General registry and other packages developed here. The output of the Pkg.status command is: Status \`C:\\Users\\jakez\\.julia\\dev\\Foo\\Project.toml\` \[a93c6f00\] …

---

## [Openssl artifact carries old openssl version](https://discourse.julialang.org/t/openssl-artifact-carries-old-openssl-version/124420)

<div class="topic-metadata">

**Author:** [@olaca09](https://discourse.julialang.org/u/olaca09)\
**Replies:** 3\
**Last updated:** [January 6, 2025, 2:54pm UTC](https://discourse.julialang.org/t/openssl-artifact-carries-old-openssl-version/124420 "2025-01-06T14:54:47Z")

</div>

I’ve encountered a strange issue, which I suspect might be system specific, but I am not well versed enough in these matters to understand how. My Plots.jl stopped precompiling the other day, together with a handful of …

---

## [How to use \`NonlinearSolve\` to perform least squares fitting?](https://discourse.julialang.org/t/how-to-use-nonlinearsolve-to-perform-least-squares-fitting/124449)

<div class="topic-metadata">

**Author:** [@thudjx](https://discourse.julialang.org/u/thudjx)\
**Replies:** 3\
**Last updated:** [January 6, 2025, 12:50pm UTC](https://discourse.julialang.org/t/how-to-use-nonlinearsolve-to-perform-least-squares-fitting/124449 "2025-01-06T12:50:30Z")

</div>

I am trying to use NonlinearSolve to perform least squares fitting, as shown in this example. One difference from that is in the model function, I have performed some operations on a matrix. And as shown in the figure be…

---

## [Why rank 0 cannot receive stdin input?](https://discourse.julialang.org/t/why-rank-0-cannot-receive-stdin-input/124450)

<div class="topic-metadata">

**Author:** [@Blumenkranz](https://discourse.julialang.org/u/Blumenkranz)\
**Replies:** 3\
**Last updated:** [January 6, 2025, 10:22am UTC](https://discourse.julialang.org/t/why-rank-0-cannot-receive-stdin-input/124450 "2025-01-06T10:22:58Z")

</div>

using MPI input\_channel = Channel{String}(1) test = Ref(false) function listen\_for\_input() @async begin println("Rank 0: Listening for input...") while true input = readline(stdin) …

---

## [Big performance slowdown increasing Julia threads but keeping parallelism the same?](https://discourse.julialang.org/t/big-performance-slowdown-increasing-julia-threads-but-keeping-parallelism-the-same/124385)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 4\
**Last updated:** [January 3, 2025, 1:19pm UTC](https://discourse.julialang.org/t/big-performance-slowdown-increasing-julia-threads-but-keeping-parallelism-the-same/124385 "2025-01-03T13:19:30Z")

</div>

I have some code for processing files in parallel like so (simplified): function process\_files\_parallel(paths, n\_parallel = 12) # create to-do list todo\_channel = Channel{eltype(paths)}(length(paths)) for p …

---

## [How to avoid catastrophic cancellation Bessel Integrals](https://discourse.julialang.org/t/how-to-avoid-catastrophic-cancellation-bessel-integrals/124363)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 2\
**Last updated:** [January 5, 2025, 11:52pm UTC](https://discourse.julialang.org/t/how-to-avoid-catastrophic-cancellation-bessel-integrals/124363 "2025-01-05T23:52:51Z")

</div>

Recently, I needed to evaluate some integrals involving linear combinations of J\_m and Y\_m. There are well-known analytical expressions for those, which are However, I am finding that when \\alpha and \\beta are very c…

---

## [Unable to install NeuralPDE](https://discourse.julialang.org/t/unable-to-install-neuralpde/124432)

<div class="topic-metadata">

**Author:** [@StarecZosima](https://discourse.julialang.org/u/StarecZosima)\
**Replies:** 4\
**Last updated:** [January 5, 2025, 10:20pm UTC](https://discourse.julialang.org/t/unable-to-install-neuralpde/124432 "2025-01-05T22:20:41Z")

</div>

I am trying to install NeuralPDE on my MacOS M1 machine and regretfully running into an error. I first tried Pkg.add("NeuralPDE") on a Jupyter notebook and the relevant part of the traceback seems Error building \`FFM…

---

## [Building a deb package out of PackageCompiler generated binary](https://discourse.julialang.org/t/building-a-deb-package-out-of-packagecompiler-generated-binary/124187)

<div class="topic-metadata">

**Author:** [@Lior\_Assouline](https://discourse.julialang.org/u/Lior_Assouline)\
**Replies:** 3\
**Last updated:** [January 5, 2025, 4:17pm UTC](https://discourse.julialang.org/t/building-a-deb-package-out-of-packagecompiler-generated-binary/124187 "2025-01-05T16:17:53Z")

</div>

Hi All, I’m looking for the old and and wise in this forum for a specific issue I’m running when trying to package a binary generated with PackageCompiler into a regular deb pkg. In shlibdeps stage the deb packger trie…

---

## [How to run RISC-V Julia on other architectures?](https://discourse.julialang.org/t/how-to-run-risc-v-julia-on-other-architectures/124399)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 4\
**Last updated:** [January 5, 2025, 3:00pm UTC](https://discourse.julialang.org/t/how-to-run-risc-v-julia-on-other-architectures/124399 "2025-01-05T15:00:48Z")

</div>

I want to try RISC-V Julia on my laptop which have x86-64 architecture. How to run RISC-V Julia on other architectures also?

---

## [Using PackageCompiler Header file time modified even content not changed using force](https://discourse.julialang.org/t/using-packagecompiler-header-file-time-modified-even-content-not-changed-using-force/124441)

<div class="topic-metadata">

**Author:** [@xgdgsc](https://discourse.julialang.org/u/xgdgsc)\
**Replies:** 1\
**Last updated:** [January 5, 2025, 2:00pm UTC](https://discourse.julialang.org/t/using-packagecompiler-header-file-time-modified-even-content-not-changed-using-force/124441 "2025-01-05T14:00:00Z")

</div>

Currently the build command create\_library(".", "MyLib"; lib\_name="libmine", precompile\_execution\_file="build/generate\_precompile.jl", precompile\_statements\_file="build/additional\_precompile.jl", header\_…

---

## [How to sort NTuple](https://discourse.julialang.org/t/how-to-sort-ntuple/11535)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 5\
**Last updated:** [January 5, 2025, 12:57pm UTC](https://discourse.julialang.org/t/how-to-sort-ntuple/11535 "2025-01-05T12:57:53Z")

</div>

I have several integers input from a function like this function foo(a::Int...) end How do I sort a? I have to collect it first and sort it as a vector at the moment. Will it possible to sort it directly?

---

## [Changing font size when using julia-mono-listings](https://discourse.julialang.org/t/changing-font-size-when-using-julia-mono-listings/119861)

<div class="topic-metadata">

**Author:** [@pao](https://discourse.julialang.org/u/pao)\
**Replies:** 2\
**Last updated:** [January 5, 2025, 9:08am UTC](https://discourse.julialang.org/t/changing-font-size-when-using-julia-mono-listings/119861 "2025-01-05T09:08:15Z")

</div>

Hi, folks anybody knows how to change the font size when using julia-mono-listings to write Julia codes in articles and books? The default looks too big for two-columns typesetting. The standard LaTeX commands (\\sm…

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

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