# Latest

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

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

**Page:** 1550

---

## [MethodError: no method matching \_parse\_NL\_expr\_runtime (Bilevel problem)](https://discourse.julialang.org/t/methoderror-no-method-matching-parse-nl-expr-runtime-bilevel-problem/51681)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 2\
**Last updated:** [December 12, 2020, 3:44am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-parse-nl-expr-runtime-bilevel-problem/51681 "2020-12-12T03:44:50Z")

</div>

I am trying to solve a bilevel problem using the BilevelJuMP package. However, I get the following error on execution: MethodError: no method matching \_parse\_NL\_expr\_runtime(::BilevelJuMP.UpperModel, ::Int64, ::Array{JuM…

---

## [How to index a JuMP variable during optimization](https://discourse.julialang.org/t/how-to-index-a-jump-variable-during-optimization/51658)

<div class="topic-metadata">

**Author:** [@prit](https://discourse.julialang.org/u/prit)\
**Replies:** 3\
**Last updated:** [December 12, 2020, 2:48am UTC](https://discourse.julialang.org/t/how-to-index-a-jump-variable-during-optimization/51658 "2020-12-12T02:48:39Z")

</div>

I have an undetermined (K) number of optimization problems to solve, and so far I have the following code to solve the K optimization problems. using JuMP using MosekTools m = Model(optimizer\_with\_attributes(Mosek.Optim…

---

## [Please help understand |\> operator](https://discourse.julialang.org/t/please-help-understand-operator/51700)

<div class="topic-metadata">

**Author:** [@asyrov](https://discourse.julialang.org/u/asyrov)\
**Replies:** 1\
**Last updated:** [December 12, 2020, 2:14am UTC](https://discourse.julialang.org/t/please-help-understand-operator/51700 "2020-12-12T02:14:11Z")

</div>

I tried to locate it in documentation, but could not. Can anyone please explain how this “|\> gpu” or “|\> cpu” works? Is this |\> an operator? Here is example of the code: m = Chain( Conv((5,5), 3=\>16, relu), MaxPool…

---

## [Error when installing RDatasets and DataFrames packages](https://discourse.julialang.org/t/error-when-installing-rdatasets-and-dataframes-packages/51692)

<div class="topic-metadata">

**Author:** [@Abdou](https://discourse.julialang.org/u/Abdou)\
**Replies:** 6\
**Last updated:** [December 12, 2020, 1:12am UTC](https://discourse.julialang.org/t/error-when-installing-rdatasets-and-dataframes-packages/51692 "2020-12-12T01:12:21Z")

</div>

I m new in Julia, when installing RDatasets and DataFrames packages I get an error from GitHub server. Is there any solution for this? Thanks (excuse my little english)

---

## [PyMC Models to Turing.jl](https://discourse.julialang.org/t/pymc-models-to-turing-jl/51574)

<div class="topic-metadata">

**Author:** [@Stefan\_Bringuier](https://discourse.julialang.org/u/Stefan_Bringuier)\
**Replies:** 5\
**Last updated:** [December 11, 2020, 9:45pm UTC](https://discourse.julialang.org/t/pymc-models-to-turing-jl/51574 "2020-12-11T21:45:14Z")

</div>

I’m learning (beginner) some Bayesian methods from books like Bayesian Methods for Hackers, C. Davidson-Pilon and Bayesian Analysis with Python. However, I prefer to do most of my workflows using Julia and I would like t…

---

## [Zygote vs Jax performance example](https://discourse.julialang.org/t/zygote-vs-jax-performance-example/51300)

<div class="topic-metadata">

**Author:** [@maxfreu](https://discourse.julialang.org/u/maxfreu)\
**Replies:** 14\
**Last updated:** [December 11, 2020, 9:02pm UTC](https://discourse.julialang.org/t/zygote-vs-jax-performance-example/51300 "2020-12-11T21:02:48Z")

</div>

Hi, it’s Saturday and I somehow had a Jax tab open in my browser, so I decided to compare it against Zygote using their third derivative of tanh example: # jax cpu v0.1.57 from jax.numpy import tanh from jax import grad…

---

## [Struct cross dependency](https://discourse.julialang.org/t/struct-cross-dependency/51680)

<div class="topic-metadata">

**Author:** [@Ronneesley](https://discourse.julialang.org/u/Ronneesley)\
**Replies:** 2\
**Last updated:** [December 11, 2020, 8:22pm UTC](https://discourse.julialang.org/t/struct-cross-dependency/51680 "2020-12-11T20:22:41Z")

</div>

Hello, There is something new about struct cross dependency? mutable struct Father child::Child end mutable struct Child father::Father end

---

## [Macro to write function with many conditionals](https://discourse.julialang.org/t/macro-to-write-function-with-many-conditionals/51616)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 9\
**Last updated:** [December 11, 2020, 6:11pm UTC](https://discourse.julialang.org/t/macro-to-write-function-with-many-conditionals/51616 "2020-12-11T18:11:47Z")

</div>

The minimum working case would be: Let say I have a vector of mixed types: x = \[ isodd(i) ? rand(Int64) : rand(Float64) for i in 1:1000 \] I want to sum these numbers, with: function mysum(x) s = 0. for val in x …

---

## [Again on closures and type instability](https://discourse.julialang.org/t/again-on-closures-and-type-instability/51664)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [December 11, 2020, 6:10pm UTC](https://discourse.julialang.org/t/again-on-closures-and-type-instability/51664 "2020-12-11T18:10:58Z")

</div>

Consider the simple functions: inner(x,a) = a\*x outer(f,x) = f(x) If one calls outer using a closure and global, non-constant parameter a , we have a type-instability: julia\> a = 5; x = 2; julia\> @code\_warntype outer…

---

## [How to force variable to zero upon meeting condition in Julia DifferentialEquations](https://discourse.julialang.org/t/how-to-force-variable-to-zero-upon-meeting-condition-in-julia-differentialequations/51655)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 19\
**Last updated:** [December 11, 2020, 5:54pm UTC](https://discourse.julialang.org/t/how-to-force-variable-to-zero-upon-meeting-condition-in-julia-differentialequations/51655 "2020-12-11T17:54:52Z")

</div>

Hello, I have this model of bacteria and phage interactions: using DifferentialEquations function payneJansenODE!(du, u, p, t) μ , φ, η, β, ω = p H = h = 0 du\[1\] = (μ \* u\[1\]) - (φ \* u\[1\] \* u\[3\]) - (H \* u\[1\]…

---

## [How does Julia dispatch on concrete methods?](https://discourse.julialang.org/t/how-does-julia-dispatch-on-concrete-methods/51647)

<div class="topic-metadata">

**Author:** [@eschoute](https://discourse.julialang.org/u/eschoute)\
**Replies:** 3\
**Last updated:** [December 11, 2020, 5:48pm UTC](https://discourse.julialang.org/t/how-does-julia-dispatch-on-concrete-methods/51647 "2020-12-11T17:48:30Z")

</div>

Hi all, I’m trying to understand how Julia figures out what functions to call when we implement an interface from say a library (or from some other module). That library has some functions that then are able to call the…

---

## [\[ANN\] ProfileSVG v0.2.0](https://discourse.julialang.org/t/ann-profilesvg-v0-2-0/51657)

<div class="topic-metadata">

**Author:** [@kimikage](https://discourse.julialang.org/u/kimikage)\
**Replies:** 5\
**Last updated:** [December 11, 2020, 3:12pm UTC](https://discourse.julialang.org/t/ann-profilesvg-v0-2-0/51657 "2020-12-11T15:12:19Z")

</div>

Dear all, I am pleased to announce the release of ProfileSVG v0.2.0. At JuliaCon 2020, held after the release of ProfileSVG v0.1.3, there were talks on VS Code, Pluto.jl etc., which had a significant impact on the Juli…

---

## [Apple silicon](https://discourse.julialang.org/t/apple-silicon/49980)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 7\
**Last updated:** [December 11, 2020, 3:07pm UTC](https://discourse.julialang.org/t/apple-silicon/49980 "2020-12-11T15:07:49Z")

</div>

finally Apple silicon Mac is available. Seems like it could be an ideal all-in-one solution that includes CPU + GPU + ML cores. It also explains why Apple has been so “strange” in the past several years dealing with Nvid…

---

## [Configure DataFrame show](https://discourse.julialang.org/t/configure-dataframe-show/51593)

<div class="topic-metadata">

**Author:** [@altre](https://discourse.julialang.org/u/altre)\
**Replies:** 5\
**Last updated:** [December 11, 2020, 2:38pm UTC](https://discourse.julialang.org/t/configure-dataframe-show/51593 "2020-12-11T14:38:15Z")

</div>

I need a way to configure the show method of DataFrames.jl. I have in the past hacked the show method for the DataFrames type using internal DataFrames API. But of course this breaks when an update comes along. What I …

---

## [Several contour plots in one 3d plot](https://discourse.julialang.org/t/several-contour-plots-in-one-3d-plot/50986)

<div class="topic-metadata">

**Author:** [@Flausi](https://discourse.julialang.org/u/Flausi)\
**Replies:** 5\
**Last updated:** [December 11, 2020, 2:35pm UTC](https://discourse.julialang.org/t/several-contour-plots-in-one-3d-plot/50986 "2020-12-11T14:35:14Z")

</div>

Hello, is there a possibility in Julia to combine several contour plots into one 3D plot like in the picture? I have tried a little bit with GLMike, but did not get it. I would be very happy if there is a solution.

---

## [Nested struct or something else?](https://discourse.julialang.org/t/nested-struct-or-something-else/51604)

<div class="topic-metadata">

**Author:** [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Replies:** 4\
**Last updated:** [December 10, 2020, 10:22pm UTC](https://discourse.julialang.org/t/nested-struct-or-something-else/51604 "2020-12-10T22:22:00Z")

</div>

In a certain program, I need to cater with a model M :=(omega, eos), where omega:=(omega\_1,... omega\_P) and eos:=(eos\_1,..., eos\_Q) are “lists” of P and Q real parameters, with P known in advance (at compile time), but Q…

---

## [Getting linear indices from two vectors containing x and y components of Cartesian coordinates (sub2ind versus LinearIndices())](https://discourse.julialang.org/t/getting-linear-indices-from-two-vectors-containing-x-and-y-components-of-cartesian-coordinates-sub2ind-versus-linearindices/51620)

<div class="topic-metadata">

**Author:** [@ajsc4](https://discourse.julialang.org/u/ajsc4)\
**Replies:** 3\
**Last updated:** [December 11, 2020, 2:25pm UTC](https://discourse.julialang.org/t/getting-linear-indices-from-two-vectors-containing-x-and-y-components-of-cartesian-coordinates-sub2ind-versus-linearindices/51620 "2020-12-11T14:25:20Z")

</div>

I have some matlab code that uses the old sub2ind way of getting the linear indices (this is a simplified version that gets at the essence of it): row = \[1, 2, 3\]; # x-component of cartesian index column = \[1, 2, 3\]; # …

---

## [Reversing order of \`prod(itr)\`](https://discourse.julialang.org/t/reversing-order-of-prod-itr/51613)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 7\
**Last updated:** [December 11, 2020, 1:23pm UTC](https://discourse.julialang.org/t/reversing-order-of-prod-itr/51613 "2020-12-11T13:23:27Z")

</div>

Is there a way to make the product built by prod(itr) from right to left instead from left to right? So I want julia\> prod("$i" for i in \[1,2,3\]) == "123" instead of julia\> prod("$i" for i in \[1,2,3\]) == "321" ? Not…

---

## [Ensure Julia is used to its full power](https://discourse.julialang.org/t/ensure-julia-is-used-to-its-full-power/51155)

<div class="topic-metadata">

**Author:** [@Undercover](https://discourse.julialang.org/u/Undercover)\
**Replies:** 100\
**Last updated:** [December 11, 2020, 12:15pm UTC](https://discourse.julialang.org/t/ensure-julia-is-used-to-its-full-power/51155 "2020-12-11T12:15:27Z")

</div>

Hi there, Just as a small background: I’m studying theoretical physics, which also includes a lot of computer simulations, from fluid dynamics, particle physics or cosmology, and from my experience after asking people f…

---

## [@threads for loop performance](https://discourse.julialang.org/t/threads-for-loop-performance/51641)

<div class="topic-metadata">

**Author:** [@ankit13](https://discourse.julialang.org/u/ankit13)\
**Replies:** 6\
**Last updated:** [December 11, 2020, 11:57am UTC](https://discourse.julialang.org/t/threads-for-loop-performance/51641 "2020-12-11T11:57:54Z")

</div>

Hi all, Why my code is running slower when I use more number of threads in @threads for loop? I would like to know, if this is a standard behavior for threaded parallelization? This is a sample code that will reprodu…

---

## [Understanding how to implement numbers in Julia](https://discourse.julialang.org/t/understanding-how-to-implement-numbers-in-julia/51643)

<div class="topic-metadata">

**Author:** [@minetest2048](https://discourse.julialang.org/u/minetest2048)\
**Replies:** 4\
**Last updated:** [December 11, 2020, 11:55am UTC](https://discourse.julialang.org/t/understanding-how-to-implement-numbers-in-julia/51643 "2020-12-11T11:55:38Z")

</div>

To understand how to implement a number in Julia, I tried to implement my own complex number type: struct MyComplex{T\<:Real} \<: Number real::T imag::T end MyComplex(re::Real) = MyComplex(re,zero(re)) Base.conj…

---

## [Julia hanging (/pausing indefinitely) on package build of MbedTLS and others](https://discourse.julialang.org/t/julia-hanging-pausing-indefinitely-on-package-build-of-mbedtls-and-others/11316)

<div class="topic-metadata">

**Author:** [@Ian\_Williamson](https://discourse.julialang.org/u/Ian_Williamson)\
**Replies:** 2\
**Last updated:** [December 11, 2020, 10:42am UTC](https://discourse.julialang.org/t/julia-hanging-pausing-indefinitely-on-package-build-of-mbedtls-and-others/11316 "2020-12-11T10:42:06Z")

</div>

I am having a very strange issue on Windows 10. Whenever the Julia package manager needs to build the MbedTLS package it hangs (or pauses indefinitely) at INFO: Building MbedTLS Opening task manager shows now CPU usage…

---

## [How to use EnsembleDistributed() in DifferentialEquations.jl](https://discourse.julialang.org/t/how-to-use-ensembledistributed-in-differentialequations-jl/51642)

<div class="topic-metadata">

**Author:** [@jmmm](https://discourse.julialang.org/u/jmmm)\
**Replies:** 2\
**Last updated:** [December 11, 2020, 10:07am UTC](https://discourse.julialang.org/t/how-to-use-ensembledistributed-in-differentialequations-jl/51642 "2020-12-11T10:07:48Z")

</div>

I was following a tutorial in Stochastic Differential Equations · DifferentialEquations.jl (sciml.ai) and tried to modify it to use EnsembleDistributed() to speed up MC simulations. This is from the tutorial: using Dif…

---

## [Multiple dispatch with Union of parametric types](https://discourse.julialang.org/t/multiple-dispatch-with-union-of-parametric-types/51656)

<div class="topic-metadata">

**Author:** [@xyz1](https://discourse.julialang.org/u/xyz1)\
**Replies:** 1\
**Last updated:** [December 11, 2020, 10:01am UTC](https://discourse.julialang.org/t/multiple-dispatch-with-union-of-parametric-types/51656 "2020-12-11T10:01:16Z")

</div>

Hi, I have a problem with multidispatch. I have a lot of functions defined that take 2 parameters a and b. These may be a vector and a dict, a dict and an int etc. Or e.g. Union{Any, Vector}. It all seemed to work well …

---

## [The objective function is not supported by JuMP](https://discourse.julialang.org/t/the-objective-function-is-not-supported-by-jump/51652)

<div class="topic-metadata">

**Author:** [@prit](https://discourse.julialang.org/u/prit)\
**Replies:** 7\
**Last updated:** [December 11, 2020, 9:51am UTC](https://discourse.julialang.org/t/the-objective-function-is-not-supported-by-jump/51652 "2020-12-11T09:51:37Z")

</div>

How to optimize a function in jump that contains an array in the objective function? I have the following constraint optimization problem in jump: m = Model(optimizer\_with\_attributes(Mosek.Optimizer, "QUIET" =\> false, …

---

## [How can I use optim.jl to find some values](https://discourse.julialang.org/t/how-can-i-use-optim-jl-to-find-some-values/51317)

<div class="topic-metadata">

**Author:** [@Lucas\_Pollito](https://discourse.julialang.org/u/Lucas_Pollito)\
**Replies:** 15\
**Last updated:** [December 11, 2020, 5:33am UTC](https://discourse.julialang.org/t/how-can-i-use-optim-jl-to-find-some-values/51317 "2020-12-11T05:33:31Z")

</div>

I have some working code that i cant optmization to find some x\[1\] x\[2\] x\[3\] x\[4\] constants. A link for all the code is: https://drive.google.com/drive/folders/11cqtyUnWAoAYWdWyWOd6fbu4TVejbBlM?usp=sharing aRe = \[1.…

---

## [Meaning of "Overhead" column in Profile](https://discourse.julialang.org/t/meaning-of-overhead-column-in-profile/51648)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 0\
**Last updated:** [December 11, 2020, 4:54am UTC](https://discourse.julialang.org/t/meaning-of-overhead-column-in-profile/51648 "2020-12-11T04:54:59Z")

</div>

The first two lines in the output of Profile.print() are Overhead ╎ \[+additional indent\] Count File:Line; Function ========================================================= \[Profiling data\] What does the Overhead colum…

---

## [Reading data of different types from a data file with multiple lines and headers for each line](https://discourse.julialang.org/t/reading-data-of-different-types-from-a-data-file-with-multiple-lines-and-headers-for-each-line/51376)

<div class="topic-metadata">

**Author:** [@Peter-Jolly](https://discourse.julialang.org/u/Peter-Jolly)\
**Replies:** 30\
**Last updated:** [December 11, 2020, 3:43am UTC](https://discourse.julialang.org/t/reading-data-of-different-types-from-a-data-file-with-multiple-lines-and-headers-for-each-line/51376 "2020-12-11T03:43:55Z")

</div>

Hi, I have the following text file of multiple lines(this is just a small sample of about 100 lines of data that I need to read). Note following; Each line of of data has a header, separated by a comma (I have left …

---

## [Solving dynamic complementarity problem using Optim.jl or Complementarity.jl](https://discourse.julialang.org/t/solving-dynamic-complementarity-problem-using-optim-jl-or-complementarity-jl/51498)

<div class="topic-metadata">

**Author:** [@jovansam](https://discourse.julialang.org/u/jovansam)\
**Replies:** 3\
**Last updated:** [December 11, 2020, 2:13am UTC](https://discourse.julialang.org/t/solving-dynamic-complementarity-problem-using-optim-jl-or-complementarity-jl/51498 "2020-12-11T02:13:20Z")

</div>

I am interested in solving a dynamic complementarity problem using Complementarity.jl or Optim.jl. In particular I would appreciate some assistance in solving or how I could solve the following. A - B\*q\[t\] = λ\[t\] …

---

## [Reduce vs splat with intersect() function performance](https://discourse.julialang.org/t/reduce-vs-splat-with-intersect-function-performance/51583)

<div class="topic-metadata">

**Author:** [@rapasite](https://discourse.julialang.org/u/rapasite)\
**Replies:** 1\
**Last updated:** [December 11, 2020, 1:08am UTC](https://discourse.julialang.org/t/reduce-vs-splat-with-intersect-function-performance/51583 "2020-12-11T01:08:20Z")

</div>

Hi. Just trying to understand why the first sum is faster than the second. using BenchmarkTools const data=raw"C:\\text.txt" |\> read |\> String |\> x-\>split(x,r"\\r\\n\\r\\n|\\n\\n") .|\> y-\>split(y,r"\\r\\n|\\r|\\n") @btime sum(le…

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

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