# Latest

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

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

**Page:** 770

---

## [Can the threads generated by @tspawnat synchronized by channel?](https://discourse.julialang.org/t/can-the-threads-generated-by-tspawnat-synchronized-by-channel/95043)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 15\
**Last updated:** [February 27, 2023, 10:34am UTC](https://discourse.julialang.org/t/can-the-threads-generated-by-tspawnat-synchronized-by-channel/95043 "2023-02-27T10:34:11Z")

</div>

I want to use and test multi-threading with synchronization between them using channel channels as in the example MWE, in which nthreads()=3. Each thread executes for-loop and while-loop inside it. In each iteration of …

---

## [Using parametric abstract type instead of function](https://discourse.julialang.org/t/using-parametric-abstract-type-instead-of-function/95227)

<div class="topic-metadata">

**Author:** [@harsh\_kumar](https://discourse.julialang.org/u/harsh_kumar)\
**Replies:** 6\
**Last updated:** [February 27, 2023, 10:21am UTC](https://discourse.julialang.org/t/using-parametric-abstract-type-instead-of-function/95227 "2023-02-27T10:21:11Z")

</div>

I have a function that takes an arg and callable type (shown below). I need to pass additional parameter information with the function. One of the clean ways that worked with Julia, is to define an abstract type with a p…

---

## [NeuralPDE.jl: "Transfer Learning with Neural Adapter" is out of date](https://discourse.julialang.org/t/neuralpde-jl-transfer-learning-with-neural-adapter-is-out-of-date/95262)

<div class="topic-metadata">

**Author:** [@Yahia\_Fouda](https://discourse.julialang.org/u/Yahia_Fouda)\
**Replies:** 0\
**Last updated:** [February 27, 2023, 10:16am UTC](https://discourse.julialang.org/t/neuralpde-jl-transfer-learning-with-neural-adapter-is-out-of-date/95262 "2023-02-27T10:16:39Z")

</div>

I am trying to run the tutorial: https://docs.sciml.ai/NeuralPDE/stable/tutorials/neural\_adapter/, but it seems out of date as stated in the warning message. Is there any up-to-date tutorial for using NeuralPDE.neural\_…

---

## [JuMP Empty Constraint when using SumOfSquares](https://discourse.julialang.org/t/jump-empty-constraint-when-using-sumofsquares/95208)

<div class="topic-metadata">

**Author:** [@Kevin\_Shu](https://discourse.julialang.org/u/Kevin_Shu)\
**Replies:** 5\
**Last updated:** [February 27, 2023, 9:49am UTC](https://discourse.julialang.org/t/jump-empty-constraint-when-using-sumofsquares/95208 "2023-02-27T09:49:29Z")

</div>

Hello, I’m trying to find some sum of squares representation for some polynomials, but I have been receiving some errors. Here is a shortened version of this code that gives this error: using TypedPolynomials using Co…

---

## [Hosting Pluto Notebooks online](https://discourse.julialang.org/t/hosting-pluto-notebooks-online/94529)

<div class="topic-metadata">

**Author:** [@mmj](https://discourse.julialang.org/u/mmj)\
**Replies:** 11\
**Last updated:** [February 27, 2023, 9:10am UTC](https://discourse.julialang.org/t/hosting-pluto-notebooks-online/94529 "2023-02-27T09:10:52Z")

</div>

Hello. I am currently working on a Pluto notebook, and I chose to use Pluto because of the excellent interactivity it allows. I am wondering how I can make the notebook available online. I have seen online that Binder i…

---

## [Define Lagrangian using struct](https://discourse.julialang.org/t/define-lagrangian-using-struct/95193)

<div class="topic-metadata">

**Author:** [@khaledharizb](https://discourse.julialang.org/u/khaledharizb)\
**Replies:** 5\
**Last updated:** [February 27, 2023, 8:45am UTC](https://discourse.julialang.org/t/define-lagrangian-using-struct/95193 "2023-02-27T08:45:32Z")

</div>

I’m new in Julia and I want to define a dynamical Lagrangian which is a difference between the kinetic energy and the potential energy L(x,v)=K(v)-U(x). I use this code in order to do trick for example if we but a=Lagran…

---

## [PSA: Julia 1.9 Change in argument processing --](https://discourse.julialang.org/t/psa-julia-1-9-change-in-argument-processing/95253)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [February 27, 2023, 7:00am UTC](https://discourse.julialang.org/t/psa-julia-1-9-change-in-argument-processing/95253 "2023-02-27T07:00:13Z")

</div>

@MilesCranmer discovered a bug in pyjulia that only manifested in Julia 1.9 due to a correction in argument processing. Suppose we have a file printargs.jl with the following content. println(ARGS) If you placed a -- …

---

## [Critic and his misconceptions](https://discourse.julialang.org/t/critic-and-his-misconceptions/94755)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 12\
**Last updated:** [February 27, 2023, 3:26am UTC](https://discourse.julialang.org/t/critic-and-his-misconceptions/94755 "2023-02-27T03:26:02Z")

</div>

I wonder if it was worthwhile to counter this (IMO) mostly negative narrative Why is Julia not more popular? – The Craft of Coding?

---

## [How to formulate the following constraints in JuMP](https://discourse.julialang.org/t/how-to-formulate-the-following-constraints-in-jump/95182)

<div class="topic-metadata">

**Author:** [@kevinqiao](https://discourse.julialang.org/u/kevinqiao)\
**Replies:** 4\
**Last updated:** [February 27, 2023, 2:37am UTC](https://discourse.julialang.org/t/how-to-formulate-the-following-constraints-in-jump/95182 "2023-02-27T02:37:05Z")

</div>

I have a following constraint \\left\\| \\begin{array}{c} x\\\\ y\\\\ \\end{array} \\right\\| \_2\\leqslant z \\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;\\;(1) where x, y, and z are all non-negative variables, it’s said that (1) is a SO…

---

## [Strange memory allocations](https://discourse.julialang.org/t/strange-memory-allocations/95203)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [February 27, 2023, 2:12am UTC](https://discourse.julialang.org/t/strange-memory-allocations/95203 "2023-02-27T02:12:10Z")

</div>

I have the following function: function residual!(res, yd, y::MVector{S, SimFloat}, s::KPS3, time) where S if false T = S-2 # T: three times the number of particles excluding the origin segments = di…

---

## [Plotting multiple equal-sized heatmaps from 3D array](https://discourse.julialang.org/t/plotting-multiple-equal-sized-heatmaps-from-3d-array/94973)

<div class="topic-metadata">

**Author:** [@apateonas](https://discourse.julialang.org/u/apateonas)\
**Replies:** 1\
**Last updated:** [February 27, 2023, 1:14am UTC](https://discourse.julialang.org/t/plotting-multiple-equal-sized-heatmaps-from-3d-array/94973 "2023-02-27T01:14:02Z")

</div>

H all, I have a 3D array I would like to visualize as a series of heatmaps, one for each slice. I would like each heatmap to be a square. I am having trouble with sizing the subplots. I do not know ahead of time how lar…

---

## [How to quickly find what can be done to a struct?](https://discourse.julialang.org/t/how-to-quickly-find-what-can-be-done-to-a-struct/95233)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 2\
**Last updated:** [February 27, 2023, 12:26am UTC](https://discourse.julialang.org/t/how-to-quickly-find-what-can-be-done-to-a-struct/95233 "2023-02-27T00:26:32Z")

</div>

I think when many complain that “Julia doesn’t have any inteface mechanism”, they are actually complaining about the fact that it’s hard to quickly know what can be done to an object. In C++ or Rust or Python, after you …

---

## [Help with error: "N not defined" in method signature but it is](https://discourse.julialang.org/t/help-with-error-n-not-defined-in-method-signature-but-it-is/95226)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 11\
**Last updated:** [February 26, 2023, 11:59pm UTC](https://discourse.julialang.org/t/help-with-error-n-not-defined-in-method-signature-but-it-is/95226 "2023-02-26T23:59:04Z")

</div>

I understand this might not be idiomatic, but I would like to understand what’s going on here. When compiling, the code below gives warning: WARNING: method definition for test at {File:Line} declares type variable N b…

---

## [Siam cse23](https://discourse.julialang.org/t/siam-cse23/95237)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 2\
**Last updated:** [February 26, 2023, 11:22pm UTC](https://discourse.julialang.org/t/siam-cse23/95237 "2023-02-26T23:22:57Z")

</div>

I’m in Amsterdam for SIAM CSE23, and the program shows a lot of presentations (and entire sections!) dedicated to work being done with Julia. I’ve yet to meet many people outside of my university using Julia, so I’m wond…

---

## [Best way to perform AD of an array](https://discourse.julialang.org/t/best-way-to-perform-ad-of-an-array/94999)

<div class="topic-metadata">

**Author:** [@tomkimpson](https://discourse.julialang.org/u/tomkimpson)\
**Replies:** 6\
**Last updated:** [February 26, 2023, 10:06pm UTC](https://discourse.julialang.org/t/best-way-to-perform-ad-of-an-array/94999 "2023-02-26T22:06:13Z")

</div>

I have a function that defines some 2D array. A toy example might be something like: function create\_array(coordinates,a) g = zeros(typeof(a),4,4) g\[1,1\] = coordinates\[1\]^2 + coordinates\[2\] + 3 g\[2,2\] = co…

---

## [Mysterious runtime difference](https://discourse.julialang.org/t/mysterious-runtime-difference/95234)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 3\
**Last updated:** [February 26, 2023, 9:44pm UTC](https://discourse.julialang.org/t/mysterious-runtime-difference/95234 "2023-02-26T21:44:46Z")

</div>

I would expect the two functions f1(a; dims=:) = reduce(+, a; dims) f2(a, b; dims=:) = b ? reduce(+, a; dims) : reduce(+, a; dims) to have virtually identical runtime, but that is not the case: julia\> a=\[1,2,3\]; julia\>…

---

## [Print a Flux network](https://discourse.julialang.org/t/print-a-flux-network/95239)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 0\
**Last updated:** [February 26, 2023, 9:36pm UTC](https://discourse.julialang.org/t/print-a-flux-network/95239 "2023-02-26T21:36:15Z")

</div>

I cannot figure out how to printout a Flux network. I assume there is a command to do this? Thanks.

---

## [What to do about defacto stability before 1.0](https://discourse.julialang.org/t/what-to-do-about-defacto-stability-before-1-0/85581)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 22\
**Last updated:** [February 26, 2023, 8:06pm UTC](https://discourse.julialang.org/t/what-to-do-about-defacto-stability-before-1-0/85581 "2023-02-26T20:06:04Z")

</div>

If a package becomes stable at a 0.x.y release (i.e. no future breaking changes are expected) how should that be tagged? Tagging 1.0.0 is nice because it gives some people the impression that there are no more intended …

---

## [DifferentialEquations extracting coefficients of dense interpolant](https://discourse.julialang.org/t/differentialequations-extracting-coefficients-of-dense-interpolant/93365)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 9\
**Last updated:** [February 26, 2023, 7:51pm UTC](https://discourse.julialang.org/t/differentialequations-extracting-coefficients-of-dense-interpolant/93365 "2023-02-26T19:51:16Z")

</div>

From the solution of a differential equation using Vern6, Vern7, Vern8 or Vern9, how can I extract the dense interpolant polynomial coefficients? Of course I could evaluate the polynomial on a grid of size order+1 insi…

---

## [Function seems to return an incorrect data type](https://discourse.julialang.org/t/function-seems-to-return-an-incorrect-data-type/95229)

<div class="topic-metadata">

**Author:** [@vsoler](https://discourse.julialang.org/u/vsoler)\
**Replies:** 2\
**Last updated:** [February 26, 2023, 7:39pm UTC](https://discourse.julialang.org/t/function-seems-to-return-an-incorrect-data-type/95229 "2023-02-26T19:39:06Z")

</div>

The following function seems to work well because the value it returns is of type Int8 function abc() #local x::Int8 # in a local declaration x::Int8 = 10 # as the left-hand side of an assignment x end x…

---

## [Error relating to Zygote](https://discourse.julialang.org/t/error-relating-to-zygote/95102)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 15\
**Last updated:** [February 26, 2023, 4:24pm UTC](https://discourse.julialang.org/t/error-relating-to-zygote/95102 "2023-02-26T16:24:50Z")

</div>

@ChrisRackauckas I am getting the following error (which I did not use to get): ┌ Warning: Reverse-Mode AD VJP choices all failed. Falling back to numerical VJPs What generates this error? Does it basically mean that …

---

## [Passing new Parameters in symbolics and ModelingToolKit](https://discourse.julialang.org/t/passing-new-parameters-in-symbolics-and-modelingtoolkit/95194)

<div class="topic-metadata">

**Author:** [@bombadil224](https://discourse.julialang.org/u/bombadil224)\
**Replies:** 3\
**Last updated:** [February 26, 2023, 4:22pm UTC](https://discourse.julialang.org/t/passing-new-parameters-in-symbolics-and-modelingtoolkit/95194 "2023-02-26T16:22:17Z")

</div>

I am trying to create a few different equations, pass them to a function that puts them together adding new parameters to the system and then returns the result to the user who will later pass them to other functions. A…

---

## [Pkg API for getting UUID of another package](https://discourse.julialang.org/t/pkg-api-for-getting-uuid-of-another-package/15061)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [February 26, 2023, 8:37am UTC](https://discourse.julialang.org/t/pkg-api-for-getting-uuid-of-another-package/15061 "2023-02-26T08:37:15Z")

</div>

How can I look up the UUID of a package by name in the current project using the Pkg API? julia\> import Pkg; Pkg.status() Status \`~/.julia/environments/v1.1/Project.toml\` \[6e4b80f9\] BenchmarkTools v0.4.1 \[31c24e…

---

## [Recipe to plot several line segments on the same graph](https://discourse.julialang.org/t/recipe-to-plot-several-line-segments-on-the-same-graph/94698)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 9\
**Last updated:** [February 26, 2023, 1:24pm UTC](https://discourse.julialang.org/t/recipe-to-plot-several-line-segments-on-the-same-graph/94698 "2023-02-26T13:24:42Z")

</div>

A custom type contains a vector of matrices. Each two-column matrix defines a continuous line segment. To plot this type, a plot!() function needs to be called as many times as there are line segments. I am not sure wh…

---

## [Roots::find\_zero fails depending on small differences in initial condition](https://discourse.julialang.org/t/roots-find-zero-fails-depending-on-small-differences-in-initial-condition/95202)

<div class="topic-metadata">

**Author:** [@nvonturk](https://discourse.julialang.org/u/nvonturk)\
**Replies:** 6\
**Last updated:** [February 26, 2023, 11:20am UTC](https://discourse.julialang.org/t/roots-find-zero-fails-depending-on-small-differences-in-initial-condition/95202 "2023-02-26T11:20:15Z")

</div>

Hi there, I’m having trouble with the Roots package. I have an MVE below (base of post) which is setting up a simple economics model. The last two lines showcase the issue. The first line works and returns the correct …

---

## [How to avoid shipping large object to remote workers repeatedly](https://discourse.julialang.org/t/how-to-avoid-shipping-large-object-to-remote-workers-repeatedly/95217)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 1\
**Last updated:** [February 26, 2023, 7:36am UTC](https://discourse.julialang.org/t/how-to-avoid-shipping-large-object-to-remote-workers-repeatedly/95217 "2023-02-26T07:36:34Z")

</div>

I’ve got some large object dataset which is very slow and memory intensive to serialize/deserialize to ship to remote workers, so I’d like to do it just once. However, this object gets used from some library function foo …

---

## [Add varargs methods of \`any\`, \`all\`, and \`count\`](https://discourse.julialang.org/t/add-varargs-methods-of-any-all-and-count/95072)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 26\
**Last updated:** [February 26, 2023, 7:10am UTC](https://discourse.julialang.org/t/add-varargs-methods-of-any-all-and-count/95072 "2023-02-26T07:10:26Z")

</div>

It would be helpful to have variable-length methods of any, all, and count for comparing collections, so that e.g. you could write this: all(≡, \[1,2,3\], \[1,2,3\]) # true count(≥, (3,2,1), 1:3) # 2 Proof of concept: Bas…

---

## [Auto-block or fix necro-posting (take 2)](https://discourse.julialang.org/t/auto-block-or-fix-necro-posting-take-2/95184)

<div class="topic-metadata">

**Author:** [@devel-chm](https://discourse.julialang.org/u/devel-chm)\
**Replies:** 2\
**Last updated:** [February 26, 2023, 3:22am UTC](https://discourse.julialang.org/t/auto-block-or-fix-necro-posting-take-2/95184 "2023-02-26T03:22:00Z")

</div>

This is a follow up idea to my previous question and discussion. Is it possible to have a sort of statute of limitations for reply posts to Discourse threads but handled a bit differently? I was thinking that replies…

---

## [How to solve a combination of ODEs and PDEs and organize the solution](https://discourse.julialang.org/t/how-to-solve-a-combination-of-odes-and-pdes-and-organize-the-solution/95092)

<div class="topic-metadata">

**Author:** [@markowkes](https://discourse.julialang.org/u/markowkes)\
**Replies:** 6\
**Last updated:** [February 26, 2023, 1:38am UTC](https://discourse.julialang.org/t/how-to-solve-a-combination-of-odes-and-pdes-and-organize-the-solution/95092 "2023-02-26T01:38:57Z")

</div>

Is it possible to use a struct to hold the dependent variables when using the solvers in DifferentialEquations.jl, or is it needed to create a single vector u of all dependent variables? For example, I have a system wit…

---

## [JuMP Multi-threading example](https://discourse.julialang.org/t/jump-multi-threading-example/95210)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 2\
**Last updated:** [February 26, 2023, 12:22am UTC](https://discourse.julialang.org/t/jump-multi-threading-example/95210 "2023-02-26T00:22:02Z")

</div>

In this JuMP example of multi-threading, why does the vector of solutions have 8 elements, while the for loop size is 10?

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

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