# General Usage

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

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

**Page:** 78

---

## [Why does my iterable allocate?](https://discourse.julialang.org/t/why-does-my-iterable-allocate/86216)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 18\
**Last updated:** [March 22, 2025, 11:25pm UTC](https://discourse.julialang.org/t/why-does-my-iterable-allocate/86216 "2025-03-22T23:25:47Z")

</div>

I ran into unexpected allocations in a complex iterator and was able to simplify it down into this MWE which uses complex logic to always yield nothing. struct MyIter end Base.iterate(::MyIter) = (nothing, \[true\]) func…

---

## [CUDA perf on Int types](https://discourse.julialang.org/t/cuda-perf-on-int-types/127263)

<div class="topic-metadata">

**Author:** [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Replies:** 0\
**Last updated:** [March 22, 2025, 5:01pm UTC](https://discourse.julialang.org/t/cuda-perf-on-int-types/127263 "2025-03-22T17:01:49Z")

</div>

I wonder why CUDA mul! performance isn’t that good on Int32 using CUDA N = 2^10 A = CUDA.ones(Int32,N, N) B = CUDA.ones(Int32,N, N) CUDA.@time A\*B A = CUDA.ones(Float32,N, N) B = CUDA.ones(Float32,N, N) CUDA.@time A\*B …

---

## [Is there a way to select the type of indices Ti with sprand()?](https://discourse.julialang.org/t/is-there-a-way-to-select-the-type-of-indices-ti-with-sprand/127259)

<div class="topic-metadata">

**Author:** [@AntoineBut](https://discourse.julialang.org/u/AntoineBut)\
**Replies:** 1\
**Last updated:** [March 22, 2025, 12:15pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-select-the-type-of-indices-ti-with-sprand/127259 "2025-03-22T12:15:21Z")

</div>

The function sprand() has methods to specify the type of the generated elements {Tv}. But a SparseArray has two type parameters, the second being the type used to stores the indices {Ti}. Does anyone have a magic trick t…

---

## [Interacting agents in discrete event simulations](https://discourse.julialang.org/t/interacting-agents-in-discrete-event-simulations/122070)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 11\
**Last updated:** [March 22, 2025, 12:05pm UTC](https://discourse.julialang.org/t/interacting-agents-in-discrete-event-simulations/122070 "2025-03-22T12:05:05Z")

</div>

Hello, I would like to develop a simulation in which agents interact in pairs for a random period of time. While a pair is interacting, the agents in the pair are “busy”, meaning they are not available to interact with …

---

## [Makie: integrating a marker into a string](https://discourse.julialang.org/t/makie-integrating-a-marker-into-a-string/127257)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 0\
**Last updated:** [March 22, 2025, 8:14am UTC](https://discourse.julialang.org/t/makie-integrating-a-marker-into-a-string/127257 "2025-03-22T08:14:59Z")

</div>

I’m trying to make a figure in which I’d like a marker to appear in the tile. For example, a dummy figure title is: title = L"$$Panel 1 (star6)" where star6 refers to a marker appearing on another panel. Is there any…

---

## [MethodError: no method matching UnitCommitmentData](https://discourse.julialang.org/t/methoderror-no-method-matching-unitcommitmentdata/127253)

<div class="topic-metadata">

**Author:** [@daiyucan](https://discourse.julialang.org/u/daiyucan)\
**Replies:** 0\
**Last updated:** [March 22, 2025, 6:25am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-unitcommitmentdata/127253 "2025-03-22T06:25:43Z")

</div>

using JuMP using HiGHS 定义UnitCommitmentData结构 struct UnitCommitmentData demand::Float64 pmin::Vector{Float64} pmax::Vector{Float64} cfix::Vector{Float64} cvar::Vector{Float64} end 构建Unit Commitment模型 function bu…

---

## [Precompilation error when evaling into a module in the \_\_init\_\_ function](https://discourse.julialang.org/t/precompilation-error-when-evaling-into-a-module-in-the-init-function/126935)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 3\
**Last updated:** [March 22, 2025, 5:20am UTC](https://discourse.julialang.org/t/precompilation-error-when-evaling-into-a-module-in-the-init-function/126935 "2025-03-22T05:20:45Z")

</div>

Is this allowed? module PackageProblem function \_\_init\_\_() @eval begin struct NewType a::Float64 end const b = NewType(1.0) end end The package loads fine julia\> using Pac…

---

## [Pluto notebook is slower than REPL](https://discourse.julialang.org/t/pluto-notebook-is-slower-than-repl/127145)

<div class="topic-metadata">

**Author:** [@contejuz](https://discourse.julialang.org/u/contejuz)\
**Replies:** 6\
**Last updated:** [March 22, 2025, 2:43am UTC](https://discourse.julialang.org/t/pluto-notebook-is-slower-than-repl/127145 "2025-03-22T02:43:32Z")

</div>

Is there any reason a Pluto notebook can be slower than the REPL? When I use @time, it seems like both take the same amount of time to run a particular function (involving sampling from a probabilistic program using Gen.…

---

## [Cannot recreate JumpProcess example in Catalyst](https://discourse.julialang.org/t/cannot-recreate-jumpprocess-example-in-catalyst/127248)

<div class="topic-metadata">

**Author:** [@contejuz](https://discourse.julialang.org/u/contejuz)\
**Replies:** 0\
**Last updated:** [March 22, 2025, 1:47am UTC](https://discourse.julialang.org/t/cannot-recreate-jumpprocess-example-in-catalyst/127248 "2025-03-22T01:47:02Z")

</div>

I’ve been using Catalyst successfully for the past few weeks. It’s pretty great! However, I recently tried to update PlutoUI from 0.7.14 to 0.7.51 (not sure why such an old version was installed). I then updated all my p…

---

## [Reinterpret vector of mixed-type tuples](https://discourse.julialang.org/t/reinterpret-vector-of-mixed-type-tuples/127230)

<div class="topic-metadata">

**Author:** [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Replies:** 4\
**Last updated:** [March 21, 2025, 10:52pm UTC](https://discourse.julialang.org/t/reinterpret-vector-of-mixed-type-tuples/127230 "2025-03-21T22:52:36Z")

</div>

I want to reinterpret a vector of mixed-type tuples as a vector of UInt8, however, I receive an error: b = reinterpret(UInt8, Tuple{UInt8, UInt32}\[(1, 2)\]); b\[1\] This is very close to the docs example of reinterpret, w…

---

## [Abstract type for 1-indexed Arrays](https://discourse.julialang.org/t/abstract-type-for-1-indexed-arrays/127240)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 4\
**Last updated:** [March 21, 2025, 9:39pm UTC](https://discourse.julialang.org/t/abstract-type-for-1-indexed-arrays/127240 "2025-03-21T21:39:36Z")

</div>

Is there an abstract type that includes only absract arrays which have “standard” indexing, by which I mean the first valid index along each axis is 1, and the last valid index along the i-th axis of A is size(A, i)? I …

---

## [How to design GUI interfaces in Julia?](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159)

<div class="topic-metadata">

**Author:** [@TinWallop](https://discourse.julialang.org/u/TinWallop)\
**Replies:** 68\
**Last updated:** [March 21, 2025, 1:11pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159 "2025-03-21T13:11:39Z")

</div>

Coming from a windows C# (visual studio) and Java background I’m very disappointed in the lack of support for User Interface development. I know some packages exist but they are developed by an individual. Perhaps I shou…

---

## [Thread.jl yields wrong results in parallelisation compared to serial for-loop](https://discourse.julialang.org/t/thread-jl-yields-wrong-results-in-parallelisation-compared-to-serial-for-loop/127239)

<div class="topic-metadata">

**Author:** [@Xu\_Shan](https://discourse.julialang.org/u/Xu_Shan)\
**Replies:** 7\
**Last updated:** [March 21, 2025, 8:09pm UTC](https://discourse.julialang.org/t/thread-jl-yields-wrong-results-in-parallelisation-compared-to-serial-for-loop/127239 "2025-03-21T20:09:52Z")

</div>

Hi Guys, I am using @thread for my model parallelisation. However, it yields different results compared to serial for-loop. Here is my script function batch\_cost\_function(p) num\_params = size(p, 2) # Number of para…

---

## [Neural ODE with unkown time steps](https://discourse.julialang.org/t/neural-ode-with-unkown-time-steps/124986)

<div class="topic-metadata">

**Author:** [@Moustafa](https://discourse.julialang.org/u/Moustafa)\
**Replies:** 9\
**Last updated:** [March 21, 2025, 7:15pm UTC](https://discourse.julialang.org/t/neural-ode-with-unkown-time-steps/124986 "2025-03-21T19:15:46Z")

</div>

Hey! , I am trying to model 3D points in space using a Neural ODE, those points form a trajectory since they originated from the same particle and are ‘snapshots’ of it throughout time, I want to use a Neural ODE to mode…

---

## [Plot pane and focus in vscode](https://discourse.julialang.org/t/plot-pane-and-focus-in-vscode/127214)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 1\
**Last updated:** [March 21, 2025, 4:21pm UTC](https://discourse.julialang.org/t/plot-pane-and-focus-in-vscode/127214 "2025-03-21T16:21:11Z")

</div>

Hi, I have a problem when working in vscode. Figure produced within the vscode window are not easily “copy-able” (Julia: Copy Plot). It yields the error message: Failed to copy plot: Plot pane does not have focus I nee…

---

## [Jupyter notebooks slowness/usability](https://discourse.julialang.org/t/jupyter-notebooks-slowness-usability/127216)

<div class="topic-metadata">

**Author:** [@mattsignorelli](https://discourse.julialang.org/u/mattsignorelli)\
**Replies:** 2\
**Last updated:** [March 21, 2025, 4:12pm UTC](https://discourse.julialang.org/t/jupyter-notebooks-slowness-usability/127216 "2025-03-21T16:12:27Z")

</div>

I hope this doesn’t come across as a “complaining” post. I just have some big concerns about this and was curious if the problem is being addressed. I am a primary contributor to a DOE funded project for a new, modern, …

---

## [Problems with simple linear model (R and Julia comparison)](https://discourse.julialang.org/t/problems-with-simple-linear-model-r-and-julia-comparison/127229)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 3\
**Last updated:** [March 21, 2025, 4:01pm UTC](https://discourse.julialang.org/t/problems-with-simple-linear-model-r-and-julia-comparison/127229 "2025-03-21T16:01:32Z")

</div>

Hi all, I’m trying to reproduce some R code. Can someone help me figure out why the difference in these polynomial regressions is so different between Julia and R? Yes, a 9th order polynomial fit is not practical; I’m tr…

---

## [Interpolation between two dataframe columns](https://discourse.julialang.org/t/interpolation-between-two-dataframe-columns/127136)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 4\
**Last updated:** [March 21, 2025, 12:31pm UTC](https://discourse.julialang.org/t/interpolation-between-two-dataframe-columns/127136 "2025-03-21T12:31:14Z")

</div>

Hi, I think my code is highly sub-optimised, is there a more monolithic way (and preferably faster) to interpolate, e.g. without using eachrow, push etc. Code: using DataFrames using Interpolations # Dates, then valu…

---

## [Restarting kernel in Jupyterlab does not kill child processes](https://discourse.julialang.org/t/restarting-kernel-in-jupyterlab-does-not-kill-child-processes/127209)

<div class="topic-metadata">

**Author:** [@Miroboru](https://discourse.julialang.org/u/Miroboru)\
**Replies:** 0\
**Last updated:** [March 21, 2025, 9:37am UTC](https://discourse.julialang.org/t/restarting-kernel-in-jupyterlab-does-not-kill-child-processes/127209 "2025-03-21T09:37:50Z")

</div>

I am often using Jupyterlab when I work with Julia, and for computation intensive tasks I often start out with using Distributed addprocs(25-nprocs()) @everywhere import Dagger From time to time the kernel needs to be …

---

## ["invalid assignment location" error](https://discourse.julialang.org/t/invalid-assignment-location-error/1630)

<div class="topic-metadata">

**Author:** [@andrea](https://discourse.julialang.org/u/andrea)\
**Replies:** 6\
**Last updated:** [January 22, 2017, 9:01am UTC](https://discourse.julialang.org/t/invalid-assignment-location-error/1630 "2017-01-22T09:01:38Z")

</div>

Sorry ti all, I’ve already posted a question for a real stupid error, but you…at the beginning… Now I have another question…I’ve this simple code function bn\_dirichlet\_prior(N) n = length(N) alpha = cell(n, 1); fo…

---

## [AMDGPU.jl on Fedora 41 with RX 7600](https://discourse.julialang.org/t/amdgpu-jl-on-fedora-41-with-rx-7600/127160)

<div class="topic-metadata">

**Author:** [@lxmota](https://discourse.julialang.org/u/lxmota)\
**Replies:** 2\
**Last updated:** [March 21, 2025, 2:27am UTC](https://discourse.julialang.org/t/amdgpu-jl-on-fedora-41-with-rx-7600/127160 "2025-03-21T02:27:04Z")

</div>

Here is my experience so far trying to use AMDGPU.jl on Fedora 41 with an RX 7600 GPU. Installed RPM Packages rocm-comgr-18-10.rocm6.2.1.fc41.x86\_64 hsakmt-1.0.6-46.rocm6.2.1.fc41.x86\_64 rocm-runtime-6.2.1-2.fc41.x86\_64…

---

## [Replicating Runge's phenomenon with ApproxFun](https://discourse.julialang.org/t/replicating-runges-phenomenon-with-approxfun/127155)

<div class="topic-metadata">

**Author:** [@khoffie](https://discourse.julialang.org/u/khoffie)\
**Replies:** 8\
**Last updated:** [March 20, 2025, 11:51pm UTC](https://discourse.julialang.org/t/replicating-runges-phenomenon-with-approxfun/127155 "2025-03-20T23:51:50Z")

</div>

Hi there, I want to replicate Runge’s phenomenon Runge's phenomenon - Wikipedia Specifically, I want to interpolate Runge’s function with a taylor series. I expect that the polynomial I fit oscillates like crazy at the …

---

## [How to select elements of a three-dimensional array fast](https://discourse.julialang.org/t/how-to-select-elements-of-a-three-dimensional-array-fast/127185)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 4\
**Last updated:** [March 20, 2025, 10:28pm UTC](https://discourse.julialang.org/t/how-to-select-elements-of-a-three-dimensional-array-fast/127185 "2025-03-20T22:28:50Z")

</div>

I have large three-dimensional arrays A that have different values, but from which I always wish to select the same set of entries. So A is a different matrix each time, but it has the same size and I need to collect th…

---

## [How to deprecate a function, not in favor of anything?](https://discourse.julialang.org/t/how-to-deprecate-a-function-not-in-favor-of-anything/124202)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 10\
**Last updated:** [March 20, 2025, 7:35pm UTC](https://discourse.julialang.org/t/how-to-deprecate-a-function-not-in-favor-of-anything/124202 "2025-03-20T19:35:17Z")

</div>

I’m preparing a new version of WringTwistree because I found a bug. Some functions are exported only because they’re used in tests; when I wrote it, I hadn’t figured out how to access an unexported function. (I previousl…

---

## [Can we (easily) share Pluto notebooks on JuliaHub?](https://discourse.julialang.org/t/can-we-easily-share-pluto-notebooks-on-juliahub/60247)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 3\
**Last updated:** [March 20, 2025, 1:08am UTC](https://discourse.julialang.org/t/can-we-easily-share-pluto-notebooks-on-juliahub/60247 "2025-03-20T01:08:08Z")

</div>

Hello. These days I am obsessed with the idea of sharing Pluto notebooks. For Jupyter notebooks, I found the solution by nextjournal.com quite attracting. For Pluto, Binder looks interresting, based on pluto-on-binder…

---

## [Can't build local package](https://discourse.julialang.org/t/cant-build-local-package/127159)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 2\
**Last updated:** [March 20, 2025, 3:54pm UTC](https://discourse.julialang.org/t/cant-build-local-package/127159 "2025-03-20T15:54:24Z")

</div>

Here is the error message: (@v1.11) pkg\> build ConvLayer Precompiling project... ✗ ConvLayer 0 dependencies successfully precompiled in 1 seconds. 423 already precompiled. 1 dependency errored. For a report of t…

---

## [Why is this code allocating?](https://discourse.julialang.org/t/why-is-this-code-allocating/127175)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [March 20, 2025, 2:48pm UTC](https://discourse.julialang.org/t/why-is-this-code-allocating/127175 "2025-03-20T14:48:07Z")

</div>

Why is the following code allocating: using VortexStepMethod # Step 1: Define wing parameters n\_panels = 20 # Number of panels span = 20.0 # Wing span \[m\] chord = 1.0 # Chord length \[m\] v…

---

## [What is the best way to use a config file that stores variables that my module needs](https://discourse.julialang.org/t/what-is-the-best-way-to-use-a-config-file-that-stores-variables-that-my-module-needs/127171)

<div class="topic-metadata">

**Author:** [@ghadgeabhi](https://discourse.julialang.org/u/ghadgeabhi)\
**Replies:** 2\
**Last updated:** [March 20, 2025, 2:04pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-use-a-config-file-that-stores-variables-that-my-module-needs/127171 "2025-03-20T14:04:20Z")

</div>

Having some issues and not finding the right way to add config files to my module. I have a lot of variables that change a lot when using my module and config files are the best way to do this. I would like to know how …

---

## [Bug in symbolic\_solve and symbolic\_linear\_solve](https://discourse.julialang.org/t/bug-in-symbolic-solve-and-symbolic-linear-solve/127157)

<div class="topic-metadata">

**Author:** [@CiccioPasticcio](https://discourse.julialang.org/u/CiccioPasticcio)\
**Replies:** 1\
**Last updated:** [March 20, 2025, 7:44am UTC](https://discourse.julialang.org/t/bug-in-symbolic-solve-and-symbolic-linear-solve/127157 "2025-03-20T07:44:41Z")

</div>

Is this a bug? julia\> symbolic\_solve(x+im,x) 1-element Vector{Complex{Int64}}: 0 - 1im julia\> symbolic\_solve(x+im~0,x) 1-element Vector{Int64}: 0 julia\> symbolic\_solve(x^2+im~1,x) 2-element Vector{BigInt}: -1 1 …

---

## [Python downstream testing, can't figure out CI to install the libraries?](https://discourse.julialang.org/t/python-downstream-testing-cant-figure-out-ci-to-install-the-libraries/127153)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 4\
**Last updated:** [March 20, 2025, 7:44am UTC](https://discourse.julialang.org/t/python-downstream-testing-cant-figure-out-ci-to-install-the-libraries/127153 "2025-03-20T07:44:10Z")

</div>

For our diffeqpy library, we used to have downstream testing setup in SciMLBase.jl so that way our core changes wouldn’t break the core functionality when accessed through Python. However, it’s not working now after the …

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

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