# General Usage

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

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

**Page:** 21

---

## [Problem with Optim.optimize](https://discourse.julialang.org/t/problem-with-optim-optimize/135368)

<div class="topic-metadata">

**Author:** [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Replies:** 2\
**Last updated:** [January 31, 2026, 1:45pm UTC](https://discourse.julialang.org/t/problem-with-optim-optimize/135368 "2026-01-31T13:45:23Z")

</div>

Consider the minimal example using Optim f(x) = (x\[1\]-2)^2 + (x\[2\]-3)^2 + sin(3\*x\[1\] + 1) + cos(5\*x\[2\]) optimize(f, \[1., 1.\], BFGS()) For reasons that I don’t comprehend, I get the following error: ERROR: BoundsErro…

---

## [Interactive equation solver](https://discourse.julialang.org/t/interactive-equation-solver/135367)

<div class="topic-metadata">

**Author:** [@dharmatech](https://discourse.julialang.org/u/dharmatech)\
**Replies:** 1\
**Last updated:** [January 31, 2026, 11:02am UTC](https://discourse.julialang.org/t/interactive-equation-solver/135367 "2026-01-31T11:02:23Z")

</div>

Hello :man\_raising\_hand: Are there any projects that provide an interactive equation solver for Symbolics.jl? Here’s an example of what I mean, but for sympy/Python: Just curious to review any existing w…

---

## [Skip empty entries of sparse matrix when plotting a heatmap](https://discourse.julialang.org/t/skip-empty-entries-of-sparse-matrix-when-plotting-a-heatmap/135343)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 5\
**Last updated:** [January 30, 2026, 8:11pm UTC](https://discourse.julialang.org/t/skip-empty-entries-of-sparse-matrix-when-plotting-a-heatmap/135343 "2026-01-30T20:11:30Z")

</div>

I want to plot a sparse matrix as a heatmap, something like this: julia\> using Plots, SparseArrays julia\> x = sprand(Float64, 5, 5, 0.5) 5×5 SparseMatrixCSC{Float64, Int64} with 11 stored entries: ⋅ ⋅ …

---

## [Getting revise to work with symlink'ed .julia folder](https://discourse.julialang.org/t/getting-revise-to-work-with-symlinked-julia-folder/135363)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 0\
**Last updated:** [January 30, 2026, 7:23pm UTC](https://discourse.julialang.org/t/getting-revise-to-work-with-symlinked-julia-folder/135363 "2026-01-30T19:23:30Z")

</div>

I work on some form of shared system, where I don’t have much space allocation. Since the .julia folder can get quite large with various stuff, I have put it on a (less fancily backed up\_ scratch folder, and replaced by …

---

## [Improve performance of this index creation and accessing code](https://discourse.julialang.org/t/improve-performance-of-this-index-creation-and-accessing-code/134235)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 65\
**Last updated:** [January 30, 2026, 3:47pm UTC](https://discourse.julialang.org/t/improve-performance-of-this-index-creation-and-accessing-code/134235 "2026-01-30T15:47:32Z")

</div>

How to improve the performance of clp(j) function given below. Please suggest faster version of this code. I am converting spherical coordinates to Cartesian and placing color values to exact location in data. Otherwise…

---

## [Pre-built binaries via the registry](https://discourse.julialang.org/t/pre-built-binaries-via-the-registry/134515)

<div class="topic-metadata">

**Author:** [@mattsignorelli](https://discourse.julialang.org/u/mattsignorelli)\
**Replies:** 15\
**Last updated:** [January 30, 2026, 10:07am UTC](https://discourse.julialang.org/t/pre-built-binaries-via-the-registry/134515 "2026-01-30T10:07:08Z")

</div>

Right now precompilation is run on users’ computers after they add a package. Sometimes these can take a very long time (e.g. Makie.jl or DifferentialEquations.jl). Sure, you only have to do it once, but then you have to…

---

## [GC problems with \`jl\_gc\_unsafe\_enter\` with multithreaded embedding](https://discourse.julialang.org/t/gc-problems-with-jl-gc-unsafe-enter-with-multithreaded-embedding/104467)

<div class="topic-metadata">

**Author:** [@Keluaa](https://discourse.julialang.org/u/Keluaa)\
**Replies:** 3\
**Last updated:** [January 30, 2026, 7:39am UTC](https://discourse.julialang.org/t/gc-problems-with-jl-gc-unsafe-enter-with-multithreaded-embedding/104467 "2026-01-30T07:39:26Z")

</div>

I am currently developping a Kotlin library to embed Julia in the JVM, with the goal to support multithreading with jl\_adopt\_thread(). The main issue is that when using some frameworks, there may not be a way to be in co…

---

## [Which version of JuliaFormatter is used in VS code?](https://discourse.julialang.org/t/which-version-of-juliaformatter-is-used-in-vs-code/127885)

<div class="topic-metadata">

**Author:** [@dharasim](https://discourse.julialang.org/u/dharasim)\
**Replies:** 5\
**Last updated:** [January 30, 2026, 2:12am UTC](https://discourse.julialang.org/t/which-version-of-juliaformatter-is-used-in-vs-code/127885 "2026-01-30T02:12:48Z")

</div>

I would like to know which version of JuliaFormatter.jl is used by the Julia extension for VS Code when I run the command Format Document. I don’t have JuliaFormatter in my global env and also not in my current project e…

---

## [Converting cartesian index to what it would be in view](https://discourse.julialang.org/t/converting-cartesian-index-to-what-it-would-be-in-view/135310)

<div class="topic-metadata">

**Author:** [@croberts](https://discourse.julialang.org/u/croberts)\
**Replies:** 4\
**Last updated:** [January 29, 2026, 10:37pm UTC](https://discourse.julialang.org/t/converting-cartesian-index-to-what-it-would-be-in-view/135310 "2026-01-29T22:37:01Z")

</div>

Suppose we have a = CartesianIndices((3,3)) b = a\[2:3, :\] indx = CartesianIndex((3,3)) map\_index\_to\_what\_it\_would\_be\_in\_slice(?, indx::CartesianIndex) = ? using Test @test a\[indx\] == b\[map\_index\_to\_what\_it\_would\_be…

---

## [Keyword arguments of 32-bit type don't work](https://discourse.julialang.org/t/keyword-arguments-of-32-bit-type-dont-work/135311)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 6\
**Last updated:** [January 29, 2026, 5:37pm UTC](https://discourse.julialang.org/t/keyword-arguments-of-32-bit-type-dont-work/135311 "2026-01-29T17:37:28Z")

</div>

Why 32bit keyword argument functions give error (Int32 also) ? julia\> x = 2 2 julia\> function sixty\_four(x; y::Float64=0.5) x+y end sixty\_four (generic function with 1 method) julia\> function thi…

---

## [Julia in Colab](https://discourse.julialang.org/t/julia-in-colab/126600)

<div class="topic-metadata">

**Author:** [@metrizable](https://discourse.julialang.org/u/metrizable)\
**Replies:** 57\
**Last updated:** [January 29, 2026, 2:22pm UTC](https://discourse.julialang.org/t/julia-in-colab/126600 "2026-01-29T14:22:58Z")

</div>

Hi Julia community! I’m new to posting here (this is my first one :-)) and wasn’t sure the right place to post, but I’d like to share that Colab now provides the Julia language in our runtimes (Julia as a language in ru…

---

## [How to manage environments in Colab?](https://discourse.julialang.org/t/how-to-manage-environments-in-colab/132435)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [January 29, 2026, 2:06pm UTC](https://discourse.julialang.org/t/how-to-manage-environments-in-colab/132435 "2026-01-29T14:06:46Z")

</div>

Newby of colab here.. how do environments, that in local installations are directory-based, are managed in colab notebooks? How do I “save” one environment between multiple runs of the notebook (so not to precompile ever…

---

## [Resize!(matrix)](https://discourse.julialang.org/t/resize-matrix/2379)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 51\
**Last updated:** [January 29, 2026, 12:59pm UTC](https://discourse.julialang.org/t/resize-matrix/2379 "2026-01-29T12:59:04Z")

</div>

is it possible to resize an Array with more than one dimension? For example: tmp1 = collect(1:6) @show pointer(tmp1) for i in 1:5 resize!(tmp1, length(tmp1) + 2) @show pointer(tmp1) tmp2 = reshape(tmp1, 2…

---

## [SparseArrays vs CUSPARSE](https://discourse.julialang.org/t/sparsearrays-vs-cusparse/135320)

<div class="topic-metadata">

**Author:** [@rcalxrc08](https://discourse.julialang.org/u/rcalxrc08)\
**Replies:** 0\
**Last updated:** [January 29, 2026, 10:55am UTC](https://discourse.julialang.org/t/sparsearrays-vs-cusparse/135320 "2026-01-29T10:55:13Z")

</div>

I have no idea if this is intentional or not, at the moment there is an inconstency in the julia and or CUDA stack when dense and sparse vectors are interacting: using SparseArrays, CUDA N=10 x\_cpu=randn(N); x\_sparse=sp…

---

## [Using SymbolicRegression on binary data?](https://discourse.julialang.org/t/using-symbolicregression-on-binary-data/135314)

<div class="topic-metadata">

**Author:** [@atthom](https://discourse.julialang.org/u/atthom)\
**Replies:** 0\
**Last updated:** [January 28, 2026, 11:52pm UTC](https://discourse.julialang.org/t/using-symbolicregression-on-binary-data/135314 "2026-01-28T23:52:41Z")

</div>

I was fiddling with the excellent SymbolicRegression.jl when I had issue executing this code: using SymbolicRegression A = rand(Bool, (1000, 5)) B = @. (A\[:, 1\] | A\[:, 2\]) & (!A\[:, 3\]) ⊻ A\[:, 4\] # Define options for s…

---

## [Issue with \`@lock\`](https://discourse.julialang.org/t/issue-with-lock/135302)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 2\
**Last updated:** [January 28, 2026, 12:20am UTC](https://discourse.julialang.org/t/issue-with-lock/135302 "2026-01-28T00:20:50Z")

</div>

help?\> @lock @lock l expr Macro version of lock(f, l::AbstractLock) but with expr instead of f function. Expands to: lock(l) try expr finally unlock(l) end I’m not sure if this is a bug. jul…

---

## [Parallelization with Evolutionary.jl](https://discourse.julialang.org/t/parallelization-with-evolutionary-jl/135286)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 8\
**Last updated:** [January 27, 2026, 6:16pm UTC](https://discourse.julialang.org/t/parallelization-with-evolutionary-jl/135286 "2026-01-27T18:16:33Z")

</div>

I would like to run an optimzation with a costly objective function (about 1s execution time) in parallel. The documentation says: If the objective function is heavily CPU-bound, it’s possible to utilize multiple proce…

---

## [WARNING: Detected access to binding XXX in a world prior to its definition world](https://discourse.julialang.org/t/warning-detected-access-to-binding-xxx-in-a-world-prior-to-its-definition-world/135273)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 7\
**Last updated:** [January 27, 2026, 9:59am UTC](https://discourse.julialang.org/t/warning-detected-access-to-binding-xxx-in-a-world-prior-to-its-definition-world/135273 "2026-01-27T09:59:24Z")

</div>

suddenly as of today (1/26/26) I got a lot of warnings as in the title when launching Julia. Nothing updated, why??? How to avoid those warning? Using 1.12.3

---

## [Loading an image in place](https://discourse.julialang.org/t/loading-an-image-in-place/135276)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 4\
**Last updated:** [January 26, 2026, 10:50pm UTC](https://discourse.julialang.org/t/loading-an-image-in-place/135276 "2026-01-26T22:50:03Z")

</div>

Is there any method available in general libraries that can load images to a pre allocated array (to avoid allocations during runtime), assuming the user knows the image size (or pre allocates a larger array and fills a …

---

## [Julia1.12 world age problem related to PlotlyJS.jl (WebIO)](https://discourse.julialang.org/t/julia1-12-world-age-problem-related-to-plotlyjs-jl-webio/135162)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 17\
**Last updated:** [January 26, 2026, 9:52pm UTC](https://discourse.julialang.org/t/julia1-12-world-age-problem-related-to-plotlyjs-jl-webio/135162 "2026-01-26T21:52:03Z")

</div>

Hi, A warning (about world age) is fetched when I load my project since I switched to Julia 1.12. My project uses PlotlyJS.jl which is the only package in Project.toml being related to WebIO.jl. WARNING: Detected acce…

---

## [Workspaces - how?](https://discourse.julialang.org/t/workspaces-how/133181)

<div class="topic-metadata">

**Author:** [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Replies:** 10\
**Last updated:** [January 26, 2026, 9:34pm UTC](https://discourse.julialang.org/t/workspaces-how/133181 "2026-01-26T21:34:22Z")

</div>

Workspaces, described in the 1.12 announcement, sound useful, but after reading this and any documentation I could find they are still mysterious to me. How do I make a workspace and use it? Do I edit the Project file di…

---

## [Use of Reactant.jl on existing framework](https://discourse.julialang.org/t/use-of-reactant-jl-on-existing-framework/135261)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 9\
**Last updated:** [January 26, 2026, 4:09pm UTC](https://discourse.julialang.org/t/use-of-reactant-jl-on-existing-framework/135261 "2026-01-26T16:09:17Z")

</div>

Hello, I have some generic function that tests some functionalities of a package. The function does something like this function shared\_function(T, array\_type) x = rand(T, 10, 10) dx = array\_type(x) @test s…

---

## [Mixed agent types in OpenStreetMapSpace](https://discourse.julialang.org/t/mixed-agent-types-in-openstreetmapspace/135272)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [January 26, 2026, 12:28pm UTC](https://discourse.julialang.org/t/mixed-agent-types-in-openstreetmapspace/135272 "2026-01-26T12:28:21Z")

</div>

Hello, I am interested in developing a simulation with Agents.jl involving motor vehicles and pedestrians. The goal is to analyze the impact of pedestrian traffic on motor vehicle traffic. In this simulation, motor vehi…

---

## [Memory usage & garbage collection of Dagger](https://discourse.julialang.org/t/memory-usage-garbage-collection-of-dagger/133324)

<div class="topic-metadata">

**Author:** [@Rutger0000](https://discourse.julialang.org/u/Rutger0000)\
**Replies:** 6\
**Last updated:** [January 26, 2026, 9:58am UTC](https://discourse.julialang.org/t/memory-usage-garbage-collection-of-dagger/133324 "2026-01-26T09:58:44Z")

</div>

Hi all, Problem: There is a heavy\_computation() which returns a large Array. The computation of the heavy\_computation() is parallelized with the help of Dagger.jl. The DTasks are spawned and later fetched. Running thi…

---

## [How to Print/Parse a TimePeriod with a Specific Format?](https://discourse.julialang.org/t/how-to-print-parse-a-timeperiod-with-a-specific-format/78322)

<div class="topic-metadata">

**Author:** [@MLackner](https://discourse.julialang.org/u/MLackner)\
**Replies:** 9\
**Last updated:** [January 26, 2026, 3:41am UTC](https://discourse.julialang.org/t/how-to-print-parse-a-timeperiod-with-a-specific-format/78322 "2026-01-26T03:41:12Z")

</div>

Hi! I want to parse and print durations in the format "HH:MM:SS.sss". Parsing seems to be pretty simple. if I do for example julia\> str = "1:02:23.234" "1:02:23.234" julia\> t = Time(str) 01:02:23.234 this seems to wor…

---

## [Are there alternatives to Diagonal and eigvals compatible with Reactant?](https://discourse.julialang.org/t/are-there-alternatives-to-diagonal-and-eigvals-compatible-with-reactant/135081)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 13\
**Last updated:** [January 26, 2026, 3:22am UTC](https://discourse.julialang.org/t/are-there-alternatives-to-diagonal-and-eigvals-compatible-with-reactant/135081 "2026-01-26T03:22:02Z")

</div>

Hello! I’m in the process of refactoring a complicated function so that it can be compiled by Reactant. It has not been very straightforward, but the speedup I’ve seen so far certainly justifies the effort. Nonetheless…

---

## [Problems with TikzGraphs.jl](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 6\
**Last updated:** [January 25, 2026, 2:03pm UTC](https://discourse.julialang.org/t/problems-with-tikzgraphs-jl/135251 "2026-01-25T14:03:29Z")

</div>

I installed the TikzGraphs.jl package, and tried to execute the simple sample code provided using TikzGraphs using Graphs g = DiGraph(4) add\_edge!(g, 1, 2) add\_edge!(g, 2, 3) TikzGraphs.plot(g) However I keep getting t…

---

## [Precompilation much slower in 1.11, 1.12 than in LTS (1.10)](https://discourse.julialang.org/t/precompilation-much-slower-in-1-11-1-12-than-in-lts-1-10/135203)

<div class="topic-metadata">

**Author:** [@mattsignorelli](https://discourse.julialang.org/u/mattsignorelli)\
**Replies:** 16\
**Last updated:** [January 24, 2026, 4:12pm UTC](https://discourse.julialang.org/t/precompilation-much-slower-in-1-11-1-12-than-in-lts-1-10/135203 "2026-01-24T16:12:54Z")

</div>

The title pretty much. See this Github workflow for an example. 1.12 and 1.11 take 8 minutes, vs 1.10 at 3 minutes. Does anyone know why this is happening?

---

## [Julia crashed when using PyCall in multiple threads](https://discourse.julialang.org/t/julia-crashed-when-using-pycall-in-multiple-threads/111004)

<div class="topic-metadata">

**Author:** [@wly](https://discourse.julialang.org/u/wly)\
**Replies:** 14\
**Last updated:** [January 24, 2026, 10:56am UTC](https://discourse.julialang.org/t/julia-crashed-when-using-pycall-in-multiple-threads/111004 "2026-01-24T10:56:24Z")

</div>

I first make multiple copies of a PyObject, and then access them in multiple threads. Finally, I meet this error. julia -t5 using PyCall py""" class A(): x = 0.0 a = A() """ alist = \[deepcopy(py"a") for i in 1:10…

---

## [Multi-GPU inference in Flux.jl](https://discourse.julialang.org/t/multi-gpu-inference-in-flux-jl/135210)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 2\
**Last updated:** [January 24, 2026, 12:07am UTC](https://discourse.julialang.org/t/multi-gpu-inference-in-flux-jl/135210 "2026-01-24T00:07:26Z")

</div>

Flux allows for parallel training with multiple GPUs: GPU Support · Flux In my use case, I need to run inference of a single model on multiple GPUs. Is there a way to load balance inference calls to the model so all GPU…

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

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