# Latest

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

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

**Page:** 844

---

## [When the ternary operator fails](https://discourse.julialang.org/t/when-the-ternary-operator-fails/91332)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 2\
**Last updated:** [December 7, 2022, 2:25am UTC](https://discourse.julialang.org/t/when-the-ternary-operator-fails/91332 "2022-12-07T02:25:13Z")

</div>

In the specific case where I want the ternary operator to give me an operator, it fails, but the if then else approach works. I expect there is an explanation, or maybe it is a bug. What does not work julia\> a = "1+2"…

---

## [Parsing keyword argument method call name?](https://discourse.julialang.org/t/parsing-keyword-argument-method-call-name/91334)

<div class="topic-metadata">

**Author:** [@FedeClaudi](https://discourse.julialang.org/u/FedeClaudi)\
**Replies:** 0\
**Last updated:** [December 7, 2022, 2:02am UTC](https://discourse.julialang.org/t/parsing-keyword-argument-method-call-name/91334 "2022-12-07T02:02:28Z")

</div>

Hey everyone, I’m working on improving Term.jl’s stack trace functionality. The idea is to present nicely formatted stacktraces (hiding irrelevant info and highlighting useful stuff with color) However I find it har…

---

## [Wiki of known traps](https://discourse.julialang.org/t/wiki-of-known-traps/91329)

<div class="topic-metadata">

**Author:** [@tchebycheff](https://discourse.julialang.org/u/tchebycheff)\
**Replies:** 0\
**Last updated:** [December 7, 2022, 1:08am UTC](https://discourse.julialang.org/t/wiki-of-known-traps/91329 "2022-12-07T01:08:53Z")

</div>

Is there a wiki of known Julia traps? (fresh bruises from logpdfs of Distributions.jl and auto differentiation)

---

## [Weird Base.show behavior with custom Struct](https://discourse.julialang.org/t/weird-base-show-behavior-with-custom-struct/91321)

<div class="topic-metadata">

**Author:** [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)\
**Replies:** 3\
**Last updated:** [December 7, 2022, 12:16am UTC](https://discourse.julialang.org/t/weird-base-show-behavior-with-custom-struct/91321 "2022-12-07T00:16:58Z")

</div>

For some reason checking my custom Struct in the REPL differs from the Base.show() method I defined. Can anyone replicate and/or explain why this might be happening? Here is a MWE to (hopefully) replicate the behavior: …

---

## [Field names and values of a struct defined as NTuple](https://discourse.julialang.org/t/field-names-and-values-of-a-struct-defined-as-ntuple/91284)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 4\
**Last updated:** [December 6, 2022, 11:58pm UTC](https://discourse.julialang.org/t/field-names-and-values-of-a-struct-defined-as-ntuple/91284 "2022-12-06T23:58:42Z")

</div>

Hi! Let struct ex1 name::String age::Int end I understand that (1) the statements above define a new type of record containing a string and a number (2) an instance of that type can be created as a = ex1("Jo…

---

## [How are vectors of vectors type coerced?](https://discourse.julialang.org/t/how-are-vectors-of-vectors-type-coerced/91322)

<div class="topic-metadata">

**Author:** [@jeffreyesun](https://discourse.julialang.org/u/jeffreyesun)\
**Replies:** 6\
**Last updated:** [December 6, 2022, 11:26pm UTC](https://discourse.julialang.org/t/how-are-vectors-of-vectors-type-coerced/91322 "2022-12-06T23:26:50Z")

</div>

I was having a bug in my code, which basically boils down to this. inds = \[1,2,3\] # Vector{Int} vals = \[1.5, 2.5, 3.5\] # Vector{Float64} ivvec = \[inds, vals\] # Vector{Vector{Float64}} ivvec\[2\]\[ivvec\[1\]\] #ERROR: Argument…

---

## [Gurobi with Log constranints](https://discourse.julialang.org/t/gurobi-with-log-constranints/91316)

<div class="topic-metadata">

**Author:** [@mreguant](https://discourse.julialang.org/u/mreguant)\
**Replies:** 7\
**Last updated:** [December 6, 2022, 11:10pm UTC](https://discourse.julialang.org/t/gurobi-with-log-constranints/91316 "2022-12-06T23:10:23Z")

</div>

Hello, I am trying to make the log constraints work with Gurobi.jl and JuMP.jl. However, I don’t seem to be able to successfully use the C call function. Anyone who has managed to use them? I paste a simple example bel…

---

## [(DataFrames.jl Suggestion) A (public) function that takes the same args as \`subset\` and returns the matched indices](https://discourse.julialang.org/t/dataframes-jl-suggestion-a-public-function-that-takes-the-same-args-as-subset-and-returns-the-matched-indices/91325)

<div class="topic-metadata">

**Author:** [@bert](https://discourse.julialang.org/u/bert)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 10:54pm UTC](https://discourse.julialang.org/t/dataframes-jl-suggestion-a-public-function-that-takes-the-same-args-as-subset-and-returns-the-matched-indices/91325 "2022-12-06T22:54:58Z")

</div>

It would be great if DataFrames.jl had a function or functions that would function more or less the same way subset does, except that they’d would return a vector containing the indices of kept rows instead of a new fram…

---

## [Question about macro and how to resolve/esc variables/expressions](https://discourse.julialang.org/t/question-about-macro-and-how-to-resolve-esc-variables-expressions/91309)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 8:19pm UTC](https://discourse.julialang.org/t/question-about-macro-and-how-to-resolve-esc-variables-expressions/91309 "2022-12-06T20:19:08Z")

</div>

Hi all :slight\_smile: Here is a little example code. I’m interested in the local var \_error\_msg : local \_error\_msg = $(esc(sprint(showerror, error, catch\_backtrace()))) So what I want is the error and catch\_backtrace …

---

## [LinearSolve for a matrix-free problem](https://discourse.julialang.org/t/linearsolve-for-a-matrix-free-problem/91308)

<div class="topic-metadata">

**Author:** [@Lucas\_S\_Campos](https://discourse.julialang.org/u/Lucas_S_Campos)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 3:55pm UTC](https://discourse.julialang.org/t/linearsolve-for-a-matrix-free-problem/91308 "2022-12-06T15:55:48Z")

</div>

I am trying to use LinearSolve for a matrix-free problem. I tried using the functionoperator from SciMLOperators and it does seem to work when doing matrix multiplication. However when trying to solve a linear system it…

---

## [Rounding BigFloat to 3 significant digits](https://discourse.julialang.org/t/rounding-bigfloat-to-3-significant-digits/91295)

<div class="topic-metadata">

**Author:** [@maxchendt](https://discourse.julialang.org/u/maxchendt)\
**Replies:** 9\
**Last updated:** [December 6, 2022, 7:22pm UTC](https://discourse.julialang.org/t/rounding-bigfloat-to-3-significant-digits/91295 "2022-12-06T19:22:49Z")

</div>

display(BigFloat(2)^-76) display(round(BigFloat(2)^-76, sigdigits=3)) display(round(convert(Float64, BigFloat(2)^-76), sigdigits=3)) shows that 1.32348898008484427979425390731194056570529937744140625e-23 1.319999999999…

---

## [VSCode cannot find the Julia executable that exists](https://discourse.julialang.org/t/vscode-cannot-find-the-julia-executable-that-exists/58133)

<div class="topic-metadata">

**Author:** [@oo92](https://discourse.julialang.org/u/oo92)\
**Replies:** 25\
**Last updated:** [December 6, 2022, 7:16pm UTC](https://discourse.julialang.org/t/vscode-cannot-find-the-julia-executable-that-exists/58133 "2022-12-06T19:16:11Z")

</div>

Hi. I am trying to get my Julia 1.5.4 to work with my VSCode but it does not. I do not understand why this is the case. I renewed the installation for each but the problem persists. This is my Preferences \> Settings \> Ju…

---

## [Makie.xlabel!](https://discourse.julialang.org/t/makie-xlabel/53905)

<div class="topic-metadata">

**Author:** [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Replies:** 4\
**Last updated:** [December 6, 2022, 6:22pm UTC](https://discourse.julialang.org/t/makie-xlabel/53905 "2022-12-06T18:22:51Z")

</div>

Makie.xlabel! has stopped working for me after a recent update. For example, using Makie h = Makie.lines(1:10,rand(10)) Makie.xlabel!(h, "label") produces ERROR: MethodError: no method matching getindex(::AbstractPlot…

---

## [Show PyPlot](https://discourse.julialang.org/t/show-pyplot/91166)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 9\
**Last updated:** [December 6, 2022, 5:55pm UTC](https://discourse.julialang.org/t/show-pyplot/91166 "2022-12-06T17:55:51Z")

</div>

Hello everyone! Please, I need help with a simple task: x = plot(…); …; close() How to show the graph again using x? I use Julia 1.8.3 e PyPlot

---

## [Making LBFGS in \`Optim.jl\` as fast as in \`NLopt.jl\`](https://discourse.julialang.org/t/making-lbfgs-in-optim-jl-as-fast-as-in-nlopt-jl/91259)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 13\
**Last updated:** [December 6, 2022, 5:18pm UTC](https://discourse.julialang.org/t/making-lbfgs-in-optim-jl-as-fast-as-in-nlopt-jl/91259 "2022-12-06T17:18:12Z")

</div>

I have a (somewhat expensive to calculate) loss function f(x) for which I can compute exact gradients using Zygote.jl and wish to minimise it. So far I have been using the LBFGS implementation in NLopt.jl to do that, bu…

---

## [Juliaup not working](https://discourse.julialang.org/t/juliaup-not-working/91158)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 6\
**Last updated:** [December 6, 2022, 5:02pm UTC](https://discourse.julialang.org/t/juliaup-not-working/91158 "2022-12-06T17:02:22Z")

</div>

Hi everyone, I installed juliaup yesterday on my Mac and it worked fine. However, today I am having trouble initializing the desired release. If I go to my terminal and type juliaup status I get: However, if I type…

---

## [Diffeq\_rd not found](https://discourse.julialang.org/t/diffeq-rd-not-found/91310)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [December 6, 2022, 4:49pm UTC](https://discourse.julialang.org/t/diffeq-rd-not-found/91310 "2022-12-06T16:49:21Z")

</div>

@ChrisRackauckas Hi Chris, When using \[aae7a2af\] DiffEqFlux v1.52.0 \[0c46a032\] DifferentialEquations v7.6.0 I get an error: diffeq\_rd not found, when running code found at URL: model-zoo/ode.jl at da4156b4a9fb0d5…

---

## [Emacs: starting eglot server](https://discourse.julialang.org/t/emacs-starting-eglot-server/91311)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 4\
**Last updated:** [December 6, 2022, 10:55am UTC](https://discourse.julialang.org/t/emacs-starting-eglot-server/91311 "2022-12-06T10:55:57Z")

</div>

Dear all I apologize if this has already been discussed elsewhere but I did not come up with a solution. I installed the melpa version of eglot eglot-jl 20221128.1655 but it has some issues: Each time I open a .j…

---

## [MethodError: no method matching getrf! when I try to use GPU to training a universal differential equation with ForwardDiff.jl](https://discourse.julialang.org/t/methoderror-no-method-matching-getrf-when-i-try-to-use-gpu-to-training-a-universal-differential-equation-with-forwarddiff-jl/91062)

<div class="topic-metadata">

**Author:** [@Ronaldo\_Nogueira](https://discourse.julialang.org/u/Ronaldo_Nogueira)\
**Replies:** 5\
**Last updated:** [December 6, 2022, 3:50pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-getrf-when-i-try-to-use-gpu-to-training-a-universal-differential-equation-with-forwarddiff-jl/91062 "2022-12-06T15:50:07Z")

</div>

Hi, thank you for your attention. So, I’m trying to make use of GPU to train a universal differential equation but, when I run the code to make the optimization with Optimization.jl I got this error below. I already trie…

---

## [Default ndims method for any type that HasShape{N}?](https://discourse.julialang.org/t/default-ndims-method-for-any-type-that-hasshape-n/91271)

<div class="topic-metadata">

**Author:** [@nchisholm](https://discourse.julialang.org/u/nchisholm)\
**Replies:** 0\
**Last updated:** [December 5, 2022, 4:54pm UTC](https://discourse.julialang.org/t/default-ndims-method-for-any-type-that-hasshape-n/91271 "2022-12-05T16:54:39Z")

</div>

Currently, if one defines, for example, Base.IteratorSize(::MyMatrixLikeType) = Base.HasShape{2}(), one still needs to define Base.ndims(mymat::MyMatrixLikeType) = 2. Would it make sense to have a method for Base.ndims …

---

## [Multiple windows in Visual Studio Code](https://discourse.julialang.org/t/multiple-windows-in-visual-studio-code/91301)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 1:56pm UTC](https://discourse.julialang.org/t/multiple-windows-in-visual-studio-code/91301 "2022-12-06T13:56:28Z")

</div>

I have two questions regarding Julia packages: if I run some Julia program during which several packages are precompiled, leave Visual Code, and return to it a month later, is there any reason precompilation should oc…

---

## [\`Core.Box\` around captured variable](https://discourse.julialang.org/t/core-box-around-captured-variable/91299)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 2\
**Last updated:** [December 6, 2022, 1:24pm UTC](https://discourse.julialang.org/t/core-box-around-captured-variable/91299 "2022-12-06T13:24:33Z")

</div>

If I define a variable inside an outer function that generates a closure, this variable gets boxed inside the closer. Does this affect performance and if yes, how do I best avoid it? Here is a simple MWE: julia\> functi…

---

## [Using Julia package which is calling C library?](https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172)

<div class="topic-metadata">

**Author:** [@tienviitta](https://discourse.julialang.org/u/tienviitta)\
**Replies:** 3\
**Last updated:** [December 6, 2022, 1:13pm UTC](https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172 "2022-12-06T13:13:43Z")

</div>

Hello fellow Julians, We have a FEC C-library and a Julia wrapper as Julia module/package for it build and now there is of course a need to use this amazing piece of error correcting software. I can compile the C-librar…

---

## [Is it possible to set a floating point precision while evaluating jldoctest blocks in docstrings?](https://discourse.julialang.org/t/is-it-possible-to-set-a-floating-point-precision-while-evaluating-jldoctest-blocks-in-docstrings/59528)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 5\
**Last updated:** [December 6, 2022, 12:31pm UTC](https://discourse.julialang.org/t/is-it-possible-to-set-a-floating-point-precision-while-evaluating-jldoctest-blocks-in-docstrings/59528 "2022-12-06T12:31:23Z")

</div>

I’m not too familiar with Documenter, so this might have a solution that I’m not aware of. Is it possible to set a filter to compare only the first n digits of floating-point numbers in a jldoctest block? Either of a glo…

---

## [Emacs-based workflow](https://discourse.julialang.org/t/emacs-based-workflow/19400)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 97\
**Last updated:** [December 5, 2022, 1:24pm UTC](https://discourse.julialang.org/t/emacs-based-workflow/19400 "2022-12-05T13:24:09Z")

</div>

I’m trying to set-up an (efficient) Emacs-based workflow to develop Julia code (on a linux system). Currently, here is what I’m using: I have a live Julia REPL in an ansi-term buffer, which uses Revise to update the …

---

## [Read file directly into Vector{Char}](https://discourse.julialang.org/t/read-file-directly-into-vector-char/91292)

<div class="topic-metadata">

**Author:** [@torrance](https://discourse.julialang.org/u/torrance)\
**Replies:** 14\
**Last updated:** [December 6, 2022, 10:25am UTC](https://discourse.julialang.org/t/read-file-directly-into-vector-char/91292 "2022-12-06T10:25:39Z")

</div>

I want to read a UTF8 encoded file into Vector{Char}. One way to do this is: data = collect(Char, read("input.txt")) However, this will perform a copy, first reading in the contents of the file, and then copying it ou…

---

## [Agents.jl: Equivalent of nearby\_agents for grid cells?](https://discourse.julialang.org/t/agents-jl-equivalent-of-nearby-agents-for-grid-cells/91290)

<div class="topic-metadata">

**Author:** [@sea\_slug](https://discourse.julialang.org/u/sea_slug)\
**Replies:** 3\
**Last updated:** [December 6, 2022, 10:20am UTC](https://discourse.julialang.org/t/agents-jl-equivalent-of-nearby-agents-for-grid-cells/91290 "2022-12-06T10:20:32Z")

</div>

Mandatory I’m brand new to Julia and Agents.jl so apologies if this is obvious. I am making a predator-prey model, following the wolf-sheep example. My GridSpace has a property “grass”. In the example predator-prey mod…

---

## [Problem with rounding with big numbers](https://discourse.julialang.org/t/problem-with-rounding-with-big-numbers/4454)

<div class="topic-metadata">

**Author:** [@jgk99](https://discourse.julialang.org/u/jgk99)\
**Replies:** 2\
**Last updated:** [December 6, 2022, 10:05am UTC](https://discourse.julialang.org/t/problem-with-rounding-with-big-numbers/4454 "2022-12-06T10:05:41Z")

</div>

BigInt(big(2017.)^2017) does not generate the correct value which is generated by: big(2017)^2017. Why is their a rounding error with BigFloat?

---

## [Upgrade to Julia 1.7 in Linux](https://discourse.julialang.org/t/upgrade-to-julia-1-7-in-linux/72358)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 3\
**Last updated:** [December 6, 2022, 9:52am UTC](https://discourse.julialang.org/t/upgrade-to-julia-1-7-in-linux/72358 "2022-12-06T09:52:23Z")

</div>

Hello, this is probably a redundant question, but what is the easiest and more comprehensive way to upgrade Julia in Linux? I say ‘easiest’ because the way I was doing was to literally change the folder where I store J…

---

## [Generalization of the Turing Bayesian logistic regression example](https://discourse.julialang.org/t/generalization-of-the-turing-bayesian-logistic-regression-example/91257)

<div class="topic-metadata">

**Author:** [@lgmendes](https://discourse.julialang.org/u/lgmendes)\
**Replies:** 1\
**Last updated:** [December 6, 2022, 8:34am UTC](https://discourse.julialang.org/t/generalization-of-the-turing-bayesian-logistic-regression-example/91257 "2022-12-06T08:34:43Z")

</div>

How to generalize the example of the Bayesian logistic regression \[turning\] for programmatically accepting input data with a different number of features, similar to what is possible in the Multinomial logistic regressio…

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

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