# Latest

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

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

**Page:** 312

---

## [Agents.jl -- layered spaces?](https://discourse.julialang.org/t/agents-jl-layered-spaces/119933)

<div class="topic-metadata">

**Author:** [@pogikano](https://discourse.julialang.org/u/pogikano)\
**Replies:** 0\
**Last updated:** [September 27, 2024, 2:14am UTC](https://discourse.julialang.org/t/agents-jl-layered-spaces/119933 "2024-09-27T02:14:18Z")

</div>

Is it possible to layer various spaces in Agents.jl as can be done in Mason? For example, it is best to simulate herbivorous fish in continuous space, but they could be grazing on algae in a grid, which is the easiest wa…

---

## [Catch ctrl-c in script](https://discourse.julialang.org/t/catch-ctrl-c-in-script/119885)

<div class="topic-metadata">

**Author:** [@matthew3245](https://discourse.julialang.org/u/matthew3245)\
**Replies:** 2\
**Last updated:** [September 27, 2024, 1:11am UTC](https://discourse.julialang.org/t/catch-ctrl-c-in-script/119885 "2024-09-27T01:11:35Z")

</div>

From the Julia docs: Running a Julia script using julia file.jl does not throw InterruptException when you try to terminate it with CTRL-C (SIGINT). To run a certain code before terminating a Julia script, which may or…

---

## [Building a custom "variable in set" constraint](https://discourse.julialang.org/t/building-a-custom-variable-in-set-constraint/119927)

<div class="topic-metadata">

**Author:** [@janneshb](https://discourse.julialang.org/u/janneshb)\
**Replies:** 9\
**Last updated:** [September 26, 2024, 11:02pm UTC](https://discourse.julialang.org/t/building-a-custom-variable-in-set-constraint/119927 "2024-09-26T23:02:14Z")

</div>

Hi, I implemented my own type of sets (let’s call it MySetType) and now I want to override Julia’s in functionality, similar to what is already supported for SecondOrderCones. So, I would like to make this work with Ju…

---

## [Exportall?](https://discourse.julialang.org/t/exportall/4970)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 21\
**Last updated:** [September 26, 2024, 9:52pm UTC](https://discourse.julialang.org/t/exportall/4970 "2024-09-26T21:52:57Z")

</div>

Is there a way to export ALL the symbols declared in a module? Just to avoid writing them all under export.

---

## [Why mutable structs are allocated on the heap?](https://discourse.julialang.org/t/why-mutable-structs-are-allocated-on-the-heap/12992)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 36\
**Last updated:** [September 26, 2024, 8:48pm UTC](https://discourse.julialang.org/t/why-mutable-structs-are-allocated-on-the-heap/12992 "2024-09-26T20:48:47Z")

</div>

From https://docs.julialang.org/en/latest/manual/types/#Mutable-Composite-Types-1: In order to support mutation, such objects are generally allocated on the heap, and have stable memory addresses. If I define: mutab…

---

## [Solving nonlinear equations using inexact Newton — seeking recommendations](https://discourse.julialang.org/t/solving-nonlinear-equations-using-inexact-newton-seeking-recommendations/119887)

<div class="topic-metadata">

**Author:** [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Replies:** 5\
**Last updated:** [September 26, 2024, 7:37pm UTC](https://discourse.julialang.org/t/solving-nonlinear-equations-using-inexact-newton-seeking-recommendations/119887 "2024-09-26T19:37:51Z")

</div>

I’m seeking recommendations for a package for solving a large system of nonlinear equations, allowing for inexact Newton system solves using iterative linear solvers. My Jacobian is symmetric indefinite, and so I hope to…

---

## [Turing models, vectors, and type stability?](https://discourse.julialang.org/t/turing-models-vectors-and-type-stability/119928)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 7:04pm UTC](https://discourse.julialang.org/t/turing-models-vectors-and-type-stability/119928 "2024-09-26T19:04:06Z")

</div>

Hi, I’m puzzled by a type instability issue in the Turing model below. When the model defines the vector p2 before iterating, the model is type stable. When using the \[...\] notation, the model is unstable. using Linear…

---

## [Unclear allocations with in-place mutating functions](https://discourse.julialang.org/t/unclear-allocations-with-in-place-mutating-functions/119896)

<div class="topic-metadata">

**Author:** [@fmor](https://discourse.julialang.org/u/fmor)\
**Replies:** 14\
**Last updated:** [September 26, 2024, 6:50pm UTC](https://discourse.julialang.org/t/unclear-allocations-with-in-place-mutating-functions/119896 "2024-09-26T18:50:48Z")

</div>

I am fitting a statistical model and I refactored the code to reduce the allocations it generated. I morally halved them, with respect to the first version, but there are still some unclear sections which I see from runn…

---

## [How to approach my unconstrained optimization problem?](https://discourse.julialang.org/t/how-to-approach-my-unconstrained-optimization-problem/119919)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 4\
**Last updated:** [September 26, 2024, 6:36pm UTC](https://discourse.julialang.org/t/how-to-approach-my-unconstrained-optimization-problem/119919 "2024-09-26T18:36:32Z")

</div>

I’ve got an objective function to maximize. The domain is {\\mathbb{R}}^n, where n is about thirty. The codomain is a bounded subset of the nonnegative reals. The objective value is zero for most of the domain. The object…

---

## [Design Pattern "Start from the end"?](https://discourse.julialang.org/t/design-pattern-start-from-the-end/119924)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 5:01pm UTC](https://discourse.julialang.org/t/design-pattern-start-from-the-end/119924 "2024-09-26T17:01:14Z")

</div>

I’m trying to figure out if there is a name for a design pattern I keep coming back to. Intuitively, when designing a pipeline of tasks, I start with “Given an input, first do this, then that, and then output the result…

---

## [\[Workgroup\] JuliaHealth Meeting -- September 26th, 2024](https://discourse.julialang.org/t/workgroup-juliahealth-meeting-september-26th-2024/119890)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 4:03pm UTC](https://discourse.julialang.org/t/workgroup-juliahealth-meeting-september-26th-2024/119890 "2024-09-26T16:03:58Z")

</div>

Hi everyone! :wave: I am VERY late with a meeting annoucement (got a bit sick this month :face\_with\_thermometer:) but here we are with another meeting – TOMORROW! We have an exciting line-up of events planned. Here’s wh…

---

## [Macro usage: create dispatch for vector length](https://discourse.julialang.org/t/macro-usage-create-dispatch-for-vector-length/118142)

<div class="topic-metadata">

**Author:** [@heronrick](https://discourse.julialang.org/u/heronrick)\
**Replies:** 8\
**Last updated:** [September 26, 2024, 3:44pm UTC](https://discourse.julialang.org/t/macro-usage-create-dispatch-for-vector-length/118142 "2024-09-26T15:44:56Z")

</div>

Hello, I have an Idea I would like to implement for a module I am working on. I will try to explain, but I am not sure if such implementation would make much sense, probably there are better solutions. I have a macro, …

---

## [Structs calling each other](https://discourse.julialang.org/t/structs-calling-each-other/119921)

<div class="topic-metadata">

**Author:** [@Nichola](https://discourse.julialang.org/u/Nichola)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 3:29pm UTC](https://discourse.julialang.org/t/structs-calling-each-other/119921 "2024-09-26T15:29:00Z")

</div>

I would like to define two structs AB and BA and be able to convert from one representation to the other doing AB(ba) or BA(ab) where ab and ba are instances of AB and BA respectively. for example : mutable struct AB …

---

## [Non-intuitive difference of copyto! between CuArray and Array](https://discourse.julialang.org/t/non-intuitive-difference-of-copyto-between-cuarray-and-array/119904)

<div class="topic-metadata">

**Author:** [@0samuraiE](https://discourse.julialang.org/u/0samuraiE)\
**Replies:** 3\
**Last updated:** [September 26, 2024, 2:43pm UTC](https://discourse.julialang.org/t/non-intuitive-difference-of-copyto-between-cuarray-and-array/119904 "2024-09-26T14:43:01Z")

</div>

Hi all. I trapped an error when using copyto! to CuArray. Error is ERROR: CUDA error: invalid argument (code 1, ERROR\_INVALID\_VALUE) Stacktrace: \[1\] throw\_api\_error(res::CUDA.cudaError\_enum) @ CUDA ~/.julia/packa…

---

## [Confusion with variable indices with JuMP/CPLEX](https://discourse.julialang.org/t/confusion-with-variable-indices-with-jump-cplex/119920)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 2:35pm UTC](https://discourse.julialang.org/t/confusion-with-variable-indices-with-jump-cplex/119920 "2024-09-26T14:35:15Z")

</div>

I try to set branching priorities on variables using CPXcopyorder(env, lp, cnt, indices, priority, direction). Particlularly I want to get the indices of the varialbes of the JuMP model in the CPLEX model. I tried: inde…

---

## [Most elegant way to create a vector of results if the result is an unknown type?](https://discourse.julialang.org/t/most-elegant-way-to-create-a-vector-of-results-if-the-result-is-an-unknown-type/119906)

<div class="topic-metadata">

**Author:** [@Maurizio\_Tomasi](https://discourse.julialang.org/u/Maurizio_Tomasi)\
**Replies:** 7\
**Last updated:** [September 26, 2024, 1:56pm UTC](https://discourse.julialang.org/t/most-elegant-way-to-create-a-vector-of-results-if-the-result-is-an-unknown-type/119906 "2024-09-26T13:56:55Z")

</div>

Hi all, I am developing some simulation code that can be used either to do a quick calculation or a more complete and slower algorithm. I implemented two functions that either produce a “simple” or “complex” structure; f…

---

## [Logo for the JuliaDiff organization?](https://discourse.julialang.org/t/logo-for-the-juliadiff-organization/113539)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 54\
**Last updated:** [September 26, 2024, 1:38pm UTC](https://discourse.julialang.org/t/logo-for-the-juliadiff-organization/113539 "2024-09-26T13:38:55Z")

</div>

Since JuliaCon and its avalanche of stickers are upon us, I thought it would be nice to give JuliaDiff a logo. We have one on GitHub but it’s old and not really differentiation-specific. I gave it a try with Luxor.jl, bu…

---

## [FunctionWrapper allocating when called](https://discourse.julialang.org/t/functionwrapper-allocating-when-called/119854)

<div class="topic-metadata">

**Author:** [@Goncalo\_Pena](https://discourse.julialang.org/u/Goncalo_Pena)\
**Replies:** 10\
**Last updated:** [September 26, 2024, 12:52pm UTC](https://discourse.julialang.org/t/functionwrapper-allocating-when-called/119854 "2024-09-26T12:52:50Z")

</div>

I made the following test code to check some allocations going around while using FunctionWrappers on a piece of code I have. using FunctionWrappers import FunctionWrappers: FunctionWrapper using BenchmarkTools T = Flo…

---

## [\[ANN\] GeoArtifacts.jl - Artifacts for Geospatial Data Science in Julia](https://discourse.julialang.org/t/ann-geoartifacts-jl-artifacts-for-geospatial-data-science-in-julia/114508)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 12:36pm UTC](https://discourse.julialang.org/t/ann-geoartifacts-jl-artifacts-for-geospatial-data-science-in-julia/114508 "2024-09-26T12:36:43Z")

</div>

GeoArtifacts.jl The package provides various artifacts (e.g., datasets) for geospatial data science, from various sources (e.g., GADM, INMET, NaturalEarth). The result is always a GeoTable as discussed in the GDSJL book. …

---

## [Differentiable Regularizers for CUDA, CPUs?](https://discourse.julialang.org/t/differentiable-regularizers-for-cuda-cpus/119915)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 12:12pm UTC](https://discourse.julialang.org/t/differentiable-regularizers-for-cuda-cpus/119915 "2024-09-26T12:12:55Z")

</div>

Hi, is anyone aware of a package which implements Total Variation (TV) or other kinds of regularizer efficiently and differentiable? A naive, differentiable way of TV would be: julia\> arr = rand(10, 10) 10×10 Matrix{F…

---

## [Parameters in the neural network not updating after training](https://discourse.julialang.org/t/parameters-in-the-neural-network-not-updating-after-training/119914)

<div class="topic-metadata">

**Author:** [@Ashima\_Kalathingal](https://discourse.julialang.org/u/Ashima_Kalathingal)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 12:04pm UTC](https://discourse.julialang.org/t/parameters-in-the-neural-network-not-updating-after-training/119914 "2024-09-26T12:04:53Z")

</div>

I am implementing a Neural ODE in julia. When I complete the training using ADAM optimizer, the loss function decreases as expected. But after training, the parameters reset to the original initial value. So I am not abl…

---

## [How to write a new gradient descent algorithm and benchmark against existing methods](https://discourse.julialang.org/t/how-to-write-a-new-gradient-descent-algorithm-and-benchmark-against-existing-methods/119869)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 4\
**Last updated:** [September 26, 2024, 11:06am UTC](https://discourse.julialang.org/t/how-to-write-a-new-gradient-descent-algorithm-and-benchmark-against-existing-methods/119869 "2024-09-26T11:06:07Z")

</div>

I have an idea for a new gradient descent algorithm. I just want to see if it does better or worse than a standard momentum methods. How would I go about making use of the existing benchmarking suites CUTEst.jl or Optim…

---

## [How to use ccall, cconvert, and unsafe\_convert in a convenient and memory-safe way?](https://discourse.julialang.org/t/how-to-use-ccall-cconvert-and-unsafe-convert-in-a-convenient-and-memory-safe-way/41932)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 18\
**Last updated:** [June 24, 2020, 11:50am UTC](https://discourse.julialang.org/t/how-to-use-ccall-cconvert-and-unsafe-convert-in-a-convenient-and-memory-safe-way/41932 "2020-06-24T11:50:08Z")

</div>

I am writing Julia code to conveniently interface a C library, which in turn is just an interface to a C++ library. Therefore, many times I have to store pointers to void as the C interface does not know anything about t…

---

## [Indexing symbolic array slice does not work as expected / stays unsimplified](https://discourse.julialang.org/t/indexing-symbolic-array-slice-does-not-work-as-expected-stays-unsimplified/119907)

<div class="topic-metadata">

**Author:** [@r0uv3n](https://discourse.julialang.org/u/r0uv3n)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 10:12am UTC](https://discourse.julialang.org/t/indexing-symbolic-array-slice-does-not-work-as-expected-stays-unsimplified/119907 "2024-09-26T10:12:29Z")

</div>

The code julia\> using Symbolics julia\> @variables x\[1:5\] julia\> x\[2:4\]\[1\] (x\[2:4\])\[1\] seems like it should return x\[2\] instead. Am I missing something here? My use case here is that I want to do something like julia\> …

---

## [CECAM-Lorentz Workshop: Sustainable computing](https://discourse.julialang.org/t/cecam-lorentz-workshop-sustainable-computing/119902)

<div class="topic-metadata">

**Author:** [@Diego\_Javier\_Zea](https://discourse.julialang.org/u/Diego_Javier_Zea)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 9:04am UTC](https://discourse.julialang.org/t/cecam-lorentz-workshop-sustainable-computing/119902 "2024-09-26T09:04:07Z")

</div>

Hi! I am sharing this announcement with the community, given the benefits of using Julia for sustainable ML, AI, and simulations. It would be great if someone from the community could showcase such benefits at that Works…

---

## [Bonito slider emit event if mousedrag stops](https://discourse.julialang.org/t/bonito-slider-emit-event-if-mousedrag-stops/119897)

<div class="topic-metadata">

**Author:** [@baxmittens](https://discourse.julialang.org/u/baxmittens)\
**Replies:** 0\
**Last updated:** [September 26, 2024, 8:09am UTC](https://discourse.julialang.org/t/bonito-slider-emit-event-if-mousedrag-stops/119897 "2024-09-26T08:09:32Z")

</div>

Hi there, I want something like this: using Bonito using WGLMakie import Bonito.TailwindDashboard as D app = App() do session::Session sliders = \[Bonito.Slider(-1:.1:1, value=0.0) for i = 1:6\] vals = map!(Observable…

---

## [Options for simple board game GUI](https://discourse.julialang.org/t/options-for-simple-board-game-gui/119851)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [September 26, 2024, 7:04am UTC](https://discourse.julialang.org/t/options-for-simple-board-game-gui/119851 "2024-09-26T07:04:50Z")

</div>

I’d like to explore ReinforcementLearning.jl and AlphaZero.jl for playing board games with AI, and I’d like to visualize the games and allow a human player to place pieces on the board. Therefore, I’d like to make an ext…

---

## [Error: IOError: symlink: operation not permitted (EPERM)](https://discourse.julialang.org/t/error-ioerror-symlink-operation-not-permitted-eperm/119872)

<div class="topic-metadata">

**Author:** [@Jesper\_Keijser](https://discourse.julialang.org/u/Jesper_Keijser)\
**Replies:** 4\
**Last updated:** [September 26, 2024, 6:58am UTC](https://discourse.julialang.org/t/error-ioerror-symlink-operation-not-permitted-eperm/119872 "2024-09-26T06:58:23Z")

</div>

Hello, Pretty new to julia, have used it ever so often for school work the last few years, but not very familiar at all. When running the code below I get the error posted below. It is mainly the error stated in the tit…

---

## [How to add a manually created legend inside the axis?](https://discourse.julialang.org/t/how-to-add-a-manually-created-legend-inside-the-axis/119893)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 5\
**Last updated:** [September 26, 2024, 5:56am UTC](https://discourse.julialang.org/t/how-to-add-a-manually-created-legend-inside-the-axis/119893 "2024-09-26T05:56:27Z")

</div>

using CairoMakie f = Figure() Axis(f\[1, 1\]) elem\_1 = \[LineElement(color = :red, linestyle = nothing), MarkerElement(color = :blue, marker = 'x', markersize = 15, strokecolor = :black)\] elem\_2 = \[P…

---

## [How to interactively change attributes of plots in GLMakie?](https://discourse.julialang.org/t/how-to-interactively-change-attributes-of-plots-in-glmakie/119876)

<div class="topic-metadata">

**Author:** [@heinfleuren](https://discourse.julialang.org/u/heinfleuren)\
**Replies:** 6\
**Last updated:** [September 26, 2024, 5:53am UTC](https://discourse.julialang.org/t/how-to-interactively-change-attributes-of-plots-in-glmakie/119876 "2024-09-26T05:53:20Z")

</div>

I’m relatively new to Julia and I’m trying to design a logistics application with GLMakie. Depending on some interactions I want to change the colors and markers on a map. I used Observables but it doesn’t work… What am …

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

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