# Latest

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

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

**Page:** 1060

---

## [Json/bson dsl](https://discourse.julialang.org/t/json-bson-dsl/79940)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 1\
**Last updated:** [April 25, 2022, 3:16pm UTC](https://discourse.julialang.org/t/json-bson-dsl/79940 "2022-04-25T15:16:44Z")

</div>

Hi, I’ve been playing a bit with Mongoc which is a thin layer on top of the MongoDB C library. MongoDB is leaning heavily into JSON, which makes for non-intuitive code (from the Mongoc docs): create\_indexes\_cmd = Mongo…

---

## [Spooky action at distance not applicable to vectors?](https://discourse.julialang.org/t/spooky-action-at-distance-not-applicable-to-vectors/79602)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 14\
**Last updated:** [April 25, 2022, 3:08pm UTC](https://discourse.julialang.org/t/spooky-action-at-distance-not-applicable-to-vectors/79602 "2022-04-25T15:08:55Z")

</div>

I have been using Julia for all my codes. I was explaining all the advantages of Julia over Python to my lab members and one of them decided to give it a try. Since I had stumbled over scoping rules when I started, I war…

---

## [Will Julia ever fix its "using ..." latency problems?](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659)

<div class="topic-metadata">

**Author:** [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Replies:** 68\
**Last updated:** [April 25, 2022, 2:40pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659 "2022-04-25T14:40:11Z")

</div>

The “using …” command is extremely slow: julia\> @time using Plots 12.731850 seconds (17.25 M allocations: 976.326 MiB, 3.64% gc time) julia\> @time using DifferentialEquations 34.780873 seconds (41.90 M allocations: …

---

## [How to define a generative mode](https://discourse.julialang.org/t/how-to-define-a-generative-mode/79990)

<div class="topic-metadata">

**Author:** [@clrescobar](https://discourse.julialang.org/u/clrescobar)\
**Replies:** 0\
**Last updated:** [April 25, 2022, 2:19pm UTC](https://discourse.julialang.org/t/how-to-define-a-generative-mode/79990 "2022-04-25T14:19:55Z")

</div>

Hello, I have seen that the @gen interface can be used to define a generative model that takes in a current (s,a)-pair and outputs a sampled next state, observation, and reward (sp, o, r). Link here. Nevertheless, here…

---

## [ModelingToolkit example macro appears not to work](https://discourse.julialang.org/t/modelingtoolkit-example-macro-appears-not-to-work/79981)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 2\
**Last updated:** [April 25, 2022, 1:38pm UTC](https://discourse.julialang.org/t/modelingtoolkit-example-macro-appears-not-to-work/79981 "2022-04-25T13:38:17Z")

</div>

Hi! I am trying to set up an ODE System similar to the very first example in ModelingToolkit. When I try to run e.g the code from the first example I get the error \`UndefVarError: @named not defined’. Anyone know what …

---

## [How to solve a system of nonlinear equations with a lagged variable?](https://discourse.julialang.org/t/how-to-solve-a-system-of-nonlinear-equations-with-a-lagged-variable/79949)

<div class="topic-metadata">

**Author:** [@fms-1988](https://discourse.julialang.org/u/fms-1988)\
**Replies:** 4\
**Last updated:** [April 25, 2022, 1:13pm UTC](https://discourse.julialang.org/t/how-to-solve-a-system-of-nonlinear-equations-with-a-lagged-variable/79949 "2022-04-25T13:13:25Z")

</div>

I have a system of equations (f). This system has a set of variables, among them the variables (x\_t) and (x\_{t-1}). How can I represent the variable (x\_{t-1}) within this system? Thanks in advance

---

## [Does the julia executable already include a git client?](https://discourse.julialang.org/t/does-the-julia-executable-already-include-a-git-client/79985)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [April 25, 2022, 12:43pm UTC](https://discourse.julialang.org/t/does-the-julia-executable-already-include-a-git-client/79985 "2022-04-25T12:43:53Z")

</div>

I think so, but can someone confirm that a git client to manage packages is already present in the Julia executable that is downloaded from julialang.org, so that a stand-alone git client is not strictly required ?

---

## [How use python functions from my python file in Julia?](https://discourse.julialang.org/t/how-use-python-functions-from-my-python-file-in-julia/79977)

<div class="topic-metadata">

**Author:** [@YitaoCai](https://discourse.julialang.org/u/YitaoCai)\
**Replies:** 2\
**Last updated:** [April 25, 2022, 12:14pm UTC](https://discourse.julialang.org/t/how-use-python-functions-from-my-python-file-in-julia/79977 "2022-04-25T12:14:52Z")

</div>

In python we do like from mypython\_folder.mypython\_script import mypython\_function/mypython\_class how do we use PythonCall.jl to do that? I tried mypython\_function = pyimport("mypython\_folder.mypython\_script" =\> "myp…

---

## [Is a Structure in a Collection](https://discourse.julialang.org/t/is-a-structure-in-a-collection/79957)

<div class="topic-metadata">

**Author:** [@Ordens\_Ritter](https://discourse.julialang.org/u/Ordens_Ritter)\
**Replies:** 7\
**Last updated:** [April 25, 2022, 12:18pm UTC](https://discourse.julialang.org/t/is-a-structure-in-a-collection/79957 "2022-04-25T12:18:55Z")

</div>

I want to find whether a Structure of Type A is in included in A Collection. In the next step I wanna return this collection form a Collection of a Collection of Type A^^. struct A a = Int end a = \[A(1), A(2)\] in(a,…

---

## [Struct with Parameters.jl and outer function](https://discourse.julialang.org/t/struct-with-parameters-jl-and-outer-function/79886)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 2\
**Last updated:** [April 25, 2022, 10:16am UTC](https://discourse.julialang.org/t/struct-with-parameters-jl-and-outer-function/79886 "2022-04-25T10:16:55Z")

</div>

Hi everyone, I have a simple idea: I want to create a Grid object containing the parameters of my model. I want the user to give values using Unitful to have units and to internally have consistent values without the un…

---

## [Using CPLEX populate method with JuMP](https://discourse.julialang.org/t/using-cplex-populate-method-with-jump/79973)

<div class="topic-metadata">

**Author:** [@MLainee](https://discourse.julialang.org/u/MLainee)\
**Replies:** 2\
**Last updated:** [April 25, 2022, 11:12am UTC](https://discourse.julialang.org/t/using-cplex-populate-method-with-jump/79973 "2022-04-25T11:12:22Z")

</div>

Greetings, I am currently using the CPLEX optimizer with the help of the JuMP package. In order to generate constraints for my model, I am currently using a function of the following type: using JuMP using CPLEX funct…

---

## [How to find a root at the diverging boundary?](https://discourse.julialang.org/t/how-to-find-a-root-at-the-diverging-boundary/79930)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 7\
**Last updated:** [April 25, 2022, 9:55am UTC](https://discourse.julialang.org/t/how-to-find-a-root-at-the-diverging-boundary/79930 "2022-04-25T09:55:56Z")

</div>

Say if I have a function f(x; \\lambda) which is continuous and smooth where x \\in (0, \\infty) for any 0\<\\lambda \< \\lambda^\*. For each \\lambda, there is a single minimum at the same location x^\*, f(x^\*; \\lambda). f(x^\*; \\…

---

## [Updating a function in a type, where the function is a parameter](https://discourse.julialang.org/t/updating-a-function-in-a-type-where-the-function-is-a-parameter/79933)

<div class="topic-metadata">

**Author:** [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Replies:** 26\
**Last updated:** [April 25, 2022, 8:30am UTC](https://discourse.julialang.org/t/updating-a-function-in-a-type-where-the-function-is-a-parameter/79933 "2022-04-25T08:30:03Z")

</div>

I just ran into a problem with my idea to have performant code and updating a struct. Assume we have a struct (already mutable to change it) mutable struct MyStruct{F} f::F end where f is a function (in my applica…

---

## [Vector to @enum](https://discourse.julialang.org/t/vector-to-enum/79907)

<div class="topic-metadata">

**Author:** [@clrescobar](https://discourse.julialang.org/u/clrescobar)\
**Replies:** 8\
**Last updated:** [April 25, 2022, 8:23am UTC](https://discourse.julialang.org/t/vector-to-enum/79907 "2022-04-25T08:23:48Z")

</div>

Hello, I would like to know how to convert a vector into @enum. I have tried: AS =\[Action(τ,ρ,χ,ω) for τ in 0:5 for ρ in 0:5 for χ in 0:5 for ω in 0:5\] for i in 1:1296 action = AS\[i\] @enum Actions action end B…

---

## [Adding a package bumps another to a seemingly breaking release](https://discourse.julialang.org/t/adding-a-package-bumps-another-to-a-seemingly-breaking-release/79971)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 4\
**Last updated:** [April 25, 2022, 7:48am UTC](https://discourse.julialang.org/t/adding-a-package-bumps-another-to-a-seemingly-breaking-release/79971 "2022-04-25T07:48:38Z")

</div>

(@v1.7) pkg\> activate --temp Activating new project at \`/tmp/jl\_TmSumB\` (jl\_TmSumB) pkg\> add TensorKit@0.9 Updating registry at \`~/.julia/registries/General\` Updating git-repo \`https://github.com/JuliaRegistri…

---

## [A simple inference bug with Dates.Period?](https://discourse.julialang.org/t/a-simple-inference-bug-with-dates-period/79966)

<div class="topic-metadata">

**Author:** [@braydenware](https://discourse.julialang.org/u/braydenware)\
**Replies:** 2\
**Last updated:** [April 25, 2022, 3:36am UTC](https://discourse.julialang.org/t/a-simple-inference-bug-with-dates-period/79966 "2022-04-25T03:36:02Z")

</div>

In some simple arithmetic subtracting types with Dates.CompoundPeriod, a bug arises when you try to subtract a Dates.CompoundPeriod that is equal to 0. However, it does not seem to be a problem with the Dates code but ra…

---

## [Migrating from GLMakie 0.4.7 to current](https://discourse.julialang.org/t/migrating-from-glmakie-0-4-7-to-current/79913)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 10\
**Last updated:** [April 25, 2022, 12:17am UTC](https://discourse.julialang.org/t/migrating-from-glmakie-0-4-7-to-current/79913 "2022-04-25T00:17:51Z")

</div>

I am trying to migrate my package GitHub - aenarete/KiteViewers.jl: 3D viewer for airborne wind energy systems (not registered) from GLMakie 0.4.7 to the current version. The first error I see is: julia\> using KiteView…

---

## [Writing loops in optimization problems in Julia](https://discourse.julialang.org/t/writing-loops-in-optimization-problems-in-julia/79927)

<div class="topic-metadata">

**Author:** [@Eric.O](https://discourse.julialang.org/u/Eric.O)\
**Replies:** 7\
**Last updated:** [April 24, 2022, 11:44pm UTC](https://discourse.julialang.org/t/writing-loops-in-optimization-problems-in-julia/79927 "2022-04-24T23:44:55Z")

</div>

I am trying to use Mosek to solve this optimization problem. I have my code which displays the optimal solution of the values of x,y,z and the radius R. I want to insert a loop in my code to test if the absolute of the …

---

## [3D Scatter with 2D Projections](https://discourse.julialang.org/t/3d-scatter-with-2d-projections/79920)

<div class="topic-metadata">

**Author:** [@MisterBiggs](https://discourse.julialang.org/u/MisterBiggs)\
**Replies:** 1\
**Last updated:** [April 24, 2022, 11:27pm UTC](https://discourse.julialang.org/t/3d-scatter-with-2d-projections/79920 "2022-04-24T23:27:04Z")

</div>

Saw an interesting post on twitter https://twitter.com/BrainInTheMind/status/1517543839833243649 that got me wondering if there was a supported way to project 3D data onto the axes using Plots or Makie. I came up with my…

---

## [How to properly specify Jacobian & Hessian functions of inequality constraints (Optim)](https://discourse.julialang.org/t/how-to-properly-specify-jacobian-hessian-functions-of-inequality-constraints-optim/53870)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 9\
**Last updated:** [April 24, 2022, 10:34pm UTC](https://discourse.julialang.org/t/how-to-properly-specify-jacobian-hessian-functions-of-inequality-constraints-optim/53870 "2022-04-24T22:34:46Z")

</div>

I’m trying to optimize an objective function with 19 variables in Optim with the following inequality constraints: 0 \<= x\[1\]/3 - x\[2\] \<= 1/3 5 \<= 1/x\[3\] + 1/x\[4\] \<= 6 I’m trying to use either IPNewton() or NewtonTrust…

---

## [Problem in installing Gurobi.jl (ipopt shows infeasible )](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845)

<div class="topic-metadata">

**Author:** [@HosseinF](https://discourse.julialang.org/u/HosseinF)\
**Replies:** 6\
**Last updated:** [April 24, 2022, 10:23pm UTC](https://discourse.julialang.org/t/problem-in-installing-gurobi-jl-ipopt-shows-infeasible/79845 "2022-04-24T22:23:16Z")

</div>

Hi, I wanted to solve a two stage stochastic problem via ipopt solver but it does not solved and shows: Converged to a point of local infeasibility. Problem may be infeasible. LOCALLY INFEASIBLE┌ Warning: Stochastic p…

---

## [Converting a Vector{float64} to float{64}](https://discourse.julialang.org/t/converting-a-vector-float64-to-float-64/79953)

<div class="topic-metadata">

**Author:** [@Will\_G](https://discourse.julialang.org/u/Will_G)\
**Replies:** 5\
**Last updated:** [April 24, 2022, 7:57pm UTC](https://discourse.julialang.org/t/converting-a-vector-float64-to-float-64/79953 "2022-04-24T19:57:25Z")

</div>

I have a one element vector{float64} called “Ge” that operates inside of a for loop. The code I am trying to do is result\[num\] = (part1+part2)/Ge in which both part 1 and part 2 are type Float64. It doesn’t let me do thi…

---

## [Fail to add GraphNeuralNetworks.jl](https://discourse.julialang.org/t/fail-to-add-graphneuralnetworks-jl/79935)

<div class="topic-metadata">

**Author:** [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Replies:** 1\
**Last updated:** [April 24, 2022, 7:30pm UTC](https://discourse.julialang.org/t/fail-to-add-graphneuralnetworks-jl/79935 "2022-04-24T19:30:51Z")

</div>

I try to add “GraphNeuralNetworks”. But some errors happened: My Julia is JuliaPro\_v1.5.4-1.The version is CUDA v2.4.3. Is the version incorrect causing this problem? How can I solve it? julia\> Pkg.add(“GraphNeuralNetw…

---

## [Small inconsistency between generators and vectors](https://discourse.julialang.org/t/small-inconsistency-between-generators-and-vectors/79950)

<div class="topic-metadata">

**Author:** [@goerch](https://discourse.julialang.org/u/goerch)\
**Replies:** 1\
**Last updated:** [April 24, 2022, 6:22pm UTC](https://discourse.julialang.org/t/small-inconsistency-between-generators-and-vectors/79950 "2022-04-24T18:22:26Z")

</div>

Just noticed, the MWE using Random using BenchmarkTools Random.seed!(42) array = rand(1\_000\_000) x = @btime sum(\[y\*y for y in $array\]) z = @btime sum(y\*y for y in $array) @show x @show z @assert z == x yields (obviou…

---

## [How to create a personal package](https://discourse.julialang.org/t/how-to-create-a-personal-package/79948)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 1\
**Last updated:** [April 24, 2022, 6:06pm UTC](https://discourse.julialang.org/t/how-to-create-a-personal-package/79948 "2022-04-24T18:06:04Z")

</div>

I want to create a package with some functions for personal use only. Currently what I’m using a .jl file inside my project folder and calling include("PersonalFunctions.jl") at the begging of my code. I would like to …

---

## [Plotting image data in Julia is much slower than MATLAB](https://discourse.julialang.org/t/plotting-image-data-in-julia-is-much-slower-than-matlab/79660)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 21\
**Last updated:** [April 24, 2022, 5:59pm UTC](https://discourse.julialang.org/t/plotting-image-data-in-julia-is-much-slower-than-matlab/79660 "2022-04-24T17:59:23Z")

</div>

I often visualize 2D raster grids of elevation data, where the grids can be 20,000x20,000 pixels, and each pixel contains an elevation value. In MATLAB, imagesc(x,y,Z) is lighting fast for this sort of thing, but the sam…

---

## [JIT compilation does not avoid useless computations](https://discourse.julialang.org/t/jit-compilation-does-not-avoid-useless-computations/79939)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 6\
**Last updated:** [April 24, 2022, 5:54pm UTC](https://discourse.julialang.org/t/jit-compilation-does-not-avoid-useless-computations/79939 "2022-04-24T17:54:36Z")

</div>

Hello, I had a naïve idea bout the JIT compiler. This is that when I define a function with independent return cases it will know with computations to perform, that is: function test(z::Bool=true,array::Vector=rand(10…

---

## [Hiring a technical writer to help with MLJ.jl (GSoD 2022)](https://discourse.julialang.org/t/hiring-a-technical-writer-to-help-with-mlj-jl-gsod-2022/79947)

<div class="topic-metadata">

**Author:** [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Replies:** 0\
**Last updated:** [April 24, 2022, 5:24pm UTC](https://discourse.julialang.org/t/hiring-a-technical-writer-to-help-with-mlj-jl-gsod-2022/79947 "2022-04-24T17:24:17Z")

</div>

Hey folks! Excited to share that we have been funded for Google Season of Docs 2022 (our 3rd year in a row). This year, we will be hiring a technical writer to help with Documenting Machine Learning Models in MLJ.jl. Yo…

---

## [How to show Matrix{RGB} on Cairo surface?](https://discourse.julialang.org/t/how-to-show-matrix-rgb-on-cairo-surface/79166)

<div class="topic-metadata">

**Author:** [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Replies:** 3\
**Last updated:** [April 24, 2022, 5:03pm UTC](https://discourse.julialang.org/t/how-to-show-matrix-rgb-on-cairo-surface/79166 "2022-04-24T17:03:30Z")

</div>

Cairo provides read\_from\_png, but returns value of a special type CairoSurfaceBase, which is hard to operate, so I choose Matrix{RGB}(the thing ImageIO returns). Cairo does provide something called set\_matrix, but the s…

---

## [Memory Leak: GC does not deallocate values allocated while it was turned off, unless specifically requested](https://discourse.julialang.org/t/memory-leak-gc-does-not-deallocate-values-allocated-while-it-was-turned-off-unless-specifically-requested/79904)

<div class="topic-metadata">

**Author:** [@Clemapfel](https://discourse.julialang.org/u/Clemapfel)\
**Replies:** 6\
**Last updated:** [April 24, 2022, 4:19pm UTC](https://discourse.julialang.org/t/memory-leak-gc-does-not-deallocate-values-allocated-while-it-was-turned-off-unless-specifically-requested/79904 "2022-04-24T16:19:10Z")

</div>

Hi, I’m considering opening a bug report about this, so I’d like to get your guys opinion on this behavior. The following is a memory leak: x = 1234 while (true) GC.enable(false) x = rand() GC.enable(true) …

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

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