# Latest

**URL:** https://discourse.julialang.org/latest.md?page=697

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

**Page:** 698

---

## [Help with AutoDiff in Metal.jl](https://discourse.julialang.org/t/help-with-autodiff-in-metal-jl/98937)

<div class="topic-metadata">

**Author:** [@raktim](https://discourse.julialang.org/u/raktim)\
**Replies:** 7\
**Last updated:** [May 17, 2023, 5:54am UTC](https://discourse.julialang.org/t/help-with-autodiff-in-metal-jl/98937 "2023-05-17T05:54:58Z")

</div>

I am trying to use Metal.jl for a scientific computation and having difficulty with AutoDiff (ForwardDiff). I am using julia 1.9. This is the code dF = x-\>ForwardDiff.gradient(x-\>dot(x,x),x) N = 7; x = rand(Float32,N);…

---

## [JuliaHub - Julia IDE fresh environment](https://discourse.julialang.org/t/juliahub-julia-ide-fresh-environment/98967)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 2\
**Last updated:** [May 17, 2023, 4:53am UTC](https://discourse.julialang.org/t/juliahub-julia-ide-fresh-environment/98967 "2023-05-17T04:53:36Z")

</div>

In JuliaHub with Julia IDE is it possible to wipe all files and installed packages and start again with a fresh environment, on the same account ?

---

## [Why \`any!\`?](https://discourse.julialang.org/t/why-any/98976)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [May 17, 2023, 3:31am UTC](https://discourse.julialang.org/t/why-any/98976 "2023-05-17T03:31:29Z")

</div>

Why does any! exist? Why not just broadcast or map any?

---

## [Why is GPU kernel rand() not as "random" as CPU rand()?](https://discourse.julialang.org/t/why-is-gpu-kernel-rand-not-as-random-as-cpu-rand/98892)

<div class="topic-metadata">

**Author:** [@ReWoP](https://discourse.julialang.org/u/ReWoP)\
**Replies:** 10\
**Last updated:** [May 17, 2023, 2:41am UTC](https://discourse.julialang.org/t/why-is-gpu-kernel-rand-not-as-random-as-cpu-rand/98892 "2023-05-17T02:41:53Z")

</div>

Hi all, I’m implementing some optimization algorithms in the GPU (CUDA) that rely on, among other things, random numbers to set the exploration of the search space. I’m also comparing the results with the CPU implementa…

---

## [Adding cuts iteratively](https://discourse.julialang.org/t/adding-cuts-iteratively/98902)

<div class="topic-metadata">

**Author:** [@Saba\_ghasemi](https://discourse.julialang.org/u/Saba_ghasemi)\
**Replies:** 8\
**Last updated:** [May 17, 2023, 2:40am UTC](https://discourse.julialang.org/t/adding-cuts-iteratively/98902 "2023-05-17T02:40:50Z")

</div>

I am attempting to incorporate perspective cuts into a non-linear model for linearization using the JuMP package. My aim is to utilize the SCIP solver and introduce a cut every 5 seconds, utilizing a feasible point to ad…

---

## [Troubleshooting Integration](https://discourse.julialang.org/t/troubleshooting-integration/98957)

<div class="topic-metadata">

**Author:** [@yoshi](https://discourse.julialang.org/u/yoshi)\
**Replies:** 5\
**Last updated:** [May 17, 2023, 12:11am UTC](https://discourse.julialang.org/t/troubleshooting-integration/98957 "2023-05-17T00:11:14Z")

</div>

Hi, I’m having trouble thinking about how to troubleshoot the following equation. I’ve isolated the time step that produces the error and have examined many values that the error suggests to look at (for instance, the v…

---

## [Is there a shorthand to make all fields of a struct the same type?](https://discourse.julialang.org/t/is-there-a-shorthand-to-make-all-fields-of-a-struct-the-same-type/98961)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 1\
**Last updated:** [May 16, 2023, 11:20pm UTC](https://discourse.julialang.org/t/is-there-a-shorthand-to-make-all-fields-of-a-struct-the-same-type/98961 "2023-05-16T23:20:52Z")

</div>

E.g struct myStruct ::Float64 #apply to all a b c end

---

## [Avoiding for Loop in JuMP](https://discourse.julialang.org/t/avoiding-for-loop-in-jump/98920)

<div class="topic-metadata">

**Author:** [@Gagan\_Meena](https://discourse.julialang.org/u/Gagan_Meena)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 9:35pm UTC](https://discourse.julialang.org/t/avoiding-for-loop-in-jump/98920 "2023-05-16T21:35:04Z")

</div>

Is it possible to avoid for loop for the code given below. @expression(JSTEP, Inj\[i=1:n, j=1:s\], Pg\[i,j\] - Pdmax\[i,j\] + PD\[i,j\] - PC\[i,j\]) for i = 1:r f = from\[i\] t = to\[i\] for k =1:s Inj\[f,k\] = Inj\[f,k\] …

---

## [Nelder-Mead or other optimization](https://discourse.julialang.org/t/nelder-mead-or-other-optimization/98853)

<div class="topic-metadata">

**Author:** [@papar](https://discourse.julialang.org/u/papar)\
**Replies:** 5\
**Last updated:** [May 16, 2023, 9:28pm UTC](https://discourse.julialang.org/t/nelder-mead-or-other-optimization/98853 "2023-05-16T21:28:42Z")

</div>

I am trying to use Optim to find parameters of a vector valued function using the Nelder-Mead algorithm, but open to considering other algorithms or packages. The problem is to find parameters of a function by minimizing…

---

## [Error using ModelingToolkit](https://discourse.julialang.org/t/error-using-modelingtoolkit/98947)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [May 16, 2023, 8:55pm UTC](https://discourse.julialang.org/t/error-using-modelingtoolkit/98947 "2023-05-16T20:55:28Z")

</div>

If I run the following code: using ModelingToolkit, OrdinaryDiffEq, DataInterpolations Cp=\[0.024384377390186646,0.03811829845979822,0.05731175742000688,0.0803120051369546,0.10526323380995135,0.1312349486430945, 0.1…

---

## [Parallel precompilation and out-of-memory errors](https://discourse.julialang.org/t/parallel-precompilation-and-out-of-memory-errors/98952)

<div class="topic-metadata">

**Author:** [@slawrence](https://discourse.julialang.org/u/slawrence)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 7:38pm UTC](https://discourse.julialang.org/t/parallel-precompilation-and-out-of-memory-errors/98952 "2023-05-16T19:38:28Z")

</div>

My computer has 8 logical CPUs and only ~4GB of RAM usable to Julia. The result is that when I go to install a bunch of packages, it’s easy for parallel compilation to use up all my RAM and trigger the OOM killer (if I’m…

---

## [How do I actually use package extensions?](https://discourse.julialang.org/t/how-do-i-actually-use-package-extensions/98930)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 7\
**Last updated:** [May 16, 2023, 5:35pm UTC](https://discourse.julialang.org/t/how-do-i-actually-use-package-extensions/98930 "2023-05-16T17:35:12Z")

</div>

Say I wish to use ForwardDiffs static arrays extension. I can do: using ForwardDiff, StaticArrays How do I actually access methods from the extension? Because ForwardDiff.ForwardDiffStaticArraysExt gives me: ERROR:…

---

## [Costs of registering packages](https://discourse.julialang.org/t/costs-of-registering-packages/98845)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 25\
**Last updated:** [May 16, 2023, 5:19pm UTC](https://discourse.julialang.org/t/costs-of-registering-packages/98845 "2023-05-16T17:19:07Z")

</div>

I wonder what the costs associated with registering packages are. I brought up this subject in the thread on fragmentation, but it probably wasn’t the right place to ask this question. What I mean is: if I have a piece…

---

## [Fast ways of updating a \`CuArray\` along certain diagonals based on results from CPU](https://discourse.julialang.org/t/fast-ways-of-updating-a-cuarray-along-certain-diagonals-based-on-results-from-cpu/98910)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 0\
**Last updated:** [May 16, 2023, 6:11am UTC](https://discourse.julialang.org/t/fast-ways-of-updating-a-cuarray-along-certain-diagonals-based-on-results-from-cpu/98910 "2023-05-16T06:11:03Z")

</div>

I have a scenario in which I need to repetitively updating a CuArray along certain diagonals based on results computed from CPU. The number of diagonals involved can be small and may change across different problems (typ…

---

## [Problem loading saved neural network](https://discourse.julialang.org/t/problem-loading-saved-neural-network/98882)

<div class="topic-metadata">

**Author:** [@LucasMSpereira](https://discourse.julialang.org/u/LucasMSpereira)\
**Replies:** 9\
**Last updated:** [May 16, 2023, 4:09pm UTC](https://discourse.julialang.org/t/problem-loading-saved-neural-network/98882 "2023-05-16T16:09:46Z")

</div>

When trying to load a saved Flux NN with BSON.@load datasetPath \* "trainedNetworks/convnextGen.bson" cpuGenerator I’m getting a invalid struct allocation error. Since doing this last time, the only thing I did was upd…

---

## [Help with speeding up large ODE system from ModelingToolkit](https://discourse.julialang.org/t/help-with-speeding-up-large-ode-system-from-modelingtoolkit/98903)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 3:38pm UTC](https://discourse.julialang.org/t/help-with-speeding-up-large-ode-system-from-modelingtoolkit/98903 "2023-05-16T15:38:38Z")

</div>

Hi everyone, I’m trying to speed up the following ODE system, which is a backward-in-space discretization of a set of PDEs, which I’m generating using ModelingToolkit.jl. The bottleneck is in the construction of the sys…

---

## [Help with Custom Struct for High Dimensional COO Arrays](https://discourse.julialang.org/t/help-with-custom-struct-for-high-dimensional-coo-arrays/98934)

<div class="topic-metadata">

**Author:** [@ejmeitz](https://discourse.julialang.org/u/ejmeitz)\
**Replies:** 1\
**Last updated:** [May 16, 2023, 2:57pm UTC](https://discourse.julialang.org/t/help-with-custom-struct-for-high-dimensional-coo-arrays/98934 "2023-05-16T14:57:14Z")

</div>

Hello, I have an application where I need \>2 dimensional sparse arrays and I would like to test running them on the GPU as the application is embarrassingly parallel. My plan was to make a CuArray of the type TensorVal …

---

## [Question to range( sin, cos)](https://discourse.julialang.org/t/question-to-range-sin-cos/98896)

<div class="topic-metadata">

**Author:** [@msreo0](https://discourse.julialang.org/u/msreo0)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 2:24pm UTC](https://discourse.julialang.org/t/question-to-range-sin-cos/98896 "2023-05-16T14:24:53Z")

</div>

hi guys, I just wanted to plot a graph with Julia, but don’t know how to set interval of the function. the function is (1-cos(x))/x, and x != 0 & x \<\<1. I tried to write x = range(0.1, 0.2 , length=100) y = (1-cos.(x))…

---

## [What is causing type instability in this struct?](https://discourse.julialang.org/t/what-is-causing-type-instability-in-this-struct/98886)

<div class="topic-metadata">

**Author:** [@ejmeitz](https://discourse.julialang.org/u/ejmeitz)\
**Replies:** 13\
**Last updated:** [May 16, 2023, 2:08pm UTC](https://discourse.julialang.org/t/what-is-causing-type-instability-in-this-struct/98886 "2023-05-16T14:08:54Z")

</div>

I have the following struct and I’m a little confused why using @code\_warntype on it’s construct says there’s unstable types. The output from that command is a little verbose but I’ll copy one of the red parts in case th…

---

## [Fill a bounding box of a text in Makie](https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 9\
**Last updated:** [May 16, 2023, 2:08pm UTC](https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640 "2023-05-16T14:08:41Z")

</div>

I’d like to add background color to a text object in a Makie plot – fill the bounding box of the text with some color. If I understood it correctly, text does not have a size property, so bb here has size zero: t = tex…

---

## [Domain issue when working with nlsolve](https://discourse.julialang.org/t/domain-issue-when-working-with-nlsolve/98193)

<div class="topic-metadata">

**Author:** [@cdestael](https://discourse.julialang.org/u/cdestael)\
**Replies:** 16\
**Last updated:** [May 16, 2023, 1:58pm UTC](https://discourse.julialang.org/t/domain-issue-when-working-with-nlsolve/98193 "2023-05-16T13:58:27Z")

</div>

I am quite stumped on this problem so appreciate in advance any suggestions. I am currently working with a trade model and trying to solve a system of 4 equations using “nlsolve.” I am running into issues with the doma…

---

## [Read single quoted values inside strings](https://discourse.julialang.org/t/read-single-quoted-values-inside-strings/98877)

<div class="topic-metadata">

**Author:** [@uwbanjoman](https://discourse.julialang.org/u/uwbanjoman)\
**Replies:** 13\
**Last updated:** [May 16, 2023, 1:43pm UTC](https://discourse.julialang.org/t/read-single-quoted-values-inside-strings/98877 "2023-05-16T13:43:27Z")

</div>

Hi all, I have opened a text file using the readlines() function. This text file has various sections containing different information. In some of the lines i am finding strings that contain information inside single qu…

---

## [What goes in a MyModule.jl file? (particularly do you use PrecompileTools.jl neatly?)](https://discourse.julialang.org/t/what-goes-in-a-mymodule-jl-file-particularly-do-you-use-precompiletools-jl-neatly/98880)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 1:09pm UTC](https://discourse.julialang.org/t/what-goes-in-a-mymodule-jl-file-particularly-do-you-use-precompiletools-jl-neatly/98880 "2023-05-16T13:09:08Z")

</div>

Hi everyone, I like it when my code looks neat, I also love how much faster PrecompileTools makes TTFX in my modules. What I’m not sure on, however, is where to put the @compile\_workload part of the package. What I lik…

---

## [ERROR: Unable to find compatible target in system image (julia 1.9.0)](https://discourse.julialang.org/t/error-unable-to-find-compatible-target-in-system-image-julia-1-9-0/98921)

<div class="topic-metadata">

**Author:** [@JesperMartinsson](https://discourse.julialang.org/u/JesperMartinsson)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 12:50pm UTC](https://discourse.julialang.org/t/error-unable-to-find-compatible-target-in-system-image-julia-1-9-0/98921 "2023-05-16T12:50:04Z")

</div>

Hi everyone, With julia 1.8.5 (PackageCompiler v2.1.5) it works but when I recently upgraded to julia 1.9.0 (PackageCompiler v2.1.5) and deploy the same julia package in a container using PackageCompiler it results in t…

---

## [Computationally efficient image filtering](https://discourse.julialang.org/t/computationally-efficient-image-filtering/98889)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 12:49pm UTC](https://discourse.julialang.org/t/computationally-efficient-image-filtering/98889 "2023-05-16T12:49:16Z")

</div>

I would like to filter hundreds of thousands of small images (say 35x35), using 5x5 kernels (that do not factor). I only want the “good data,” meaning the 31x31 filtered image that comes from correlating the filter at ea…

---

## [Cannot add private repository from GitHub](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900)

<div class="topic-metadata">

**Author:** [@Mitch](https://discourse.julialang.org/u/Mitch)\
**Replies:** 23\
**Last updated:** [May 16, 2023, 12:40pm UTC](https://discourse.julialang.org/t/cannot-add-private-repository-from-github/84900 "2023-05-16T12:40:52Z")

</div>

Hi everyone, Unfortunately, I cannot add a private GitHub repository via Pkg.add(url=“…”), now that GitHub refuses the rsa format. HTTPS asks for a username and password three times then fails. I’ve seen the solution H…

---

## [How can I print an ODESystem](https://discourse.julialang.org/t/how-can-i-print-an-odesystem/98924)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 12:37pm UTC](https://discourse.julialang.org/t/how-can-i-print-an-odesystem/98924 "2023-05-16T12:37:21Z")

</div>

Using ModelingToolkit I created and simplified a system of equations. If I try to print it I get: julia\> sys Model sys with 2 equations States (2): ω(t) ωˍt(t) Parameters (4): J R A ρ Incidence matrix:2×3 Sp…

---

## [Advice on using @code\_warntype](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 5\
**Last updated:** [May 16, 2023, 11:49am UTC](https://discourse.julialang.org/t/advice-on-using-code-warntype/98899 "2023-05-16T11:49:28Z")

</div>

I get the general idea behind @code\_warntype but LLVM is new to me. Right now, I might try @code\_warntype on a one-liner, but with larger functions … I get lost. I use the Julia REPL, and I figure that I just look for th…

---

## [Web plotting when datapoints \>\> plot pixels](https://discourse.julialang.org/t/web-plotting-when-datapoints-plot-pixels/98915)

<div class="topic-metadata">

**Author:** [@pepijndevos](https://discourse.julialang.org/u/pepijndevos)\
**Replies:** 4\
**Last updated:** [May 16, 2023, 11:21am UTC](https://discourse.julialang.org/t/web-plotting-when-datapoints-plot-pixels/98915 "2023-05-16T11:21:33Z")

</div>

Makie is pretty great for plotting big datasets, in particular the datashader functionality datashader · Makie But in the case of WGLMakie, you would first have to send the dataset to the client, which could be gigabyte…

---

## [Spawning threads boxes variable - spooky action at a distance?](https://discourse.julialang.org/t/spawning-threads-boxes-variable-spooky-action-at-a-distance/97972)

<div class="topic-metadata">

**Author:** [@anicusan](https://discourse.julialang.org/u/anicusan)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 11:12am UTC](https://discourse.julialang.org/t/spawning-threads-boxes-variable-spooky-action-at-a-distance/97972 "2023-05-16T11:12:54Z")

</div>

Hi, While multi-threading some code, I came across an odd case where spawning tasks leads to Julia boxing a variable in a different code section (leading to type instabilities, Any, bad performance, the whole shebang). …

[Previous page](https://discourse.julialang.org/latest.md?page=696)

[Next page](https://discourse.julialang.org/latest.md?page=698)
