# Latest

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

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

**Page:** 311

---

## [Why are Julia strings immutable?](https://discourse.julialang.org/t/why-are-julia-strings-immutable/117320)

<div class="topic-metadata">

**Author:** [@jpnesseth](https://discourse.julialang.org/u/jpnesseth)\
**Replies:** 13\
**Last updated:** [September 28, 2024, 4:33pm UTC](https://discourse.julialang.org/t/why-are-julia-strings-immutable/117320 "2024-09-28T16:33:52Z")

</div>

The question I have (after coming here, apparently VERY late), is WHY are strings immutable? Meaning, I’m assuming this either means that Julia doesn’t implement strings as arrays of characters, or there is a reason oth…

---

## [Printing a function](https://discourse.julialang.org/t/printing-a-function/119957)

<div class="topic-metadata">

**Author:** [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Replies:** 9\
**Last updated:** [September 28, 2024, 2:27pm UTC](https://discourse.julialang.org/t/printing-a-function/119957 "2024-09-28T14:27:30Z")

</div>

If I declare a function like f(x) = x^2 + log(x) how to I display it in a function like title!=f(x)

---

## [Having a hard time with Makie Recipes](https://discourse.julialang.org/t/having-a-hard-time-with-makie-recipes/119978)

<div class="topic-metadata">

**Author:** [@co1emi11er](https://discourse.julialang.org/u/co1emi11er)\
**Replies:** 7\
**Last updated:** [September 28, 2024, 1:45pm UTC](https://discourse.julialang.org/t/having-a-hard-time-with-makie-recipes/119978 "2024-09-28T13:45:27Z")

</div>

Current Struggle I am currently building an extension for both Makie.jl and Plots.jl. While I have managed to get it working in Plots.jl, I have not had the same pleasant experience with Makie. I keep coming back to it a…

---

## [Do we need separate package for OwensQ function (power calk)?](https://discourse.julialang.org/t/do-we-need-separate-package-for-owensq-function-power-calk/120346)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 0\
**Last updated:** [September 28, 2024, 1:06pm UTC](https://discourse.julialang.org/t/do-we-need-separate-package-for-owensq-function-power-calk/120346 "2024-09-28T13:06:40Z")

</div>

Do we need separate package for OwensQ function (power calk) ? So this is the question. I’m using OwensQ function for sample size estimation for BE study in ClinicalTrialUtilities.jl , but this package was made when I …

---

## [Trying to serialize runtime generated function and MTK ODESystem](https://discourse.julialang.org/t/trying-to-serialize-runtime-generated-function-and-mtk-odesystem/119961)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 5\
**Last updated:** [September 28, 2024, 11:52am UTC](https://discourse.julialang.org/t/trying-to-serialize-runtime-generated-function-and-mtk-odesystem/119961 "2024-09-28T11:52:37Z")

</div>

I have a system with around 1500 equations. It takes a long time to run the following function, so I want to serialize and deserialize f\_ip, dvs, psym and io\_sys so I can use them between sessions. (\_, f\_ip), dvs, psym,…

---

## [Problems with MethodOfLines discretizing PDESystem involving equations of symbolic arrays](https://discourse.julialang.org/t/problems-with-methodoflines-discretizing-pdesystem-involving-equations-of-symbolic-arrays/119916)

<div class="topic-metadata">

**Author:** [@r0uv3n](https://discourse.julialang.org/u/r0uv3n)\
**Replies:** 2\
**Last updated:** [September 28, 2024, 10:14am UTC](https://discourse.julialang.org/t/problems-with-methodoflines-discretizing-pdesystem-involving-equations-of-symbolic-arrays/119916 "2024-09-28T10:14:21Z")

</div>

Hi, I’m using ModelingToolkit to do some work involving Riemannian geometry, and in particular would like to work with tensor fields in arbitrary dimension. The following is as close to a MWE as I can get my code, I thin…

---

## [Constructors for parametric types](https://discourse.julialang.org/t/constructors-for-parametric-types/119971)

<div class="topic-metadata">

**Author:** [@Maurizio\_Tomasi](https://discourse.julialang.org/u/Maurizio_Tomasi)\
**Replies:** 5\
**Last updated:** [September 28, 2024, 8:52am UTC](https://discourse.julialang.org/t/constructors-for-parametric-types/119971 "2024-09-28T08:52:11Z")

</div>

Hi all, I am studying how Julia handles constructors in parametric types and have found a puzzling behavior. Consider this trivial type: struct Test1{R \<: Real} x::R end I can instantiate Test1 either with or with…

---

## [Rotate lower n bits](https://discourse.julialang.org/t/rotate-lower-n-bits/119923)

<div class="topic-metadata">

**Author:** [@Nichola](https://discourse.julialang.org/u/Nichola)\
**Replies:** 6\
**Last updated:** [September 27, 2024, 8:46am UTC](https://discourse.julialang.org/t/rotate-lower-n-bits/119923 "2024-09-27T08:46:26Z")

</div>

I would like to rotate the lower n bits of an integer x by r. Here is my current solution : function rotate\_lower(x::Int, n::Int, r::Int) mask = (1 \<\< n) - 1 lower\_bits = x & mask rotated\_bits = (lower\_bits…

---

## [Discrete Fourier Transform (DFT) matrix and inverse](https://discourse.julialang.org/t/discrete-fourier-transform-dft-matrix-and-inverse/119952)

<div class="topic-metadata">

**Author:** [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Replies:** 18\
**Last updated:** [September 28, 2024, 7:02am UTC](https://discourse.julialang.org/t/discrete-fourier-transform-dft-matrix-and-inverse/119952 "2024-09-28T07:02:40Z")

</div>

Hello everyone, I want to calculate the explicit DFT matrix (and its inverse). I have been looking at related Julia packages to see if this functionality is somewhere available. While I could calculate it myself, I am a…

---

## [Weightened linear model in GLM.jl](https://discourse.julialang.org/t/weightened-linear-model-in-glm-jl/119962)

<div class="topic-metadata">

**Author:** [@achjaj](https://discourse.julialang.org/u/achjaj)\
**Replies:** 3\
**Last updated:** [September 28, 2024, 6:21am UTC](https://discourse.julialang.org/t/weightened-linear-model-in-glm-jl/119962 "2024-09-28T06:21:28Z")

</div>

Hi, I want to fit a plane to measured points, i.e., the function Z = aX + bY + c to data, where the Z coordinate (dependent variable) has a measurement error \\sigma. The documentation for GLM.jl mentions that lm functio…

---

## [Immutable types with mutable fields. What do I need to know?](https://discourse.julialang.org/t/immutable-types-with-mutable-fields-what-do-i-need-to-know/119977)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 11\
**Last updated:** [September 28, 2024, 3:01am UTC](https://discourse.julialang.org/t/immutable-types-with-mutable-fields-what-do-i-need-to-know/119977 "2024-09-28T03:01:17Z")

</div>

Say I have an immutable type with some mutable field like: struct S imm::Int64 mut::Base.RefValue{Int64} S(imm, mut) = new(imm, Ref(mut)) end I wanted to define broadcasting on it so it acts like a 0-dimens…

---

## [\[ANN\] EmbeddedStaticFiles.jl - Store your static assets, both locally and relocatably](https://discourse.julialang.org/t/ann-embeddedstaticfiles-jl-store-your-static-assets-both-locally-and-relocatably/119969)

<div class="topic-metadata">

**Author:** [@littlelib](https://discourse.julialang.org/u/littlelib)\
**Replies:** 12\
**Last updated:** [September 28, 2024, 12:46am UTC](https://discourse.julialang.org/t/ann-embeddedstaticfiles-jl-store-your-static-assets-both-locally-and-relocatably/119969 "2024-09-28T00:46:30Z")

</div>

Edit) @nhz2’s answer is a way more sound solution, and I suggest doing the same when you need to embed something. I’ll leave this package only as an example of something you shouldn’t do. Hi everyone! I’m happy to intr…

---

## [Nested and different AD methods altogether: How to add AD calculations inside my loss function when using neural differential equations?](https://discourse.julialang.org/t/nested-and-different-ad-methods-altogether-how-to-add-ad-calculations-inside-my-loss-function-when-using-neural-differential-equations/108985)

<div class="topic-metadata">

**Author:** [@facusapienza](https://discourse.julialang.org/u/facusapienza)\
**Replies:** 9\
**Last updated:** [September 28, 2024, 12:16am UTC](https://discourse.julialang.org/t/nested-and-different-ad-methods-altogether-how-to-add-ad-calculations-inside-my-loss-function-when-using-neural-differential-equations/108985 "2024-09-28T00:16:46Z")

</div>

Hi all, I am implementing regularization penalties inside Universal Differential Equations (also applicable to Physics-Informed neural networks) where I need to differentiate a (loss) function that includes in its calcu…

---

## [Does anyone have an implementation of MPI\_Ibcast wrapper?](https://discourse.julialang.org/t/does-anyone-have-an-implementation-of-mpi-ibcast-wrapper/119970)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [September 27, 2024, 11:56pm UTC](https://discourse.julialang.org/t/does-anyone-have-an-implementation-of-mpi-ibcast-wrapper/119970 "2024-09-27T23:56:47Z")

</div>

MPI.jl does not seem to have it. I thought I would ask. (Why redesign the wheel?)

---

## [Using Juniper with Convex.jl](https://discourse.julialang.org/t/using-juniper-with-convex-jl/119974)

<div class="topic-metadata">

**Author:** [@CaG21](https://discourse.julialang.org/u/CaG21)\
**Replies:** 2\
**Last updated:** [September 27, 2024, 9:45pm UTC](https://discourse.julialang.org/t/using-juniper-with-convex-jl/119974 "2024-09-27T21:45:23Z")

</div>

I am trying to solve a MISOCP, modeled using Convex.jl, and I thought that trying to solve it with Juniper would be great since it is one of the non-commercial solvers that can handle this problem. However, when I call s…

---

## [Efficiently check if points are contained in polygons](https://discourse.julialang.org/t/efficiently-check-if-points-are-contained-in-polygons/74415)

<div class="topic-metadata">

**Author:** [@ahmoreira](https://discourse.julialang.org/u/ahmoreira)\
**Replies:** 33\
**Last updated:** [September 27, 2024, 9:15pm UTC](https://discourse.julialang.org/t/efficiently-check-if-points-are-contained-in-polygons/74415 "2024-09-27T21:15:34Z")

</div>

Hi all, I am new to Julia and I am trying to check if points (plant occurrence points) fall within polygons from a shapefile. The code I wrote works, but I would like to make it more efficient. Currently, the code takes …

---

## [Is there an Official Shebang for Julia](https://discourse.julialang.org/t/is-there-an-official-shebang-for-julia/51581)

<div class="topic-metadata">

**Author:** [@anon70284489](https://discourse.julialang.org/u/anon70284489)\
**Replies:** 12\
**Last updated:** [September 27, 2024, 6:25pm UTC](https://discourse.julialang.org/t/is-there-an-official-shebang-for-julia/51581 "2024-09-27T18:25:24Z")

</div>

Is there an Official Shebang for Julia and if so how do I install and use it ?

---

## [How to find the elbow of a graph in Julia](https://discourse.julialang.org/t/how-to-find-the-elbow-of-a-graph-in-julia/36912)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 13\
**Last updated:** [September 27, 2024, 5:57pm UTC](https://discourse.julialang.org/t/how-to-find-the-elbow-of-a-graph-in-julia/36912 "2024-09-27T17:57:40Z")

</div>

Hi how’s it going? A common technique to finding the optimal number for K in K-means clustering is to use the elbow method. You try different values of K, and plot the average euclidean distance from the points to their…

---

## [Best Practice for Type Declarations in CUDA Kernels](https://discourse.julialang.org/t/best-practice-for-type-declarations-in-cuda-kernels/119968)

<div class="topic-metadata">

**Author:** [@jamesmulhern](https://discourse.julialang.org/u/jamesmulhern)\
**Replies:** 3\
**Last updated:** [September 27, 2024, 4:40pm UTC](https://discourse.julialang.org/t/best-practice-for-type-declarations-in-cuda-kernels/119968 "2024-09-27T16:40:10Z")

</div>

I am writing a number of CUDA kernels for my optimization project. In the rest of my code I am using parametric type declarations so that the code can be run using different types. An example of an existing function is…

---

## [Search for eigenvalues under a specific upper boundary](https://discourse.julialang.org/t/search-for-eigenvalues-under-a-specific-upper-boundary/119913)

<div class="topic-metadata">

**Author:** [@tianyi\_zhang](https://discourse.julialang.org/u/tianyi_zhang)\
**Replies:** 6\
**Last updated:** [September 27, 2024, 2:58pm UTC](https://discourse.julialang.org/t/search-for-eigenvalues-under-a-specific-upper-boundary/119913 "2024-09-27T14:58:27Z")

</div>

Hello, I am trying to solve an eigenvalue problem in which eigenvalues lesser than a upper boundary are solved. The linear operator is hermitian or real symmetric, and the eigenvalues are guaranteed to be positive, so I…

---

## [Comparison of Julia autodiff packages](https://discourse.julialang.org/t/comparison-of-julia-autodiff-packages/119965)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 1\
**Last updated:** [September 27, 2024, 2:38pm UTC](https://discourse.julialang.org/t/comparison-of-julia-autodiff-packages/119965 "2024-09-27T14:38:37Z")

</div>

Julia now has so many different autodiff packages. Can somebody summarize the status of these packages? From what I know, there is Forwarddiff (which uses dual numbers), and then there is the Reversediff, which I’m not …

---

## [Tracking the change in no: of real solutions from HomotopyContinuation.jl using Interval arithematic](https://discourse.julialang.org/t/tracking-the-change-in-no-of-real-solutions-from-homotopycontinuation-jl-using-interval-arithematic/119964)

<div class="topic-metadata">

**Author:** [@ij05](https://discourse.julialang.org/u/ij05)\
**Replies:** 0\
**Last updated:** [September 27, 2024, 1:37pm UTC](https://discourse.julialang.org/t/tracking-the-change-in-no-of-real-solutions-from-homotopycontinuation-jl-using-interval-arithematic/119964 "2024-09-27T13:37:55Z")

</div>

I am just thinking out loud here and would deeply appreciate any pointers regarding the following problem. I use the “HomotopyContinuation.jl” package to solve a system of polynomial equations. Now there are two paramet…

---

## [Failed to precompile TrajectoryOptimization](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900)

<div class="topic-metadata">

**Author:** [@jay\_Gao](https://discourse.julialang.org/u/jay_Gao)\
**Replies:** 5\
**Last updated:** [September 27, 2024, 1:36pm UTC](https://discourse.julialang.org/t/failed-to-precompile-trajectoryoptimization/119900 "2024-09-27T13:36:11Z")

</div>

when I add TrajectoryOptimization , I got an error message: ERROR: LoadError: LoadError: UndefVarError: QuatRotation not defined \[ Info: Precompiling TrajectoryOptimization \[c79d492b-0548-5874-b488-5a62c1d9d0ca\] ERROR:…

---

## [Invoke a method](https://discourse.julialang.org/t/invoke-a-method/1275)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 11\
**Last updated:** [September 27, 2024, 9:42am UTC](https://discourse.julialang.org/t/invoke-a-method/1275 "2024-09-27T09:42:18Z")

</div>

Is it possible to invoke a Method? Ie suppose I picked one from the MethodList returned by methods, and I want to invoke that particular method with given arguments. Eg m=which((+),(Int,Int)) # now how to call m with (1…

---

## [Optional positional arguments at the begining](https://discourse.julialang.org/t/optional-positional-arguments-at-the-begining/119925)

<div class="topic-metadata">

**Author:** [@Farouk](https://discourse.julialang.org/u/Farouk)\
**Replies:** 4\
**Last updated:** [September 27, 2024, 8:55am UTC](https://discourse.julialang.org/t/optional-positional-arguments-at-the-begining/119925 "2024-09-27T08:55:53Z")

</div>

Hello guys I am not a computer scientist and I am new to Julia, I am using Agents.jl for agent-based simulations. I found this function that adds agents and there are multiple signatures for it to exploit the multi dispa…

---

## [EAGO unbounded variables](https://discourse.julialang.org/t/eago-unbounded-variables/119865)

<div class="topic-metadata">

**Author:** [@kiki\_Van\_Elsen](https://discourse.julialang.org/u/kiki_Van_Elsen)\
**Replies:** 3\
**Last updated:** [September 27, 2024, 7:52am UTC](https://discourse.julialang.org/t/eago-unbounded-variables/119865 "2024-09-27T07:52:39Z")

</div>

Hello! I want to run the following code: function bivariate(solver, type) try #choose which solver you want to use m = Model(solver.Optimizer) #function we want to Optimize f(x1,x2)…

---

## [Alternatives to Jupyter](https://discourse.julialang.org/t/alternatives-to-jupyter/31154)

<div class="topic-metadata">

**Author:** [@Usor](https://discourse.julialang.org/u/Usor)\
**Replies:** 14\
**Last updated:** [September 26, 2024, 8:42pm UTC](https://discourse.julialang.org/t/alternatives-to-jupyter/31154 "2024-09-26T20:42:44Z")

</div>

Having tried Jupyter, I was disappointed. It takes too many resources, even for a few simple things, and requires a browser which is extra resources (and probably less efficient than a native binary application). At some…

---

## [How to Load Prism (Wedge) Elements in Gridap.jl?](https://discourse.julialang.org/t/how-to-load-prism-wedge-elements-in-gridap-jl/119938)

<div class="topic-metadata">

**Author:** [@Skadi](https://discourse.julialang.org/u/Skadi)\
**Replies:** 0\
**Last updated:** [September 27, 2024, 5:30am UTC](https://discourse.julialang.org/t/how-to-load-prism-wedge-elements-in-gridap-jl/119938 "2024-09-27T05:30:15Z")

</div>

Hello, I am working on solving PDEs using Gridap.jl, specifically on a 3D mesh with 6-node prism (wedge) elements. I converted my original mesh(with node coordinates and connectivity matrix) to a .msh file and tried to …

---

## [\[ANN\] AstroPropagators.jl - High-Fidelity Astrodynamics Propagation](https://discourse.julialang.org/t/ann-astropropagators-jl-high-fidelity-astrodynamics-propagation/119935)

<div class="topic-metadata">

**Author:** [@anon22248738](https://discourse.julialang.org/u/anon22248738)\
**Replies:** 0\
**Last updated:** [September 27, 2024, 3:14am UTC](https://discourse.julialang.org/t/ann-astropropagators-jl-high-fidelity-astrodynamics-propagation/119935 "2024-09-27T03:14:30Z")

</div>

I’m happy to announce the first 3 packages of a high-fidelity astrodynamics simulator: AstroPropagators.jl AstroForceModels.jl AstroCoords.jl By defining the underlying dynamics model parameters, you can build a multi…

---

## [Is it possible to do Nested AD ~elegantly~ in Julia? (PINNs)](https://discourse.julialang.org/t/is-it-possible-to-do-nested-ad-elegantly-in-julia-pinns/98888)

<div class="topic-metadata">

**Author:** [@Bizzi](https://discourse.julialang.org/u/Bizzi)\
**Replies:** 43\
**Last updated:** [September 27, 2024, 2:18am UTC](https://discourse.julialang.org/t/is-it-possible-to-do-nested-ad-elegantly-in-julia-pinns/98888 "2024-09-27T02:18:30Z")

</div>

To differentiate a loss function defined in terms of a network’s derivatives seems to have been an issue since forever, specially when Zygote is involved; see \[1\] \[2\] \[3\] and many more over at Zygote’s git. In many of t…

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

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