# Latest

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

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

**Page:** 1231

---

## [Difference in floating-point results for sqrt vs exponentiation on nightly (possible regression?)](https://discourse.julialang.org/t/difference-in-floating-point-results-for-sqrt-vs-exponentiation-on-nightly-possible-regression/70207)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [October 22, 2021, 12:09pm UTC](https://discourse.julialang.org/t/difference-in-floating-point-results-for-sqrt-vs-exponentiation-on-nightly-possible-regression/70207 "2021-10-22T12:09:44Z")

</div>

This used to work on previous versions of Julia, but fails on nightly Julia 1.6 and 1.7rc1 julia\> sqrt(1.5) == 1.5^0.5 true nightly julia\> sqrt(1.5) == 1.5^0.5 false I realize that floating-point results are not gua…

---

## [Multiple Dispatch based on the number of function's arguments that is by itself an argument](https://discourse.julialang.org/t/multiple-dispatch-based-on-the-number-of-functions-arguments-that-is-by-itself-an-argument/52945)

<div class="topic-metadata">

**Author:** [@tiago](https://discourse.julialang.org/u/tiago)\
**Replies:** 8\
**Last updated:** [October 22, 2021, 10:15am UTC](https://discourse.julialang.org/t/multiple-dispatch-based-on-the-number-of-functions-arguments-that-is-by-itself-an-argument/52945 "2021-10-22T10:15:14Z")

</div>

Hello, I’m currently doing a numerical solver for a certain type of PDEs (Neural Field Equations) and these equations accepts functions as inputs (and parameters as well). The equation in study is given by: where I, K…

---

## [SymRCM doesn't seem to help linear solver to perform](https://discourse.julialang.org/t/symrcm-doesnt-seem-to-help-linear-solver-to-perform/69878)

<div class="topic-metadata">

**Author:** [@Niceno](https://discourse.julialang.org/u/Niceno)\
**Replies:** 12\
**Last updated:** [October 22, 2021, 9:37am UTC](https://discourse.julialang.org/t/symrcm-doesnt-seem-to-help-linear-solver-to-perform/69878 "2021-10-22T09:37:21Z")

</div>

Dear all, Yesterday I came across SymRCM.jl package, which seems to work really neatly and is easy to use, but it doesn’t seem to bring me any performance benefits. Allow me to explain. I wrote a little computational …

---

## [Tweaking @btime](https://discourse.julialang.org/t/tweaking-btime/70090)

<div class="topic-metadata">

**Author:** [@Giulio\_Benedetti](https://discourse.julialang.org/u/Giulio_Benedetti)\
**Replies:** 8\
**Last updated:** [October 22, 2021, 9:34am UTC](https://discourse.julialang.org/t/tweaking-btime/70090 "2021-10-22T09:34:08Z")

</div>

Hello! The docs of the macro ‘@btime’ says: The printed time is the minimum elapsed time measured during the benchmark. Is there a way to make the macro ‘@btime’ print the mean execution time instead of the minimum? …

---

## [Extracting Default Arguments from Function Signature](https://discourse.julialang.org/t/extracting-default-arguments-from-function-signature/70112)

<div class="topic-metadata">

**Author:** [@anicusan](https://discourse.julialang.org/u/anicusan)\
**Replies:** 1\
**Last updated:** [October 22, 2021, 9:14am UTC](https://discourse.julialang.org/t/extracting-default-arguments-from-function-signature/70112 "2021-10-22T09:14:41Z")

</div>

Is there any way to extract the default values from a method’s signature? For example, say I define: # Function with two keyword arguments that have default values function f(x, y; kx = 3, ky = 4) end # Call function w…

---

## [Error when importing CUDAnative (or just about anything with CUDA)](https://discourse.julialang.org/t/error-when-importing-cudanative-or-just-about-anything-with-cuda/70198)

<div class="topic-metadata">

**Author:** [@Niceno](https://discourse.julialang.org/u/Niceno)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 8:55am UTC](https://discourse.julialang.org/t/error-when-importing-cudanative-or-just-about-anything-with-cuda/70198 "2021-10-22T08:55:06Z")

</div>

Dear all, When I try to import CUDAnative into Julia 1.6.3, I get the following error: julia\> import Pkg; Pkg.add("CUDAnative") Resolving package versions... ERROR: Unsatisfiable requirements detected for package CU…

---

## [Type inference with a functional programing style](https://discourse.julialang.org/t/type-inference-with-a-functional-programing-style/70105)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 10\
**Last updated:** [October 22, 2021, 8:43am UTC](https://discourse.julialang.org/t/type-inference-with-a-functional-programing-style/70105 "2021-10-22T08:43:21Z")

</div>

I’m having trouble with type inference. I’d like to be able to write this sort of thing and have it run quickly: function silly\_last(vs::AbstractVector) x = first(vs) map(vs) do v x = v end x e…

---

## [What is \`Base.allocatedinline\` and custom types for \`CuArray\` (\`CUDA.jl\`) involving \`Missing\`](https://discourse.julialang.org/t/what-is-base-allocatedinline-and-custom-types-for-cuarray-cuda-jl-involving-missing/70122)

<div class="topic-metadata">

**Author:** [@PaulVirally](https://discourse.julialang.org/u/PaulVirally)\
**Replies:** 3\
**Last updated:** [October 22, 2021, 8:24am UTC](https://discourse.julialang.org/t/what-is-base-allocatedinline-and-custom-types-for-cuarray-cuda-jl-involving-missing/70122 "2021-10-22T08:24:01Z")

</div>

I am trying to pass an array of a custom type to the GPU using CUDA.jl. Here is a MWE: using CUDA struct MyStruct arr::Vector{Tuple{Int, Int}} end cpu\_arr = Vector{Union{Missing, MyStruct}} # Works as expected gpu…

---

## [There is an analog of numpy.reduceat in Julia?](https://discourse.julialang.org/t/there-is-an-analog-of-numpy-reduceat-in-julia/70187)

<div class="topic-metadata">

**Author:** [@vinicius\_de\_lima](https://discourse.julialang.org/u/vinicius_de_lima)\
**Replies:** 4\
**Last updated:** [October 22, 2021, 8:22am UTC](https://discourse.julialang.org/t/there-is-an-analog-of-numpy-reduceat-in-julia/70187 "2021-10-22T08:22:16Z")

</div>

I’m trying to implement the algorithm presented here in Julia, but I don’t know how to adapt: S = np.add.reduceat( np.add.reduceat(Z, np.arange(0, Z.shape\[0\], k), axis=0), np.a…

---

## [\[ANN\] MissingsAsFalse.jl: Treat missing as false in select operations](https://discourse.julialang.org/t/ann-missingsasfalse-jl-treat-missing-as-false-in-select-operations/70062)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 1\
**Last updated:** [October 20, 2021, 3:27pm UTC](https://discourse.julialang.org/t/ann-missingsasfalse-jl-treat-missing-as-false-in-select-operations/70062 "2021-10-20T15:27:26Z")

</div>

Hello everyone! I am pleased to announce the release of a new package: MissingsAsFalse.jl. As the name implies, it helps you write code where comparisons with missing are treated as false. Which is often what is needed i…

---

## [How to use LBFGS to get the minimum value in the optimization process, but not the last one](https://discourse.julialang.org/t/how-to-use-lbfgs-to-get-the-minimum-value-in-the-optimization-process-but-not-the-last-one/70080)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 5\
**Last updated:** [October 22, 2021, 6:54am UTC](https://discourse.julialang.org/t/how-to-use-lbfgs-to-get-the-minimum-value-in-the-optimization-process-but-not-the-last-one/70080 "2021-10-22T06:54:45Z")

</div>

When I was doing optimization calculations with the Optim package\[Optim.jl\], , I found that the objective function sometimes unexpectedly tended to go up. I think it might have something to do with the LBFGS method, the …

---

## [Estimate posterior distribution of initial condition(s)](https://discourse.julialang.org/t/estimate-posterior-distribution-of-initial-condition-s/70139)

<div class="topic-metadata">

**Author:** [@vembha](https://discourse.julialang.org/u/vembha)\
**Replies:** 4\
**Last updated:** [October 21, 2021, 4:58pm UTC](https://discourse.julialang.org/t/estimate-posterior-distribution-of-initial-condition-s/70139 "2021-10-21T16:58:41Z")

</div>

Hello, I understood how the defining of prior distributions to parameter values and estimating the posterior distributions works using Turing. But, I was wondering if there is a way to estimate the posterior distributio…

---

## [Error when using DifferentialEquations](https://discourse.julialang.org/t/error-when-using-differentialequations/70079)

<div class="topic-metadata">

**Author:** [@gnicolosi](https://discourse.julialang.org/u/gnicolosi)\
**Replies:** 2\
**Last updated:** [October 20, 2021, 10:49am UTC](https://discourse.julialang.org/t/error-when-using-differentialequations/70079 "2021-10-20T10:49:57Z")

</div>

I have read some old similar questions, but could not find a suitable solution. When I enter using DifferentialEquations this is what I get. Someone can tell me what it is going on, please? Thank you! Failed to precompi…

---

## [Float vs integer and the == sign](https://discourse.julialang.org/t/float-vs-integer-and-the-sign/70172)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 7\
**Last updated:** [October 22, 2021, 3:13am UTC](https://discourse.julialang.org/t/float-vs-integer-and-the-sign/70172 "2021-10-22T03:13:17Z")

</div>

I noticed that when D has at least one floating numbers, this program will work: D = \[-0, 0, 1, 5, 0, 7.1, 0\] D\[D .== 0\] .= 0.0001; But it will quit working when D is composed of integers entirely. D = \[-0, 0, 1, 5, …

---

## [\[ParallelStencil\] Boundary Conditions](https://discourse.julialang.org/t/parallelstencil-boundary-conditions/70171)

<div class="topic-metadata">

**Author:** [@apattyn](https://discourse.julialang.org/u/apattyn)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 1:22am UTC](https://discourse.julialang.org/t/parallelstencil-boundary-conditions/70171 "2021-10-22T01:22:55Z")

</div>

I was taking a look at the acoustic apps, and I was able to modify it to include a time-varying pressure source. However, I can’t quite figure out how to prevent back reflections from the boundary. Is it possible to m…

---

## [Is typeof(x::Unitful).parameters\[1\] reliable?](https://discourse.julialang.org/t/is-typeof-x-unitful-parameters-1-reliable/70185)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 1\
**Last updated:** [October 22, 2021, 1:04am UTC](https://discourse.julialang.org/t/is-typeof-x-unitful-parameters-1-reliable/70185 "2021-10-22T01:04:44Z")

</div>

Is this a reliable (stable) way to extract the type of float of a value of type Unitful, or is this an implementation detail? Is there a standard way to do so? julia\> using Unitful julia\> x = 1.0u"nm" 1.0 nm julia\> ty…

---

## [Lyapunov Spectrum simple code problem](https://discourse.julialang.org/t/lyapunov-spectrum-simple-code-problem/70182)

<div class="topic-metadata">

**Author:** [@Gabriel\_Carita](https://discourse.julialang.org/u/Gabriel_Carita)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 12:43am UTC](https://discourse.julialang.org/t/lyapunov-spectrum-simple-code-problem/70182 "2021-10-22T00:43:20Z")

</div>

Hello there, I’m trying to figure out how to solve my lyapunov spectrum handwrite code using the QR method for a simple example (lorenz system), there is something wrong with my code ? I’m trying to reproduce the values…

---

## [Making a Boolean Operator Not a Boolean Operator (And Operator Precedence)](https://discourse.julialang.org/t/making-a-boolean-operator-not-a-boolean-operator-and-operator-precedence/70138)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 12:33am UTC](https://discourse.julialang.org/t/making-a-boolean-operator-not-a-boolean-operator-and-operator-precedence/70138 "2021-10-22T00:33:48Z")

</div>

I’ve defined the binary “parallel” operator as: ∥(a::Number,b::Number) = 1/(1/a+1/b) This operation is very common in electronics, and is related to the harmonic mean. I’ve also overloaded it with ∥(a::Component,b::Co…

---

## [What is \`slt\_int\`](https://discourse.julialang.org/t/what-is-slt-int/70157)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 8\
**Last updated:** [October 22, 2021, 12:01am UTC](https://discourse.julialang.org/t/what-is-slt-int/70157 "2021-10-22T00:01:09Z")

</div>

What is Core.Intrinsics.slt\_int? As seen in base/sort.jl, added 2013. Also, how can I find out the answer to this sort of question in general? I tried @edit, ?, web searches, and even git blame (a much less ideal soluti…

---

## [\[ANN\] Metida.jl: experimental package for mixed-effects models with flexible covariance structure](https://discourse.julialang.org/t/ann-metida-jl-experimental-package-for-mixed-effects-models-with-flexible-covariance-structure/48560)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 4\
**Last updated:** [October 21, 2021, 11:33pm UTC](https://discourse.julialang.org/t/ann-metida-jl-experimental-package-for-mixed-effects-models-with-flexible-covariance-structure/48560 "2021-10-21T23:33:28Z")

</div>

Metida.jl is a Julia package for fitting mixed-effects models with flexible covariance structure. At this moment package is in early development stage. Main goal to make reproducible output corresponding to SAS/SPSS. N…

---

## [Computing tuple replacements](https://discourse.julialang.org/t/computing-tuple-replacements/69581)

<div class="topic-metadata">

**Author:** [@goerch](https://discourse.julialang.org/u/goerch)\
**Replies:** 18\
**Last updated:** [October 21, 2021, 9:08pm UTC](https://discourse.julialang.org/t/computing-tuple-replacements/69581 "2021-10-21T21:08:05Z")

</div>

I have some code to compute a tuple replacement function set(tuple::Tuple{T1, T2}, t, i::I) where {T1, T2, I} if i == 1 (t, tuple\[2\]) elseif i == 2 (tuple\[1\], t) else tuple end en…

---

## [How to read tables out of a MAT file?](https://discourse.julialang.org/t/how-to-read-tables-out-of-a-mat-file/70098)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 11\
**Last updated:** [October 21, 2021, 8:55pm UTC](https://discourse.julialang.org/t/how-to-read-tables-out-of-a-mat-file/70098 "2021-10-21T20:55:00Z")

</div>

Normally, this is how I read a variable out of a MAT file: using MAT F1 = matopen("test.mat"); Var1 = read(F1, "Var1"); close(F1); Now I have some Matlab tables stored in the MAT file. Below is an example: Name …

---

## [Is this a bug of the Julia function "unique"?](https://discourse.julialang.org/t/is-this-a-bug-of-the-julia-function-unique/70141)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 31\
**Last updated:** [October 21, 2021, 8:49pm UTC](https://discourse.julialang.org/t/is-this-a-bug-of-the-julia-function-unique/70141 "2021-10-21T20:49:14Z")

</div>

I notice that any NaN values inside a data will mess up Julia’s unique function. For example I have a matrix A with 3 duplicate rows: A = \[1 NaN 3; 1 NaN 3; 1 NaN 3\]; 3×3 Matrix{Float64}: 1.0 NaN 3.0 1.0 NaN 3.0 …

---

## [How to write a specific column name in CSV.write function?](https://discourse.julialang.org/t/how-to-write-a-specific-column-name-in-csv-write-function/70176)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 9\
**Last updated:** [October 21, 2021, 8:30pm UTC](https://discourse.julialang.org/t/how-to-write-a-specific-column-name-in-csv-write-function/70176 "2021-10-21T20:30:34Z")

</div>

I have an empty csv file named “Output”. I want to to show the values of V under a specific column name (in my case V\_S1 as will be shown by the println()). However, I am having the below error. Any idea to handle this i…

---

## [DifferentialEquations.jl and ReverseDiff.jl: MethodError: Cannot \`convert\` an object of type Vector{ReverseDiff.TrackedReal{](https://discourse.julialang.org/t/differentialequations-jl-and-reversediff-jl-methoderror-cannot-convert-an-object-of-type-vector-reversediff-trackedreal/70175)

<div class="topic-metadata">

**Author:** [@salazardetroya](https://discourse.julialang.org/u/salazardetroya)\
**Replies:** 1\
**Last updated:** [October 21, 2021, 7:43pm UTC](https://discourse.julialang.org/t/differentialequations-jl-and-reversediff-jl-methoderror-cannot-convert-an-object-of-type-vector-reversediff-trackedreal/70175 "2021-10-21T19:43:49Z")

</div>

I am trying to get gradients in a heat equation solved with DifferentialEquations.jl: using DiffEqOperators, OrdinaryDiffEq, Plots, Zygote, DiffEqSensitivity nknots = 10 h = 1.0 / (nknots + 1) knots = range(h, step=h, …

---

## [Error: Undefined variable, inside a macro in a for loop in a function of a module](https://discourse.julialang.org/t/error-undefined-variable-inside-a-macro-in-a-for-loop-in-a-function-of-a-module/70169)

<div class="topic-metadata">

**Author:** [@Giulio\_Benedetti](https://discourse.julialang.org/u/Giulio_Benedetti)\
**Replies:** 2\
**Last updated:** [October 21, 2021, 6:18pm UTC](https://discourse.julialang.org/t/error-undefined-variable-inside-a-macro-in-a-for-loop-in-a-function-of-a-module/70169 "2021-10-21T18:18:23Z")

</div>

Hello! I defined the following function and included it in a module: function benchmark(Mdata, F, JF, Exact, y0, β, par, H) Bench = zeros(length(H), 2, 2) t = zeros() y = zeros() t1 = zeros() y1 = …

---

## [Is there a way to detect and automatically fix type-unstable code?](https://discourse.julialang.org/t/is-there-a-way-to-detect-and-automatically-fix-type-unstable-code/70115)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 4\
**Last updated:** [October 21, 2021, 4:44pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-detect-and-automatically-fix-type-unstable-code/70115 "2021-10-21T16:44:24Z")

</div>

E.g. lets say you do: julia\> if x % 2 == 0 x/2 else 2x end I believe there is a macro to check, I forget which, but could a macro “conform” the type of both code paths, i.e. here to Floa…

---

## [Hiring Student Assistants at Georgia Tech Research Institute](https://discourse.julialang.org/t/hiring-student-assistants-at-georgia-tech-research-institute/70167)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 0\
**Last updated:** [October 21, 2021, 4:25pm UTC](https://discourse.julialang.org/t/hiring-student-assistants-at-georgia-tech-research-institute/70167 "2021-10-21T16:25:52Z")

</div>

Hi everyone! I am currently looking to hire a student assistant to work with me at Georgia Tech Research Institute! If you are interested in advancing research in public health, healthcare analytics, and health equity,…

---

## [DiffEqOperators and gradients](https://discourse.julialang.org/t/diffeqoperators-and-gradients/70121)

<div class="topic-metadata">

**Author:** [@salazardetroya](https://discourse.julialang.org/u/salazardetroya)\
**Replies:** 2\
**Last updated:** [October 21, 2021, 4:00pm UTC](https://discourse.julialang.org/t/diffeqoperators-and-gradients/70121 "2021-10-21T16:00:05Z")

</div>

I am trying to solve the following problem \\begin{aligned} \\nabla \\cdot \\nabla \\phi\_{1} &= \\frac{\\partial\\left(\\phi\_{1}-\\phi\_{2}\\right)}{\\partial t}\\\\ \\nabla \\cdot \\nabla \\phi\_{2} &= -\\tau p\_1p\_2\\frac{\\partial\\left(\\…

---

## [Questions related to -0.0 and 0.0](https://discourse.julialang.org/t/questions-related-to-0-0-and-0-0/70158)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 9\
**Last updated:** [October 21, 2021, 3:53pm UTC](https://discourse.julialang.org/t/questions-related-to-0-0-and-0-0/70158 "2021-10-21T15:53:48Z")

</div>

I’m using PCHIPInterpolation to do some interpolation. itp = Interpolator(xs, ys); This program absolutely does not allow any values in its x to be duplicates. I now have some values like the below in my data sets: xs…

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

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