# Latest

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

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

**Page:** 181

---

## [PWM using Discrete Callbacks in Modeling Toolkit](https://discourse.julialang.org/t/pwm-using-discrete-callbacks-in-modeling-toolkit/127569)

<div class="topic-metadata">

**Author:** [@twarczi](https://discourse.julialang.org/u/twarczi)\
**Replies:** 5\
**Last updated:** [April 20, 2025, 9:46am UTC](https://discourse.julialang.org/t/pwm-using-discrete-callbacks-in-modeling-toolkit/127569 "2025-04-20T09:46:23Z")

</div>

I’m trying to create a PWM voltage source using modeling toolkit. I tried used the @discrete\_events macro within the @mtkmodel block but doing so throws an error: ERROR: KeyError: key pwm₊output₊u(t) not found when runni…

---

## [Key error while using QLearningSolver](https://discourse.julialang.org/t/key-error-while-using-qlearningsolver/128243)

<div class="topic-metadata">

**Author:** [@Lorenzo\_Ferraiuolo](https://discourse.julialang.org/u/Lorenzo_Ferraiuolo)\
**Replies:** 1\
**Last updated:** [April 20, 2025, 9:34am UTC](https://discourse.julialang.org/t/key-error-while-using-qlearningsolver/128243 "2025-04-20T09:34:33Z")

</div>

I’m a beginner with julia and I’m trying to model an inventory menagement using sarsa and q-learning algo. The code gives me the following key error: “ERROR: LoadError: KeyError: key \[0.01781510003808362, 0.1043507798560…

---

## [Implementation of custom block in Modeling Toolkit](https://discourse.julialang.org/t/implementation-of-custom-block-in-modeling-toolkit/128212)

<div class="topic-metadata">

**Author:** [@JaviJR](https://discourse.julialang.org/u/JaviJR)\
**Replies:** 2\
**Last updated:** [April 20, 2025, 9:22am UTC](https://discourse.julialang.org/t/implementation-of-custom-block-in-modeling-toolkit/128212 "2025-04-20T09:22:23Z")

</div>

Hello everyone, As an exercise to learn how to use Modeling Toolkit, I set out to ‘translate’ some of the models I had implemented in Simulink. So far, I’ve managed to implement everything perfectly, but there’s one fun…

---

## [Early bird rates end May 15 for JuliaCon Global 2025](https://discourse.julialang.org/t/early-bird-rates-end-may-15-for-juliacon-global-2025/128240)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 1\
**Last updated:** [April 20, 2025, 8:25am UTC](https://discourse.julialang.org/t/early-bird-rates-end-may-15-for-juliacon-global-2025/128240 "2025-04-20T08:25:30Z")

</div>

JuliaCon Global 2025 tickets are currently on sale at early-bird prices. These early-bird prices will end on May 15th. Please contact us regarding any questions or concerns at juliacon@julialang.org. Sincerely, Mark…

---

## [Why functions in SpecialFunctions package work on CUDA arrays?](https://discourse.julialang.org/t/why-functions-in-specialfunctions-package-work-on-cuda-arrays/128194)

<div class="topic-metadata">

**Author:** [@singularity](https://discourse.julialang.org/u/singularity)\
**Replies:** 7\
**Last updated:** [April 20, 2025, 7:04am UTC](https://discourse.julialang.org/t/why-functions-in-specialfunctions-package-work-on-cuda-arrays/128194 "2025-04-20T07:04:45Z")

</div>

HI. I am confused how the behavior of functions inside the SpecialFunctions package on CUDA arrays. I am confused why the code below works and doesn’t throw an error at the last line. using CUDA using SpecialFunctions…

---

## [How to avoid memory allocation while doing sum on a GPU?](https://discourse.julialang.org/t/how-to-avoid-memory-allocation-while-doing-sum-on-a-gpu/128225)

<div class="topic-metadata">

**Author:** [@Shashank](https://discourse.julialang.org/u/Shashank)\
**Replies:** 7\
**Last updated:** [April 20, 2025, 7:00am UTC](https://discourse.julialang.org/t/how-to-avoid-memory-allocation-while-doing-sum-on-a-gpu/128225 "2025-04-20T07:00:48Z")

</div>

I have been having a problem with memory allocation when using sum on a CUDA array. Is there a way to avoid it? I have pasted the relevant parts of the code below: println("3:", CUDA.memory\_status()) Cgain1\_reshaped\_for…

---

## [Eachline function and more than one line](https://discourse.julialang.org/t/eachline-function-and-more-than-one-line/128205)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 4\
**Last updated:** [April 20, 2025, 6:24am UTC](https://discourse.julialang.org/t/eachline-function-and-more-than-one-line/128205 "2025-04-20T06:24:23Z")

</div>

Hello, Can I use the eachline function to read multiple lines? Thank you.

---

## [\[ANN\]: AskAI - Your Direct AI Support in REPL :)](https://discourse.julialang.org/t/ann-askai-your-direct-ai-support-in-repl/128042)

<div class="topic-metadata">

**Author:** [@Noah.Ark](https://discourse.julialang.org/u/Noah.Ark)\
**Replies:** 16\
**Last updated:** [April 20, 2025, 3:54am UTC](https://discourse.julialang.org/t/ann-askai-your-direct-ai-support-in-repl/128042 "2025-04-20T03:54:58Z")

</div>

AskAI in REPL Hi everyone! I am happy to finally share my first julia package, AskAI! As the name suggests, it is a straightforward tool for AI queries in REPL. Currently, it utilizes Google’s Gemini model due to its f…

---

## [Implementing Three-Dimensional Interpolation, ODEProblem, and Gradient Computation with sensealg=GaussAdjoint(autojacvec=EnzymeVJP())](https://discourse.julialang.org/t/implementing-three-dimensional-interpolation-odeproblem-and-gradient-computation-with-sensealg-gaussadjoint-autojacvec-enzymevjp/128204)

<div class="topic-metadata">

**Author:** [@chooron](https://discourse.julialang.org/u/chooron)\
**Replies:** 2\
**Last updated:** [April 20, 2025, 3:23am UTC](https://discourse.julialang.org/t/implementing-three-dimensional-interpolation-odeproblem-and-gradient-computation-with-sensealg-gaussadjoint-autojacvec-enzymevjp/128204 "2025-04-20T03:23:11Z")

</div>

Hello, the problem I am currently facing is solving an ordinary differential equation (ODE) with interpolated data inputs. The problem can be visualized as a snow layer, where the snow layer represents the intermediate s…

---

## [What to remove when packages incompatible](https://discourse.julialang.org/t/what-to-remove-when-packages-incompatible/128233)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [April 20, 2025, 1:53am UTC](https://discourse.julialang.org/t/what-to-remove-when-packages-incompatible/128233 "2025-04-20T01:53:57Z")

</div>

I have a large environment with many packages. Is there an algorithm or heuristic that can suggest what to remove when I want to add a new thing? The log is too long to fit in a Discourse post so I’ve truncated it. pkg\>…

---

## [Mutually recursive types, recommended style?](https://discourse.julialang.org/t/mutually-recursive-types-recommended-style/128228)

<div class="topic-metadata">

**Author:** [@DrEntropy](https://discourse.julialang.org/u/DrEntropy)\
**Replies:** 2\
**Last updated:** [April 20, 2025, 12:41am UTC](https://discourse.julialang.org/t/mutually-recursive-types-recommended-style/128228 "2025-04-20T00:41:39Z")

</div>

When faced with a situation where you may need mutually recursive types like this: mutable struct MyAgent \<: AbstractAgent id::Int friendB :: AbstractAgent # will always be AgentB type though #other fields …

---

## [Distributing Julia Sysimage in Python Package Managers](https://discourse.julialang.org/t/distributing-julia-sysimage-in-python-package-managers/128230)

<div class="topic-metadata">

**Author:** [@willow](https://discourse.julialang.org/u/willow)\
**Replies:** 0\
**Last updated:** [April 19, 2025, 10:31pm UTC](https://discourse.julialang.org/t/distributing-julia-sysimage-in-python-package-managers/128230 "2025-04-19T22:31:40Z")

</div>

Does anyone know of any examples of anyone distributing a PackageCompiler.jl image to be used by python projects? I’ve seen quite a lot of discussion across PythonCall.jl and elsewhere, and I’m hoping to figure out if an…

---

## [Save a simplified ModelingToolkit problem as text](https://discourse.julialang.org/t/save-a-simplified-modelingtoolkit-problem-as-text/128124)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 6\
**Last updated:** [April 19, 2025, 7:56pm UTC](https://discourse.julialang.org/t/save-a-simplified-modelingtoolkit-problem-as-text/128124 "2025-04-19T19:56:03Z")

</div>

Because structural\_simplify is slow, I want to write the simplified system to a file, from where I can load it later. Using serialize("sys.bin", sys) works, but this causes problems when switching between julia versions,…

---

## [Prune "compiled" folder](https://discourse.julialang.org/t/prune-compiled-folder/109567)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 25\
**Last updated:** [April 19, 2025, 7:12pm UTC](https://discourse.julialang.org/t/prune-compiled-folder/109567 "2025-04-19T19:12:07Z")

</div>

Is there a way to prune the .julia/compiled folder? It is getting quite big.

---

## [Possible to design a compiler for Raspberry Pi GPU?](https://discourse.julialang.org/t/possible-to-design-a-compiler-for-raspberry-pi-gpu/128224)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 0\
**Last updated:** [April 19, 2025, 2:55pm UTC](https://discourse.julialang.org/t/possible-to-design-a-compiler-for-raspberry-pi-gpu/128224 "2025-04-19T14:55:58Z")

</div>

I came across this blog post, of bare metal GPU assembly on Raspberry Pi. Programming a GPU on bare metal I am curious if it is possible to make a compiler that could transform generic Julia code (or SIMD optimized Jul…

---

## [Computation Expansions to Float64 invalid with certain GPUs](https://discourse.julialang.org/t/computation-expansions-to-float64-invalid-with-certain-gpus/128223)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 0\
**Last updated:** [April 19, 2025, 2:40pm UTC](https://discourse.julialang.org/t/computation-expansions-to-float64-invalid-with-certain-gpus/128223 "2025-04-19T14:40:13Z")

</div>

I encountered an issue trying to use OpenCL on my Laptop with intel iGPU, using Float16 computations. The GPU does not support Float64. The typical error message for this would be :: Reason :: unsupported use of double …

---

## [How to inspect fused loop?](https://discourse.julialang.org/t/how-to-inspect-fused-loop/128220)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 1\
**Last updated:** [April 19, 2025, 1:54pm UTC](https://discourse.julialang.org/t/how-to-inspect-fused-loop/128220 "2025-04-19T13:54:32Z")

</div>

given x = randn(5) y = randn(5) i = \[1, 3\] is there any speed difference between y\[i\] .= x\[i\] .+ 1.0 and y\[i\] .= view(x, i) .+ 1.0 ? to be more specific, would x\[i\] in the RHS of a fused loop create a copy of vect…

---

## [GC error (probable corruption) in 1.11](https://discourse.julialang.org/t/gc-error-probable-corruption-in-1-11/128219)

<div class="topic-metadata">

**Author:** [@fastwave](https://discourse.julialang.org/u/fastwave)\
**Replies:** 0\
**Last updated:** [April 19, 2025, 1:01pm UTC](https://discourse.julialang.org/t/gc-error-probable-corruption-in-1-11/128219 "2025-04-19T13:01:27Z")

</div>

I could not find much about GC corruptions in recent posts. If someone can shed a light on it that would be helpful. I get these crashes randomly sometimes after just a few minutes, other times after couple of days of co…

---

## [Makie.jl Extensions frequently recompiled](https://discourse.julialang.org/t/makie-jl-extensions-frequently-recompiled/128203)

<div class="topic-metadata">

**Author:** [@kongdd](https://discourse.julialang.org/u/kongdd)\
**Replies:** 2\
**Last updated:** [April 19, 2025, 12:38pm UTC](https://discourse.julialang.org/t/makie-jl-extensions-frequently-recompiled/128203 "2025-04-19T12:38:27Z")

</div>

ArchGDAL.jl has the extension ArchGDALMakieExt (ArchGDAL.jl/Project.toml at master · yeesian/ArchGDAL.jl · GitHub). My pkg Ipaper.jl has an extension relies on ArchGDAL.jl. Each time I update Ipaper.jl in the system env…

---

## [Best way to plot (discrete) 2d distribution](https://discourse.julialang.org/t/best-way-to-plot-discrete-2d-distribution/128213)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 1\
**Last updated:** [April 19, 2025, 10:57am UTC](https://discourse.julialang.org/t/best-way-to-plot-discrete-2d-distribution/128213 "2025-04-19T10:57:22Z")

</div>

I have a MxN matrix. What is the best way to plot it? I tried using histogram2d, but its example just uses two vectors, and with my matrix the result is weird. I also tried something like using Plots x=range(1,stop=50,l…

---

## [How do I open and edit my startup.jl file?](https://discourse.julialang.org/t/how-do-i-open-and-edit-my-startup-jl-file/93415)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 13\
**Last updated:** [April 19, 2025, 10:05am UTC](https://discourse.julialang.org/t/how-do-i-open-and-edit-my-startup-jl-file/93415 "2025-04-19T10:05:24Z")

</div>

Simple question: How do I open my startup.jl file? In MATLAB, it’s possible to type \>\> edit("startup.m") and if startup.m already exists, the file opens and becomes editable. If startup.m doesn’t exist, MATLAB asks if…

---

## [Julia : strange (Windows) cygwin/mintty hang](https://discourse.julialang.org/t/julia-strange-windows-cygwin-mintty-hang/128155)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 10\
**Last updated:** [April 19, 2025, 8:24am UTC](https://discourse.julialang.org/t/julia-strange-windows-cygwin-mintty-hang/128155 "2025-04-19T08:24:58Z")

</div>

Hello, Since yesterday I encounter a very strange hang-up of Julia interactive repl under Cygwin/mintty : no response to my typing until I hit Ctrl-C. Then it dump with following results (see later) where I see that wh…

---

## [Filtering syntactically positive non constant symbolic terms from a matrix in Symbolics.jl fails in 2×2 test case](https://discourse.julialang.org/t/filtering-syntactically-positive-non-constant-symbolic-terms-from-a-matrix-in-symbolics-jl-fails-in-2x2-test-case/128151)

<div class="topic-metadata">

**Author:** [@florinav](https://discourse.julialang.org/u/florinav)\
**Replies:** 4\
**Last updated:** [April 19, 2025, 7:52am UTC](https://discourse.julialang.org/t/filtering-syntactically-positive-non-constant-symbolic-terms-from-a-matrix-in-symbolics-jl-fails-in-2x2-test-case/128151 "2025-04-19T07:52:08Z")

</div>

Here is a minimal test in Julia using Symbolics.jl: using Symbolics using LinearAlgebra function NGM(M, var) M = simplify.(M) # normalize all expressions F = map(e -\> begin expr = string(e) dep…

---

## [Bug on JSON3 serialization?](https://discourse.julialang.org/t/bug-on-json3-serialization/128193)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 3\
**Last updated:** [April 18, 2025, 10:38pm UTC](https://discourse.julialang.org/t/bug-on-json3-serialization/128193 "2025-04-18T22:38:26Z")

</div>

Could someone clarify whether this is a bug or I’m doing something wrong? import JSON3 d = Dict{Tuple{Int,String},Float64}() d\[(10,"a")\] = 1. d\[(20,"b")\] = 2. JSON3.write("/tmp/temp.json", d) JSON3.read("/tmp/temp.json"…

---

## [A = A .+ 1 yields different type than A .+= 1; why?](https://discourse.julialang.org/t/a-a-1-yields-different-type-than-a-1-why/128189)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 12\
**Last updated:** [April 18, 2025, 7:17pm UTC](https://discourse.julialang.org/t/a-a-1-yields-different-type-than-a-1-why/128189 "2025-04-18T19:17:58Z")

</div>

In the code below, I had expected the three additions at the end to produce the same type. Plus, given that the constructor of Share should throw an error when its argument is outside the range 0 to 1, I would not have …

---

## [ImmutableDict documentation](https://discourse.julialang.org/t/immutabledict-documentation/128033)

<div class="topic-metadata">

**Author:** [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Replies:** 5\
**Last updated:** [April 18, 2025, 7:13pm UTC](https://discourse.julialang.org/t/immutabledict-documentation/128033 "2025-04-18T19:13:59Z")

</div>

After stumbling through using an ImmutableDict, I’d like to submit some documentation for the type. Is there a procedure for this?

---

## [Using Julia for "large" scale projects?](https://discourse.julialang.org/t/using-julia-for-large-scale-projects/128069)

<div class="topic-metadata">

**Author:** [@DK1PL](https://discourse.julialang.org/u/DK1PL)\
**Replies:** 4\
**Last updated:** [April 18, 2025, 4:21pm UTC](https://discourse.julialang.org/t/using-julia-for-large-scale-projects/128069 "2025-04-18T16:21:44Z")

</div>

Hello community, I have rarely written relatively small (up to 500 lines of code) Julia programs and the long compilation time has prevented me from writing large scale programs. I have now decided to try writing a long…

---

## [Looking for type-stable way to update several struct fields from NamedTuple](https://discourse.julialang.org/t/looking-for-type-stable-way-to-update-several-struct-fields-from-namedtuple/128182)

<div class="topic-metadata">

**Author:** [@Ickaser](https://discourse.julialang.org/u/Ickaser)\
**Replies:** 5\
**Last updated:** [April 18, 2025, 9:52am UTC](https://discourse.julialang.org/t/looking-for-type-stable-way-to-update-several-struct-fields-from-namedtuple/128182 "2025-04-18T09:52:02Z")

</div>

Hello, I’ve been poring over docs for Accessors.jl, Setfield.jl, Parameters.jl, and Discourse, and haven’t found a clear answer to this question. The problem I would like to solve is expressed by this MWE: struct Para…

---

## [\[ANN\] JuliaGrid.jl – A Framework for Steady-State Power System Analysis](https://discourse.julialang.org/t/ann-juliagrid-jl-a-framework-for-steady-state-power-system-analysis/128168)

<div class="topic-metadata">

**Author:** [@Mirsad\_Cosovic](https://discourse.julialang.org/u/Mirsad_Cosovic)\
**Replies:** 6\
**Last updated:** [April 18, 2025, 8:03am UTC](https://discourse.julialang.org/t/ann-juliagrid-jl-a-framework-for-steady-state-power-system-analysis/128168 "2025-04-18T08:03:44Z")

</div>

After a long journey, I’m pleased to announce JuliaGrid.jl, a Julia package that focuses on steady-state power system analyses. The package offers a versatile set of algorithms along with tools for easily manipulating po…

---

## [BroadcastStyle of a SubArray](https://discourse.julialang.org/t/broadcaststyle-of-a-subarray/128181)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 0\
**Last updated:** [April 18, 2025, 7:50am UTC](https://discourse.julialang.org/t/broadcaststyle-of-a-subarray/128181 "2025-04-18T07:50:46Z")

</div>

The broadcast style of SubArrray (i.e. as obtained using view) is a DefaultArrayStyle: julia\> Base.BroadcastStyle(typeof(view(rand(10,10),2:3,3:4))) Base.Broadcast.DefaultArrayStyle{2}() yet it would be extremely usefu…

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

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