# Latest

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

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

**Page:** 705

---

## [Change in behaviour of ForwardDiff in Julia 1.9](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 3:05pm UTC](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616 "2023-05-10T15:05:43Z")

</div>

Does anyone know why there would be a change in the output type of the following code between Julia versions 1.8 and 1.9?: using ForwardDiff, StaticArrays ForwardDiff.jacobian(z -\> SVector{2}(z\[1\], z\[2\]), zeros(SVector{…

---

## [Is Julia reliable for solving ordinary and stochastic differential equations?](https://discourse.julialang.org/t/is-julia-reliable-for-solving-ordinary-and-stochastic-differential-equations/98374)

<div class="topic-metadata">

**Author:** [@soldin](https://discourse.julialang.org/u/soldin)\
**Replies:** 12\
**Last updated:** [May 10, 2023, 2:22pm UTC](https://discourse.julialang.org/t/is-julia-reliable-for-solving-ordinary-and-stochastic-differential-equations/98374 "2023-05-10T14:22:43Z")

</div>

I got a bit worried about using Julia after reading Yuri Vishnevsky’s article (“Why I no longer recommend Julia”). I want to use this language for solving ordinary and stochastic differential equations. Besides this, I a…

---

## [Calling my own Julia functions from C](https://discourse.julialang.org/t/calling-my-own-julia-functions-from-c/98617)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 0\
**Last updated:** [May 10, 2023, 2:12pm UTC](https://discourse.julialang.org/t/calling-my-own-julia-functions-from-c/98617 "2023-05-10T14:12:46Z")

</div>

Hi everyone, I have been trying to call a user defined function in Julia in a very simple C code and I am not able too. The code builds up from the most simple Julia function call to what I actually want which is callin…

---

## [Declare a structure as a subtype of another structure](https://discourse.julialang.org/t/declare-a-structure-as-a-subtype-of-another-structure/98611)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 4\
**Last updated:** [May 10, 2023, 1:49pm UTC](https://discourse.julialang.org/t/declare-a-structure-as-a-subtype-of-another-structure/98611 "2023-05-10T13:49:52Z")

</div>

Curiously didn’t find anything on this, even after some decent amount of googling… I have a structure, and then I have a version of it with some additional info. Can I make the latter inherit from the former? Naively, I…

---

## [EPFL (Lausanne, Switzerland) - Introduction to Julia Lang - 10th of May](https://discourse.julialang.org/t/epfl-lausanne-switzerland-introduction-to-julia-lang-10th-of-may/98152)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 1\
**Last updated:** [May 10, 2023, 1:17pm UTC](https://discourse.julialang.org/t/epfl-lausanne-switzerland-introduction-to-julia-lang-10th-of-may/98152 "2023-05-10T13:17:53Z")

</div>

Hi! Together with @gdalle, @mfh, @JakeGrainger and LauzHack we organize a first introduction to Julia Lang at EPFL on Wednesday 10th of May at 18h15! There will be Pizza at the end of the event! Don’t hesitate to comm…

---

## [Neural network training for DSGE model](https://discourse.julialang.org/t/neural-network-training-for-dsge-model/98567)

<div class="topic-metadata">

**Author:** [@Vahagn](https://discourse.julialang.org/u/Vahagn)\
**Replies:** 0\
**Last updated:** [May 9, 2023, 5:55pm UTC](https://discourse.julialang.org/t/neural-network-training-for-dsge-model/98567 "2023-05-09T17:55:11Z")

</div>

Hi, I have a DSGE model for which I need to approximate decision functions using neural network. I have already written many parts of my code. But I don’t know how to train it. I have written some training loop in the b…

---

## [How to interpret results from \`Profile.take\_heap\_snapshot\`?](https://discourse.julialang.org/t/how-to-interpret-results-from-profile-take-heap-snapshot/98610)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 0\
**Last updated:** [May 10, 2023, 12:28pm UTC](https://discourse.julialang.org/t/how-to-interpret-results-from-profile-take-heap-snapshot/98610 "2023-05-10T12:28:55Z")

</div>

I tried to use the new Profile.take\_heap\_snapshot function, by following the steps provided in the blog post (on of my Pluto notebooks takes a lot of memory, and I’d like to understand where this comes from) However, I …

---

## [Discrete systems in MTK](https://discourse.julialang.org/t/discrete-systems-in-mtk/98602)

<div class="topic-metadata">

**Author:** [@HamzaKh99](https://discourse.julialang.org/u/HamzaKh99)\
**Replies:** 1\
**Last updated:** [May 10, 2023, 12:00pm UTC](https://discourse.julialang.org/t/discrete-systems-in-mtk/98602 "2023-05-10T12:00:08Z")

</div>

Hello everyone! I’m trying to do a discrete system example, using Difference and Differential functions, when I create the ODEProblem without structural\_simplify() I get the results I want. \`using ModelingToolkit usin…

---

## [Backwards compatability support of the new return codes to Symbols will be deprecated](https://discourse.julialang.org/t/backwards-compatability-support-of-the-new-return-codes-to-symbols-will-be-deprecated/91071)

<div class="topic-metadata">

**Author:** [@ktitimbo](https://discourse.julialang.org/u/ktitimbo)\
**Replies:** 7\
**Last updated:** [February 16, 2023, 8:22pm UTC](https://discourse.julialang.org/t/backwards-compatability-support-of-the-new-return-codes-to-symbols-will-be-deprecated/91071 "2023-02-16T20:22:18Z")

</div>

I’m very new to Julia so I might be misinterpreting what’s happening here. When solving a stiff differential equation I am constantly getting “Backwards compatability support of the new return codes to Symbols will be d…

---

## [How to optimize multiple ODEs at once?](https://discourse.julialang.org/t/how-to-optimize-multiple-odes-at-once/98194)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 8:39am UTC](https://discourse.julialang.org/t/how-to-optimize-multiple-odes-at-once/98194 "2023-05-10T08:39:05Z")

</div>

Hello, I have a set of several ODEs to describe the interaction between six bacteria and six phages (one for bacterium). Collectively, I have 18 equations with 7 parameters. What is the approach to finding the values o…

---

## [Randomly generating an array that satisfies a condition](https://discourse.julialang.org/t/randomly-generating-an-array-that-satisfies-a-condition/98579)

<div class="topic-metadata">

**Author:** [@Longblackcoffee](https://discourse.julialang.org/u/Longblackcoffee)\
**Replies:** 13\
**Last updated:** [May 10, 2023, 8:04am UTC](https://discourse.julialang.org/t/randomly-generating-an-array-that-satisfies-a-condition/98579 "2023-05-10T08:04:38Z")

</div>

Hi everyone, Say I have 3 numbers - x,y,z, that must sum to 1. Is there a way to generate a random combination of these 3 numbers that respects this condition? This problem is trivial if it’s 2-dimensional since you ca…

---

## [GPs: sum of independent Kernels](https://discourse.julialang.org/t/gps-sum-of-independent-kernels/98542)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 8:00am UTC](https://discourse.julialang.org/t/gps-sum-of-independent-kernels/98542 "2023-05-10T08:00:58Z")

</div>

The documentation of KernelFunctions.jl specifies many building blocks to define composite Kernels. But I can’t find a way to build a sum of independent Kernels, something similar to the KernelTensorProduct but with addi…

---

## [Julia v1.9.0 has been released](https://discourse.julialang.org/t/julia-v1-9-0-has-been-released/98595)

<div class="topic-metadata">

**Author:** [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Replies:** 0\
**Last updated:** [May 10, 2023, 7:27am UTC](https://discourse.julialang.org/t/julia-v1-9-0-has-been-released/98595 "2023-05-10T07:27:32Z")

</div>

The Julia developers are pleased to announce the release of Julia v1.9.0, the ninth minor release in the 1.x series. Some folks put together a blog post highlighting some of the most exciting new features in 1.9 and we …

---

## [Constructing String(x::Vector{UInt8}) empties the vector?](https://discourse.julialang.org/t/constructing-string-x-vector-uint8-empties-the-vector/58816)

<div class="topic-metadata">

**Author:** [@green.nsk](https://discourse.julialang.org/u/green.nsk)\
**Replies:** 7\
**Last updated:** [May 10, 2023, 7:11am UTC](https://discourse.julialang.org/t/constructing-string-x-vector-uint8-empties-the-vector/58816 "2023-05-10T07:11:25Z")

</div>

data = Vector{UInt8}("hello, world!") @assert(!isempty(data)) String(data) @assert(!isempty(data)) # boom! is this expected? I found this issue: https://github.com/JuliaLang/julia/issues/24388, which eventually was res…

---

## [Flux.jl versus Lux.jl](https://discourse.julialang.org/t/flux-jl-versus-lux-jl/98499)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 5\
**Last updated:** [May 10, 2023, 6:44am UTC](https://discourse.julialang.org/t/flux-jl-versus-lux-jl/98499 "2023-05-10T06:44:13Z")

</div>

The Scientific machine ecosystem in Julia now recommends Lux.jl as opposed to Flux.jl. What are the use cases in general where Flux.jl is better than Lux.jl? Looking at the questions on Discourse, I have the impression t…

---

## [Zygote Update with Parametric Type](https://discourse.julialang.org/t/zygote-update-with-parametric-type/98588)

<div class="topic-metadata">

**Author:** [@Ian\_L](https://discourse.julialang.org/u/Ian_L)\
**Replies:** 5\
**Last updated:** [May 10, 2023, 6:26am UTC](https://discourse.julialang.org/t/zygote-update-with-parametric-type/98588 "2023-05-10T06:26:22Z")

</div>

Hi. I’m trying to update my flux model which is parameterized by two types: abstract type C end struct A \<: C end struct B \<: C end struct Block{T\<:C} C\_inout::Int time::Vector{Float64} end Flux.@functor Block…

---

## [Callbacks - Accessing Gurobi specific functionality](https://discourse.julialang.org/t/callbacks-accessing-gurobi-specific-functionality/98560)

<div class="topic-metadata">

**Author:** [@Sokar](https://discourse.julialang.org/u/Sokar)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 5:20am UTC](https://discourse.julialang.org/t/callbacks-accessing-gurobi-specific-functionality/98560 "2023-05-10T05:20:21Z")

</div>

Hi everyone. Working on my master thesis project, I have run into some problems using JuMP and Gurobi. I need to use Gurobi specific callback functionality, but as far as I can tell, this requires me to construct my mod…

---

## [Loss/Accuracy computation in validation set in Flux](https://discourse.julialang.org/t/loss-accuracy-computation-in-validation-set-in-flux/98590)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 1\
**Last updated:** [May 10, 2023, 5:05am UTC](https://discourse.julialang.org/t/loss-accuracy-computation-in-validation-set-in-flux/98590 "2023-05-10T05:05:24Z")

</div>

Hi I have written the code below following the examples in Flux model zoo (conv\_mnist). I have a feeling I am doing something wrong especially in the validation set. I have some experience with pytorch and usually when y…

---

## [Assigning value from a matrix to a dictionary with key as pairs(i,j)](https://discourse.julialang.org/t/assigning-value-from-a-matrix-to-a-dictionary-with-key-as-pairs-i-j/98548)

<div class="topic-metadata">

**Author:** [@Gagan\_Meena](https://discourse.julialang.org/u/Gagan_Meena)\
**Replies:** 4\
**Last updated:** [May 10, 2023, 4:48am UTC](https://discourse.julialang.org/t/assigning-value-from-a-matrix-to-a-dictionary-with-key-as-pairs-i-j/98548 "2023-05-10T04:48:23Z")

</div>

Pd = Pd\_max.\*load\_rat Pdm = sum(Pd, dims=1) Pg\_Dict = Dict{Pair{Int16,Int16}, Float16}() Pd\_Dict = Dict{Int16, Float16}() for i =1:n\_bus for j =1:n\_scenarios key = Pair(i,j) Pd\_Dict\[j\] = Pdm\[j\] value = Pg\[i,j\] P…

---

## [Freezing problems with GENIE/Stipple whilst updating using ZMQ feed](https://discourse.julialang.org/t/freezing-problems-with-genie-stipple-whilst-updating-using-zmq-feed/98347)

<div class="topic-metadata">

**Author:** [@1153dent](https://discourse.julialang.org/u/1153dent)\
**Replies:** 33\
**Last updated:** [May 9, 2023, 5:44pm UTC](https://discourse.julialang.org/t/freezing-problems-with-genie-stipple-whilst-updating-using-zmq-feed/98347 "2023-05-09T17:44:35Z")

</div>

could we use genie to represent real time ( 1 sec) updates of a data structure. We tried stipple.jl but it freezes on the web page but the dataframe is still being updated.

---

## [How to use fft to 2d vector data](https://discourse.julialang.org/t/how-to-use-fft-to-2d-vector-data/98530)

<div class="topic-metadata">

**Author:** [@xiaoming](https://discourse.julialang.org/u/xiaoming)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 1:17am UTC](https://discourse.julialang.org/t/how-to-use-fft-to-2d-vector-data/98530 "2023-05-10T01:17:02Z")

</div>

I have some data like this: function f(x) \[sin(2\*pi\*x\[1\])\*cos(2\*pi\*x\[2\]), cos(2\*pi\*x\[1\])\*sin(2\*pi\*x\[2\])\] end N=200 data = \[f(\[i/N,j/N\]) for i in 0:N-1, j in 0:N-1\] which is a matrix of size N\\times N, with vector e…

---

## [Precompiling CSV.jl fails](https://discourse.julialang.org/t/precompiling-csv-jl-fails/75103)

<div class="topic-metadata">

**Author:** [@mindaslab](https://discourse.julialang.org/u/mindaslab)\
**Replies:** 13\
**Last updated:** [May 9, 2023, 11:58pm UTC](https://discourse.julialang.org/t/precompiling-csv-jl-fails/75103 "2023-05-09T23:58:45Z")

</div>

Hello All, I am running Julia 1.7.1 on MacOS Monterey 12.1, I to use CSV by running the command using CSV and I got this: ┌ Info: Precompiling CSV \[336ed68f-0bac-5ca0-87d4-7b16caf5d00b\] └ @ Base loading.jl:1423 ERROR: …

---

## [ERROR: InexactError: Int64(NaN) in LsqFit.jl](https://discourse.julialang.org/t/error-inexacterror-int64-nan-in-lsqfit-jl/98580)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 1\
**Last updated:** [May 9, 2023, 11:28pm UTC](https://discourse.julialang.org/t/error-inexacterror-int64-nan-in-lsqfit-jl/98580 "2023-05-09T23:28:50Z")

</div>

If you face this issue working with LsqFit.jl it might help to specify the initial values p0 as floating point numbers, instead of Int. This was wrong in my example: p0 = \[100, 2000, 4000\] This cured the issue: p0 …

---

## [Zygote adjoints for cholesky factorization on sparse arrays](https://discourse.julialang.org/t/zygote-adjoints-for-cholesky-factorization-on-sparse-arrays/98578)

<div class="topic-metadata">

**Author:** [@Ian\_L](https://discourse.julialang.org/u/Ian_L)\
**Replies:** 0\
**Last updated:** [May 9, 2023, 9:53pm UTC](https://discourse.julialang.org/t/zygote-adjoints-for-cholesky-factorization-on-sparse-arrays/98578 "2023-05-09T21:53:30Z")

</div>

Hi. Is there a quick and dirty way of getting AD to work when dealing with cholesky factorizations? The example below performs factorization (must be done inside) followed by solving a system of equations. The goal is t…

---

## [Julia crashes when using a @cfunction from another module](https://discourse.julialang.org/t/julia-crashes-when-using-a-cfunction-from-another-module/98576)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 2\
**Last updated:** [May 9, 2023, 9:32pm UTC](https://discourse.julialang.org/t/julia-crashes-when-using-a-cfunction-from-another-module/98576 "2023-05-09T21:32:37Z")

</div>

I’m trying to define some Julia callbacks to give to a C library, but hit some strange crashes when those functions are invoked. In an attempt to pin down the problem I have created a very simple project which still cras…

---

## [@NLconstraint and String Name](https://discourse.julialang.org/t/nlconstraint-and-string-name/98550)

<div class="topic-metadata">

**Author:** [@Mirsad\_Cosovic](https://discourse.julialang.org/u/Mirsad_Cosovic)\
**Replies:** 4\
**Last updated:** [May 9, 2023, 8:59pm UTC](https://discourse.julialang.org/t/nlconstraint-and-string-name/98550 "2023-05-09T20:59:38Z")

</div>

Can the string be included to represent the constraint name in non-linear constraints using @NLconstraint, akin to @constraint’s base\_name functionality?

---

## [Help calling fortran subroutines using ccall](https://discourse.julialang.org/t/help-calling-fortran-subroutines-using-ccall/98572)

<div class="topic-metadata">

**Author:** [@GiovanniLavezzi](https://discourse.julialang.org/u/GiovanniLavezzi)\
**Replies:** 0\
**Last updated:** [May 9, 2023, 8:02pm UTC](https://discourse.julialang.org/t/help-calling-fortran-subroutines-using-ccall/98572 "2023-05-09T20:02:20Z")

</div>

Hi, I’m trying to replicate SWxTREC/pymsis in Julia, specifically the fortran call of the following subroutines (pymsis/src/wrappers at main · SWxTREC/pymsis · GitHub). To do so, I have created the following fortran scri…

---

## [Mojo, is it just Python Julia?](https://discourse.julialang.org/t/mojo-is-it-just-python-julia/98573)

<div class="topic-metadata">

**Author:** [@cdelv](https://discourse.julialang.org/u/cdelv)\
**Replies:** 1\
**Last updated:** [May 9, 2023, 8:06pm UTC](https://discourse.julialang.org/t/mojo-is-it-just-python-julia/98573 "2023-05-09T20:06:19Z")

</div>

Hey everyone, I just saw this video about a new programing language intended for AI that is coming up. To me, looks a hell of a lot like Python Julia with its JIT. But, I would love to hear everyone’s thoughts. Also, th…

---

## [How can I suppress Gtk messages in the terminal window of VS Code](https://discourse.julialang.org/t/how-can-i-suppress-gtk-messages-in-the-terminal-window-of-vs-code/98569)

<div class="topic-metadata">

**Author:** [@Charles\_Brauer](https://discourse.julialang.org/u/Charles_Brauer)\
**Replies:** 0\
**Last updated:** [May 9, 2023, 7:16pm UTC](https://discourse.julialang.org/t/how-can-i-suppress-gtk-messages-in-the-terminal-window-of-vs-code/98569 "2023-05-09T19:16:06Z")

</div>

Hey, I’m trying a “Getting Started” example of a Gtk script using VS Code. Gtk floods my terminal window with useless (at least to me) messages. How can I suppress these messages. Here is a screen shot of my VS Code …

---

## [Random variations between results of CPU and GPU computation](https://discourse.julialang.org/t/random-variations-between-results-of-cpu-and-gpu-computation/98517)

<div class="topic-metadata">

**Author:** [@ReWoP](https://discourse.julialang.org/u/ReWoP)\
**Replies:** 7\
**Last updated:** [May 9, 2023, 7:02pm UTC](https://discourse.julialang.org/t/random-variations-between-results-of-cpu-and-gpu-computation/98517 "2023-05-09T19:02:20Z")

</div>

Hi all, I’ve noticed that I’m getting some variations between the results computed in the GPU VS the ones obtained in the CPU. Here is a simple example: a = CUDA.rand(Float64, 10000); @show CUDA.sum(a) - sum(Array(a)…

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

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