# Latest

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

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

**Page:** 956

---

## [How to define \`promote\_rule\` without including \`Union{}\` as an argument?](https://discourse.julialang.org/t/how-to-define-promote-rule-without-including-union-as-an-argument/85609)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [August 11, 2022, 8:54am UTC](https://discourse.julialang.org/t/how-to-define-promote-rule-without-including-union-as-an-argument/85609 "2022-08-11T08:54:28Z")

</div>

E.g., while using Polynomials.jl, julia\> @which promote\_rule(Polynomial{Int}, Union{}) promote\_rule(::Type{\<:AbstractPolynomial{T}}, ::Type{\<:AbstractPolynomial{S}}) where {T, S} @ Polynomials ~/Dropbox/JuliaPackag…

---

## [How to combine prettytables and pager?](https://discourse.julialang.org/t/how-to-combine-prettytables-and-pager/85593)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [August 11, 2022, 7:44am UTC](https://discourse.julialang.org/t/how-to-combine-prettytables-and-pager/85593 "2022-08-11T07:44:11Z")

</div>

When using prettytables I have a lot of keyword options that I can use to display a pretty table. With the function pager from TerminalPager I can browse through a dataset that does not fit on the screen. How can I combi…

---

## [Any faster way of computing small gradients?](https://discourse.julialang.org/t/any-faster-way-of-computing-small-gradients/85531)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 21\
**Last updated:** [August 11, 2022, 7:21am UTC](https://discourse.julialang.org/t/any-faster-way-of-computing-small-gradients/85531 "2022-08-11T07:21:52Z")

</div>

I’ve tested multiple packages to compute the gradient of a log-likelihood (huge sum of the same function applied to different data points): const AV = AbstractVector{T} where T normal\_pdf(x::Real, mean::Real, var::Real…

---

## [Dictionary - inverse and consolidating](https://discourse.julialang.org/t/dictionary-inverse-and-consolidating/42378)

<div class="topic-metadata">

**Author:** [@Orr\_Orovan](https://discourse.julialang.org/u/Orr_Orovan)\
**Replies:** 9\
**Last updated:** [August 11, 2022, 3:40am UTC](https://discourse.julialang.org/t/dictionary-inverse-and-consolidating/42378 "2022-08-11T03:40:58Z")

</div>

I have found this solution in Python and want to write in Julia something that will yield the same end result. It inverses the keys and values in a dictionary and consolidate the values in the inverse dictionary into li…

---

## [How to run many copies of a random function in parallel on GPU?](https://discourse.julialang.org/t/how-to-run-many-copies-of-a-random-function-in-parallel-on-gpu/85602)

<div class="topic-metadata">

**Author:** [@GeekyPeas](https://discourse.julialang.org/u/GeekyPeas)\
**Replies:** 5\
**Last updated:** [August 11, 2022, 7:02am UTC](https://discourse.julialang.org/t/how-to-run-many-copies-of-a-random-function-in-parallel-on-gpu/85602 "2022-08-11T07:02:25Z")

</div>

Consider this “embarrassingly parallel” and fairly general problem: You have a random function f (such as a random number generator, or a sampling procedure, or a run of a Markov Chain, or a Jump Process) that is imple…

---

## [Access field of custom struct by user-provided name](https://discourse.julialang.org/t/access-field-of-custom-struct-by-user-provided-name/85546)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 10\
**Last updated:** [August 11, 2022, 6:03am UTC](https://discourse.julialang.org/t/access-field-of-custom-struct-by-user-provided-name/85546 "2022-08-11T06:03:41Z")

</div>

Suppose I want a struct that has to store a variable which can be quite general. Most typically, it will contain an array of forces, or alternatively an energy value. Something like: struct System{T} property::T end…

---

## [Is there a Julia Latex "symbol"? So Latex in Latex is \`\\LaTeX{}\`, is there somethi](https://discourse.julialang.org/t/is-there-a-julia-latex-symbol-so-latex-in-latex-is-latex-is-there-somethi/54703)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 15\
**Last updated:** [August 11, 2022, 2:58am UTC](https://discourse.julialang.org/t/is-there-a-julia-latex-symbol-so-latex-in-latex-is-latex-is-there-somethi/54703 "2022-08-11T02:58:57Z")

</div>

Is there a Julia Latex “symbol”? So Latex in Latex is \\LaTeX{}, is there something like \\Julia{} (presumably after \\usepackage{juliasymbols} or something)? Note that the original poster on Slack cannot see your response…

---

## [Each successive run of JuMP in VS Code gets slower](https://discourse.julialang.org/t/each-successive-run-of-jump-in-vs-code-gets-slower/85497)

<div class="topic-metadata">

**Author:** [@Anjinsan](https://discourse.julialang.org/u/Anjinsan)\
**Replies:** 2\
**Last updated:** [August 11, 2022, 1:16am UTC](https://discourse.julialang.org/t/each-successive-run-of-jump-in-vs-code-gets-slower/85497 "2022-08-11T01:16:57Z")

</div>

While using VS Code to run a Julia (JuMP) optimization model (using Gurobi for the optimization), I’ve noticed that each subsequent run I do of the program (even if I make no changes in it) takes longer. The run times f…

---

## [How is \`x::T\` lowered? (the actual post)](https://discourse.julialang.org/t/how-is-x-t-lowered-the-actual-post/85590)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 4\
**Last updated:** [August 10, 2022, 11:52pm UTC](https://discourse.julialang.org/t/how-is-x-t-lowered-the-actual-post/85590 "2022-08-10T23:52:28Z")

</div>

I’d like to understand what the compiler does with code like function f(x) local y :: typeof(x) y = x end The docstring for typeassert says “The syntax x::type calls this function.”. But this isn’t just a simpl…

---

## [Why do some Flux models train in parallel but not others?](https://discourse.julialang.org/t/why-do-some-flux-models-train-in-parallel-but-not-others/85453)

<div class="topic-metadata">

**Author:** [@Lewis\_Hein](https://discourse.julialang.org/u/Lewis_Hein)\
**Replies:** 16\
**Last updated:** [August 10, 2022, 11:50pm UTC](https://discourse.julialang.org/t/why-do-some-flux-models-train-in-parallel-but-not-others/85453 "2022-08-10T23:50:55Z")

</div>

Why does training this model use as many CPUs as I ask it to: Chain( Conv((5, 5), imgsize\[end\]=\>6, relu), MaxPool((2, 2)), Conv((5, 5), 6=\>16, relu), MaxPool((2, 2)),…

---

## [\[ANN\] JuliaEpi: Collaborative Computational Epidemiology in Julia](https://discourse.julialang.org/t/ann-juliaepi-collaborative-computational-epidemiology-in-julia/85131)

<div class="topic-metadata">

**Author:** [@InPhyT](https://discourse.julialang.org/u/InPhyT)\
**Replies:** 4\
**Last updated:** [August 10, 2022, 9:38pm UTC](https://discourse.julialang.org/t/ann-juliaepi-collaborative-computational-epidemiology-in-julia/85131 "2022-08-10T21:38:27Z")

</div>

We’re building an open research community called JuliaEpi to develop an epidemiological modelling ecosystem written in Julia for the design, management, wrangling and quality assessment of multiple data types and sources…

---

## [Julia better rewritten in rust?](https://discourse.julialang.org/t/julia-better-rewritten-in-rust/84151)

<div class="topic-metadata">

**Author:** [@Yebjhar\_Wulden](https://discourse.julialang.org/u/Yebjhar_Wulden)\
**Replies:** 17\
**Last updated:** [August 3, 2022, 12:33pm UTC](https://discourse.julialang.org/t/julia-better-rewritten-in-rust/84151 "2022-08-03T12:33:53Z")

</div>

seeing the julia code is actually wrtten in c++, scheme, c and mainly julia so comes a question to my mind what if the c++/c code were rewritten in rust? or haskell basically any memory-safe good-performance language? …

---

## [Python porting to Julia resources](https://discourse.julialang.org/t/python-porting-to-julia-resources/31953)

<div class="topic-metadata">

**Author:** [@vphom](https://discourse.julialang.org/u/vphom)\
**Replies:** 28\
**Last updated:** [August 10, 2022, 8:41pm UTC](https://discourse.julialang.org/t/python-porting-to-julia-resources/31953 "2022-08-10T20:41:56Z")

</div>

I’m trying to port an Machine Learning app that was written in Python using Pytorch to Julia and I’m a newbie in Julia. Is there a resource,cheat sheet that show how the same thing work in Julia for examples Python …

---

## [Is there a good way to run an interpreted IJulia session?](https://discourse.julialang.org/t/is-there-a-good-way-to-run-an-interpreted-ijulia-session/85554)

<div class="topic-metadata">

**Author:** [@kjohnsen](https://discourse.julialang.org/u/kjohnsen)\
**Replies:** 4\
**Last updated:** [August 10, 2022, 8:25pm UTC](https://discourse.julialang.org/t/is-there-a-good-way-to-run-an-interpreted-ijulia-session/85554 "2022-08-10T20:25:51Z")

</div>

Hello all, I know about JuliaInterpreter and things like Revise to avoid recompilation for package development and DaemonMode to achieve a similar end for script development, but a use case where time-to-first-plot has …

---

## [Julia type displaying change between versions](https://discourse.julialang.org/t/julia-type-displaying-change-between-versions/85029)

<div class="topic-metadata">

**Author:** [@Schneeschaufel](https://discourse.julialang.org/u/Schneeschaufel)\
**Replies:** 48\
**Last updated:** [August 2, 2022, 5:01pm UTC](https://discourse.julialang.org/t/julia-type-displaying-change-between-versions/85029 "2022-08-02T17:01:30Z")

</div>

It is kind of annoying: I saw this on the internet: julia\> Array(ones(2,2)) 2×2 Array{Float64,2}: 1.0 1.0 1.0 1.0 but when I do it in my terminal I get: julia\> Array(ones(2,2)) 2×2 Matrix{Float64}: 1.0 1.0 1.0…

---

## [Using TensorCast with JuliaPy](https://discourse.julialang.org/t/using-tensorcast-with-juliapy/85588)

<div class="topic-metadata">

**Author:** [@andrewkhardy](https://discourse.julialang.org/u/andrewkhardy)\
**Replies:** 0\
**Last updated:** [August 10, 2022, 2:33pm UTC](https://discourse.julialang.org/t/using-tensorcast-with-juliapy/85588 "2022-08-10T14:33:16Z")

</div>

I am getting a world age bug when running TensorCast in JuliaPy, but not when using it normally. If I run an example function such as function testfunc() V = \[10,20,30\] M = collect(reshape(1:12, 3,4)) @cast…

---

## [Why is it \`Inf\` and not \`inf\` if \`typeof(Inf) == Float64\`](https://discourse.julialang.org/t/why-is-it-inf-and-not-inf-if-typeof-inf-float64/85583)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 1\
**Last updated:** [August 10, 2022, 2:22pm UTC](https://discourse.julialang.org/t/why-is-it-inf-and-not-inf-if-typeof-inf-float64/85583 "2022-08-10T14:22:05Z")

</div>

I thought that the Julia style is to have Capitalized words for types and modules. —david

---

## [How can lazy constraints be written in a \*.lp file?](https://discourse.julialang.org/t/how-can-lazy-constraints-be-written-in-a-lp-file/85324)

<div class="topic-metadata">

**Author:** [@Somayeh\_Esmaeili](https://discourse.julialang.org/u/Somayeh_Esmaeili)\
**Replies:** 9\
**Last updated:** [August 10, 2022, 2:21pm UTC](https://discourse.julialang.org/t/how-can-lazy-constraints-be-written-in-a-lp-file/85324 "2022-08-10T14:21:17Z")

</div>

I need to convert the codes in \*.lp file. But the lazy constraints can not be converted. Would you please help me? Thanks very much using JuMP,CPLEX T=Model(solver=CplexSolver()); #Sets----------------------------------…

---

## [Approximating non-standard evaluation like in R, e.g. for plot labels](https://discourse.julialang.org/t/approximating-non-standard-evaluation-like-in-r-e-g-for-plot-labels/41889)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 15\
**Last updated:** [August 10, 2022, 1:55pm UTC](https://discourse.julialang.org/t/approximating-non-standard-evaluation-like-in-r-e-g-for-plot-labels/41889 "2022-08-10T13:55:39Z")

</div>

Sometimes I miss R’s functionality where expressions passed into plotting functions are used as label names. The non-standard evaluation part of it I find pretty confusing actually, i.e. that the expressions are not run …

---

## [Tullio Order of Operations](https://discourse.julialang.org/t/tullio-order-of-operations/85538)

<div class="topic-metadata">

**Author:** [@andrewkhardy](https://discourse.julialang.org/u/andrewkhardy)\
**Replies:** 5\
**Last updated:** [August 10, 2022, 1:38pm UTC](https://discourse.julialang.org/t/tullio-order-of-operations/85538 "2022-08-10T13:38:06Z")

</div>

I’m attempting to use Tullio to perform a sum over matrices and running into difficulty. I need to take the sum of inverses and instead am taking the inverse of sums. Is there a way to properly write order of operations,…

---

## [Can we reuse Dictionary allocation?](https://discourse.julialang.org/t/can-we-reuse-dictionary-allocation/85582)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 2\
**Last updated:** [August 10, 2022, 1:26pm UTC](https://discourse.julialang.org/t/can-we-reuse-dictionary-allocation/85582 "2022-08-10T13:26:22Z")

</div>

In our application we have to allocate over 20K dictionaries each having ~1M keys. Each of them is created in a for loop and since they are only used within the iteration garbage collection temporarily freezes the code w…

---

## [How to "unroll" getindexes to a Tuple parametrically?](https://discourse.julialang.org/t/how-to-unroll-getindexes-to-a-tuple-parametrically/83131)

<div class="topic-metadata">

**Author:** [@Daniel\_Gonzalez](https://discourse.julialang.org/u/Daniel_Gonzalez)\
**Replies:** 3\
**Last updated:** [August 10, 2022, 1:00pm UTC](https://discourse.julialang.org/t/how-to-unroll-getindexes-to-a-tuple-parametrically/83131 "2022-08-10T13:00:34Z")

</div>

Consider the following code: abstract type Op end struct Add{T} \<: Op foo::T end struct Mul{T} \<: Op foo::T end op(o::Add, value) = o.foo + value op(o::Mul, value) = o.foo \* value abstract type AbstractCalcu…

---

## [HTTP.jl: How to post a series of json strings over a live connection](https://discourse.julialang.org/t/http-jl-how-to-post-a-series-of-json-strings-over-a-live-connection/85572)

<div class="topic-metadata">

**Author:** [@mst](https://discourse.julialang.org/u/mst)\
**Replies:** 2\
**Last updated:** [August 10, 2022, 12:26pm UTC](https://discourse.julialang.org/t/http-jl-how-to-post-a-series-of-json-strings-over-a-live-connection/85572 "2022-08-10T12:26:04Z")

</div>

Hello, I have a vector v where each element is a valid json string: v = \[json1, json2, ..., jsonN\] using HTTP.jl, I open a connection to a url and post each json in v: for json ∈ v HTTP.post(url, headers, json) end…

---

## [Why doesn't method dispatch work on the same candidate included from different sources?](https://discourse.julialang.org/t/why-doesnt-method-dispatch-work-on-the-same-candidate-included-from-different-sources/85576)

<div class="topic-metadata">

**Author:** [@DiMeneses](https://discourse.julialang.org/u/DiMeneses)\
**Replies:** 15\
**Last updated:** [August 10, 2022, 11:28am UTC](https://discourse.julialang.org/t/why-doesnt-method-dispatch-work-on-the-same-candidate-included-from-different-sources/85576 "2022-08-10T11:28:16Z")

</div>

I originally made the question on SO but nobody could help. I have this error: ERROR: MethodError: no method matching correct\_field(::Main.Poetry.LoadTemplates.TicketTemplates.myStruct, ::Dict{String, Any}) Closest c…

---

## [Solving system of ode with Modeling Toolkit](https://discourse.julialang.org/t/solving-system-of-ode-with-modeling-toolkit/85524)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 3\
**Last updated:** [August 10, 2022, 10:08am UTC](https://discourse.julialang.org/t/solving-system-of-ode-with-modeling-toolkit/85524 "2022-08-10T10:08:45Z")

</div>

I solved this ode system with DifferentialEquations and got the correct result. I am trying with ModelingToolkit but I don’t get the correct result. What am I doing wrong? p₀, q₀ = 0.0, 3.0 @variables t @parameters P(…

---

## [Keybinding issue since v1.6.29](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550)

<div class="topic-metadata">

**Author:** [@MiguelAlonso](https://discourse.julialang.org/u/MiguelAlonso)\
**Replies:** 4\
**Last updated:** [August 10, 2022, 9:57am UTC](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550 "2022-08-10T09:57:41Z")

</div>

Hi, I’ve run into a weird behavior after updating to v1.6.30: I can’t change or delete the extension’s default binding of “Execute Code in REPL” (Ctrl+Enter). If I try to set a new binding, it is added to the default on…

---

## [Should \`convert\` include a type-assertion to ensure that the conversion succeeds?](https://discourse.julialang.org/t/should-convert-include-a-type-assertion-to-ensure-that-the-conversion-succeeds/85577)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [August 10, 2022, 9:41am UTC](https://discourse.julialang.org/t/should-convert-include-a-type-assertion-to-ensure-that-the-conversion-succeeds/85577 "2022-08-10T09:41:02Z")

</div>

For example, in badly inferred code, one may obtain julia\> @code\_warntype (x -\> convert(Int, x\[1\]))(Any\[1\]) MethodInstance for (::var"#3#4")(::Vector{Any}) from (::var"#3#4")(x) @ Main REPL\[5\]:1 Arguments #self#::…

---

## [How to add LaTeX Annotations for 3-d Plots (Backend GR and Pyplot)](https://discourse.julialang.org/t/how-to-add-latex-annotations-for-3-d-plots-backend-gr-and-pyplot/85473)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 4\
**Last updated:** [August 10, 2022, 9:20am UTC](https://discourse.julialang.org/t/how-to-add-latex-annotations-for-3-d-plots-backend-gr-and-pyplot/85473 "2022-08-10T09:20:35Z")

</div>

Hi all, I create this 3-d plot for vectors in 3-d, tried annotate!() and it does not work. Is it possible to add annotate? If possible, I want to add latex symbol like subscript. # Plot norm of a vector in 3-d using P…

---

## [Access variables in vector using Symbols](https://discourse.julialang.org/t/access-variables-in-vector-using-symbols/85432)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 7\
**Last updated:** [August 10, 2022, 9:17am UTC](https://discourse.julialang.org/t/access-variables-in-vector-using-symbols/85432 "2022-08-10T09:17:44Z")

</div>

I have a model with variables defined as a is below, I need to be able to access the models variables in a model agnostic way. For this I use Symbols as model\[:b\] will get me b for any model which has a variable b. How …

---

## [Computing the SVD of a LinearMap](https://discourse.julialang.org/t/computing-the-svd-of-a-linearmap/85534)

<div class="topic-metadata">

**Author:** [@AnshPatel7](https://discourse.julialang.org/u/AnshPatel7)\
**Replies:** 5\
**Last updated:** [August 10, 2022, 7:32am UTC](https://discourse.julialang.org/t/computing-the-svd-of-a-linearmap/85534 "2022-08-10T07:32:41Z")

</div>

I’m trying to compute the SVD of a LinearMap since a dense representation of the matrix would go out of memory. I tried using IterativeSolvers.svdl but it does not give me all of the singular values or the U matrix. Is t…

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

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