# Latest

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

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

**Page:** 1682

---

## [Is broadcast possible over ternary expressions?](https://discourse.julialang.org/t/is-broadcast-possible-over-ternary-expressions/43518)

<div class="topic-metadata">

**Author:** [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Replies:** 7\
**Last updated:** [July 23, 2020, 7:27pm UTC](https://discourse.julialang.org/t/is-broadcast-possible-over-ternary-expressions/43518 "2020-07-23T19:27:27Z")

</div>

I would love to be able to do something like the following: @. l \< u ? f!(x) : g!(x) I.e. \[li\<ui ? f!(xi) : g!(xi) for (li, ui, xi) in zip(l, u, x)\] However, expanding the first line, it’s clear that it won’t be equi…

---

## [Irregularity in array definition API](https://discourse.julialang.org/t/irregularity-in-array-definition-api/43573)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 4\
**Last updated:** [July 23, 2020, 7:18pm UTC](https://discourse.julialang.org/t/irregularity-in-array-definition-api/43573 "2020-07-23T19:18:03Z")

</div>

I can define an uninitialized array this way: a = Array{Int32, 2}(undef, 10, 10) but I can’t define an initialized array the same way: a = Array{Int32, 2}(42, 10, 10) I have to use this form instead: a = fill(Int32(…

---

## [Install CPLEX in Julia 1.4.2 32 bits](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564)

<div class="topic-metadata">

**Author:** [@Luis\_Tormo](https://discourse.julialang.org/u/Luis_Tormo)\
**Replies:** 5\
**Last updated:** [July 23, 2020, 6:43pm UTC](https://discourse.julialang.org/t/install-cplex-in-julia-1-4-2-32-bits/43564 "2020-07-23T18:43:05Z")

</div>

Do you know if there is any way to install CPLEX on Julia 1.4.2 32 bit? I know I need one of the latest versions of CPLEX in 32 bit. I tried to install CPLEX 12.6.3 32bit but it gave me a lot of problems and I didn’t get…

---

## [Error: Julia Package not part of your current environment](https://discourse.julialang.org/t/error-julia-package-not-part-of-your-current-environment/43572)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 5:56pm UTC](https://discourse.julialang.org/t/error-julia-package-not-part-of-your-current-environment/43572 "2020-07-23T17:56:19Z")

</div>

After upgrading Julia I get and error everytime I start it. I’m using Julia 1.5.0-rc1.0 (2020-06-26) VS Code 1.47.0 Julia Insider Extension 0.17.8 Window 10 x64 And my settings are: { "julia.executablePath"…

---

## [Will running Pkg.test compile all of the package functions? (for precompile\_execution\_file in PackageCompiler)](https://discourse.julialang.org/t/will-running-pkg-test-compile-all-of-the-package-functions-for-precompile-execution-file-in-packagecompiler/43571)

<div class="topic-metadata">

**Author:** [@vlandau](https://discourse.julialang.org/u/vlandau)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 5:46pm UTC](https://discourse.julialang.org/t/will-running-pkg-test-compile-all-of-the-package-functions-for-precompile-execution-file-in-packagecompiler/43571 "2020-07-23T17:46:05Z")

</div>

I’m developing a Docker image in which I want a specific package and its functions to be precompiled in the sysimage because precompilation takes quite a while. I’m using PackageCompiler to achieve this. I’m wondering, w…

---

## [Inferring loose container type based on elements that are added to it later?](https://discourse.julialang.org/t/inferring-loose-container-type-based-on-elements-that-are-added-to-it-later/43556)

<div class="topic-metadata">

**Author:** [@Benjia](https://discourse.julialang.org/u/Benjia)\
**Replies:** 10\
**Last updated:** [July 23, 2020, 5:39pm UTC](https://discourse.julialang.org/t/inferring-loose-container-type-based-on-elements-that-are-added-to-it-later/43556 "2020-07-23T17:39:15Z")

</div>

I often have functions that look like this, where I’m allocating some output vector and pushing some homogeneously typed objects onto it: julia\> function foo() out = \[\] push!(out, 1) ret…

---

## [Flux gradient not defined](https://discourse.julialang.org/t/flux-gradient-not-defined/43559)

<div class="topic-metadata">

**Author:** [@zazizoma](https://discourse.julialang.org/u/zazizoma)\
**Replies:** 8\
**Last updated:** [July 23, 2020, 5:34pm UTC](https://discourse.julialang.org/t/flux-gradient-not-defined/43559 "2020-07-23T17:34:17Z")

</div>

Hi, I’m attempting to build a basic perceptron using Flux, and starting with the tutorial code in the documentation here \[Gradients and Layers · Flux\]. Entering this code from the tutorial using Flux f(x) = 3x^2 + 2x…

---

## [How to Import dependency from one file to another inside of a package?](https://discourse.julialang.org/t/how-to-import-dependency-from-one-file-to-another-inside-of-a-package/42891)

<div class="topic-metadata">

**Author:** [@DataPsycho](https://discourse.julialang.org/u/DataPsycho)\
**Replies:** 8\
**Last updated:** [July 23, 2020, 4:18pm UTC](https://discourse.julialang.org/t/how-to-import-dependency-from-one-file-to-another-inside-of-a-package/42891 "2020-07-23T16:18:56Z")

</div>

Hi, I am writing a package in Julia. But can not figure it out how to import some particular function from one file to another. Here is the latest version of the package: https://github.com/DataPsycho/ProjectFlow.jl Let…

---

## [HTTP.jl how to paralelise HTTP.request](https://discourse.julialang.org/t/http-jl-how-to-paralelise-http-request/43569)

<div class="topic-metadata">

**Author:** [@sz1992](https://discourse.julialang.org/u/sz1992)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 5:18pm UTC](https://discourse.julialang.org/t/http-jl-how-to-paralelise-http-request/43569 "2020-07-23T17:18:48Z")

</div>

I have multiple RESTAPI workers (aprox 50). I am using HTTP POST to send data and wait for results. I would like to send all 50 request in paralell. I tried using @async and @spawn. With both approaches I came to limit i…

---

## [Generate Covariance Matrix with Pre-Specified Restrictions](https://discourse.julialang.org/t/generate-covariance-matrix-with-pre-specified-restrictions/43439)

<div class="topic-metadata">

**Author:** [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Replies:** 6\
**Last updated:** [July 23, 2020, 4:50pm UTC](https://discourse.julialang.org/t/generate-covariance-matrix-with-pre-specified-restrictions/43439 "2020-07-23T16:50:25Z")

</div>

I have a 3 by 3 matrix of random variables and I would like to generate the covariance matrix of these 9 random variables. The restrictions are as follows: \\begin{aligned} \\operatorname{Corr}\\left(b\_{u\_{1}, d\_{1}}, b\_{…

---

## [Apply boolean mask in loss function](https://discourse.julialang.org/t/apply-boolean-mask-in-loss-function/40374)

<div class="topic-metadata">

**Author:** [@dfenn](https://discourse.julialang.org/u/dfenn)\
**Replies:** 1\
**Last updated:** [July 23, 2020, 4:26pm UTC](https://discourse.julialang.org/t/apply-boolean-mask-in-loss-function/40374 "2020-07-23T16:26:15Z")

</div>

Is there a way to apply a boolean mask to the multidimensional arrays in a loss function using Flux? I’ve been unable to achieve this on the gpu. I’m using Julia 1.3 and Flux v0.10.4. Consider the following MWE (this is…

---

## [\[ANN(s)\] HalfSpectral.jl: a convenient interface for half-spectral covariance functions, and GPMaxlik.jl: trust-region based maximum likelihood estimation for Gaussian Processes](https://discourse.julialang.org/t/ann-s-halfspectral-jl-a-convenient-interface-for-half-spectral-covariance-functions-and-gpmaxlik-jl-trust-region-based-maximum-likelihood-estimation-for-gaussian-processes/43565)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 4:18pm UTC](https://discourse.julialang.org/t/ann-s-halfspectral-jl-a-convenient-interface-for-half-spectral-covariance-functions-and-gpmaxlik-jl-trust-region-based-maximum-likelihood-estimation-for-gaussian-processes/43565 "2020-07-23T16:18:13Z")

</div>

Hey all— Just a quick announcement of a couple little pieces of software that some of you may find useful or interesting. HalfSpectral.jl is a simple little package that implements half spectral covariance functions in…

---

## [Make\_pair equivalent in Julia?](https://discourse.julialang.org/t/make-pair-equivalent-in-julia/43562)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 3\
**Last updated:** [July 23, 2020, 4:04pm UTC](https://discourse.julialang.org/t/make-pair-equivalent-in-julia/43562 "2020-07-23T16:04:45Z")

</div>

Is there anything equivalent in Julia to do make\_pair on vectors, like in c++? Example: vec\[r\].insert(std::make\_pair(i,j)); Best regards

---

## [Pyimport works from repl defined module but not in my package](https://discourse.julialang.org/t/pyimport-works-from-repl-defined-module-but-not-in-my-package/43539)

<div class="topic-metadata">

**Author:** [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Replies:** 3\
**Last updated:** [July 23, 2020, 4:03pm UTC](https://discourse.julialang.org/t/pyimport-works-from-repl-defined-module-but-not-in-my-package/43539 "2020-07-23T16:03:54Z")

</div>

Hi, I’m trying to use PyCall to call the hnswlib python bindings from julia. The following MWE with a module defined at the repl works as expected. And also a slightly expanded version of that module where the find\_ann …

---

## [Preconditioner for nonlinear optimization](https://discourse.julialang.org/t/preconditioner-for-nonlinear-optimization/43558)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 3:14pm UTC](https://discourse.julialang.org/t/preconditioner-for-nonlinear-optimization/43558 "2020-07-23T15:14:13Z")

</div>

Hello, I am working on the following nonlinear minimization problem: \\displaystyle{\\min\_{\\boldsymbol{c} \\in R^n}} \\mbox{ }\\frac{1}{M} \\sum\_{i=1}^{M} \\left(\\frac{1}{2} \\left\[\\boldsymbol{c}^T \\boldsymbol{f}\_0 + \\int…

---

## [How to group data from multiple files?](https://discourse.julialang.org/t/how-to-group-data-from-multiple-files/43547)

<div class="topic-metadata">

**Author:** [@Valentine\_GRAND](https://discourse.julialang.org/u/Valentine_GRAND)\
**Replies:** 2\
**Last updated:** [July 23, 2020, 2:42pm UTC](https://discourse.julialang.org/t/how-to-group-data-from-multiple-files/43547 "2020-07-23T14:42:15Z")

</div>

Hello everyone, Here’s my code : function TypeFrame(objet) findFrame = findall(x-\>occursin("frame =",x),objet) sframe = \[\] for i in findFrame lframe = objet\[i\] sframe = \[sframe;split(lframe,r"frame…

---

## [Count the number of evauations of the objective function](https://discourse.julialang.org/t/count-the-number-of-evauations-of-the-objective-function/43251)

<div class="topic-metadata">

**Author:** [@Ariel\_Cruz\_Cruz](https://discourse.julialang.org/u/Ariel_Cruz_Cruz)\
**Replies:** 3\
**Last updated:** [July 23, 2020, 1:06pm UTC](https://discourse.julialang.org/t/count-the-number-of-evauations-of-the-objective-function/43251 "2020-07-23T13:06:23Z")

</div>

Hello, I am using JuMP with the Ipopt solver to optimize certain optimization problem. And I need to get the number of evaluations of the objective function. When I run my program I get some information such as: Number …

---

## [Julia 4 places up on IEEE index](https://discourse.julialang.org/t/julia-4-places-up-on-ieee-index/43548)

<div class="topic-metadata">

**Author:** [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Replies:** 4\
**Last updated:** [July 23, 2020, 1:03pm UTC](https://discourse.julialang.org/t/julia-4-places-up-on-ieee-index/43548 "2020-07-23T13:03:02Z")

</div>

2020: 2019: https://spectrum.ieee.org/static/interactive-the-top-programming-languages-2019 From 23rd to 19th place on IEEE Spectrum, and from 22nd to 13th on Trending. Bonus: try playing with custom rankings to see…

---

## [Partition EnsembleSolution before using EnsembleSummary](https://discourse.julialang.org/t/partition-ensemblesolution-before-using-ensemblesummary/43541)

<div class="topic-metadata">

**Author:** [@jedforrest](https://discourse.julialang.org/u/jedforrest)\
**Replies:** 1\
**Last updated:** [July 23, 2020, 11:21am UTC](https://discourse.julialang.org/t/partition-ensemblesolution-before-using-ensemblesummary/43541 "2020-07-23T11:21:43Z")

</div>

I’ve started using EnsembleProblem in DifferentialEquations.jl and I like how simple it is to use with EnsembleSummary to create nice summary statistics and plots. However, I would like to partition EnsembleSolution int…

---

## [Best way to solve system of ODEs with different types in DifferentialEquations.jl](https://discourse.julialang.org/t/best-way-to-solve-system-of-odes-with-different-types-in-differentialequations-jl/43533)

<div class="topic-metadata">

**Author:** [@tpolakovic](https://discourse.julialang.org/u/tpolakovic)\
**Replies:** 1\
**Last updated:** [July 23, 2020, 11:20am UTC](https://discourse.julialang.org/t/best-way-to-solve-system-of-odes-with-different-types-in-differentialequations-jl/43533 "2020-07-23T11:20:05Z")

</div>

I have two fields, A (complex scalar field) and B (real vector field), which are sampled on staggered grids. This means that (in, say, three dimensions) A is an complex array with N^3 elements, while B is a real array wi…

---

## [Set up Makie with Intel integrated graphics](https://discourse.julialang.org/t/set-up-makie-with-intel-integrated-graphics/40884)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 4\
**Last updated:** [July 23, 2020, 9:03am UTC](https://discourse.julialang.org/t/set-up-makie-with-intel-integrated-graphics/40884 "2020-07-23T09:03:47Z")

</div>

I would like to try the fancy new InteractiveViz package. Julia 1.4 on a laptop running Fedora 32 Linux Intel Corporation HD Graphics 620 (rev 02) Glxinfo says that I am using Mesa rendering: direct rendering: Yes s…

---

## [Should \`inv\` be lazy?](https://discourse.julialang.org/t/should-inv-be-lazy/42786)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 24\
**Last updated:** [July 23, 2020, 6:55am UTC](https://discourse.julialang.org/t/should-inv-be-lazy/42786 "2020-07-23T06:55:12Z")

</div>

I was thinking about how inv is almost always the wrong thing to use in code, and how this primarily trips up people without significant linear algebra experience, and I realized that I think the following will be almos…

---

## [How to link the elements of array into a string](https://discourse.julialang.org/t/how-to-link-the-elements-of-array-into-a-string/30735)

<div class="topic-metadata">

**Author:** [@Yan](https://discourse.julialang.org/u/Yan)\
**Replies:** 8\
**Last updated:** [July 23, 2020, 4:18am UTC](https://discourse.julialang.org/t/how-to-link-the-elements-of-array-into-a-string/30735 "2020-07-23T04:18:02Z")

</div>

x=\[“j”,“u”,“l”,“i”,“a”\] such as: string?(x) into “julia”

---

## [MLJ (Machine Learning in Julia) 0.12 update](https://discourse.julialang.org/t/mlj-machine-learning-in-julia-0-12-update/43524)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 4\
**Last updated:** [July 23, 2020, 4:14am UTC](https://discourse.julialang.org/t/mlj-machine-learning-in-julia-0-12-update/43524 "2020-07-23T04:14:08Z")

</div>

Try it out (nothing to install): Docs: MLJ Learn: Data Science Tutorials in Julia. Free: workshop at JuliaCon2020 Been a little while since our v0.1 announcement. Now at v0.11.6 v0.12.0, with functionality sprea…

---

## [Best practices regarding Adjoint, when should it be used instead of Array, best way to 'style it out'](https://discourse.julialang.org/t/best-practices-regarding-adjoint-when-should-it-be-used-instead-of-array-best-way-to-style-it-out/43525)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 5\
**Last updated:** [July 23, 2020, 3:33am UTC](https://discourse.julialang.org/t/best-practices-regarding-adjoint-when-should-it-be-used-instead-of-array-best-way-to-style-it-out/43525 "2020-07-23T03:33:59Z")

</div>

Very often I generate a structure like this, when all I want (as far as I know) is an array: 10×2 Adjoint{Float64,Array{Float64,2}}: 0.4988 0.5012 0.378885 0.621115 0.651367 0.348633 0.474066 0.525934 0.40512…

---

## [Memory sizing and GC behavior](https://discourse.julialang.org/t/memory-sizing-and-gc-behavior/10121)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 6\
**Last updated:** [July 23, 2020, 2:01am UTC](https://discourse.julialang.org/t/memory-sizing-and-gc-behavior/10121 "2020-07-23T02:01:01Z")

</div>

I have a function that allocates a lot and hence every trial requires some time for GC. I’m just wondering if there’s any way to tune the system such that it has more heap memory and avoid having to GC so often? Benchm…

---

## [PowerModelsAnnex QC\_OPF](https://discourse.julialang.org/t/powermodelsannex-qc-opf/43459)

<div class="topic-metadata">

**Author:** [@fnbillimoria](https://discourse.julialang.org/u/fnbillimoria)\
**Replies:** 2\
**Last updated:** [July 23, 2020, 1:21am UTC](https://discourse.julialang.org/t/powermodelsannex-qc-opf/43459 "2020-07-23T01:21:00Z")

</div>

I am looking through the PowerModelsAnnex.jl module and particularly the src/model/opf.jl file. I noted that there is a build of a quadratically constrained opf in there? (i.e. build\_qc\_opf) Could I please confirm what …

---

## [C/C++ interop workshop](https://discourse.julialang.org/t/c-c-interop-workshop/34936)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 7\
**Last updated:** [July 22, 2020, 10:54pm UTC](https://discourse.julialang.org/t/c-c-interop-workshop/34936 "2020-07-22T22:54:47Z")

</div>

Hi all, I saw an announcement on Twitter that workshop proposals were still wanted for JuliaCon. Given the many recent changes to CxxWrap.jl I was thinking of proposing a workshop on how to “wrap” a C++ library for use …

---

## [Distributed Computing Shared Arrays](https://discourse.julialang.org/t/distributed-computing-shared-arrays/43522)

<div class="topic-metadata">

**Author:** [@smickus](https://discourse.julialang.org/u/smickus)\
**Replies:** 0\
**Last updated:** [July 22, 2020, 10:48pm UTC](https://discourse.julialang.org/t/distributed-computing-shared-arrays/43522 "2020-07-22T22:48:54Z")

</div>

I am trying to use a shared array and use that array inside of a function of a function. The issue is that the function that I am using the shared array in cannot have any additional parameters passed to it due to the f…

---

## [Shown all the element of vector in Juno](https://discourse.julialang.org/t/shown-all-the-element-of-vector-in-juno/43516)

<div class="topic-metadata">

**Author:** [@linlinlin](https://discourse.julialang.org/u/linlinlin)\
**Replies:** 0\
**Last updated:** [July 22, 2020, 8:43pm UTC](https://discourse.julialang.org/t/shown-all-the-element-of-vector-in-juno/43516 "2020-07-22T20:43:03Z")

</div>

Hi, I use Atom/Juno to develop julia I want to see the value of a vector or an array, but in the workspace, only part (like, 10) of the elements are displayed. The elements can not be all displayed like matlab, C++ ho…

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

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