# Latest

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

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

**Page:** 870

---

## [Error escaping a variable in a module using JuMP](https://discourse.julialang.org/t/error-escaping-a-variable-in-a-module-using-jump/89998)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 4\
**Last updated:** [November 9, 2022, 9:34pm UTC](https://discourse.julialang.org/t/error-escaping-a-variable-in-a-module-using-jump/89998 "2022-11-09T21:34:47Z")

</div>

I’m working to update a module compatible with JuMP v1.1.1 to the newest version of JuMP. Within the module is code similar to: module HoldBug using JuMP export @mytest macro mytest(m,F) m = esc(m) x = esc(F…

---

## [Flux.jl: Save model and optimizer from gpu](https://discourse.julialang.org/t/flux-jl-save-model-and-optimizer-from-gpu/89982)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 1\
**Last updated:** [November 9, 2022, 9:06pm UTC](https://discourse.julialang.org/t/flux-jl-save-model-and-optimizer-from-gpu/89982 "2022-11-09T21:06:05Z")

</div>

I am trying to save my Flux.jl model and the optimizer to disk. This seems to work just fine when everything is on the CPU but I cannot get the optimizer out of the GPU. cpu(opt) doesn’t seem to do anything. Is this supp…

---

## [JuMP in julia](https://discourse.julialang.org/t/jump-in-julia/89945)

<div class="topic-metadata">

**Author:** [@thiagoselias](https://discourse.julialang.org/u/thiagoselias)\
**Replies:** 9\
**Last updated:** [November 9, 2022, 9:05pm UTC](https://discourse.julialang.org/t/jump-in-julia/89945 "2022-11-09T21:05:42Z")

</div>

Link: https://gist.githubusercontent.com/thiagoselias/65dd09e675493443493b394bcc136784/raw/c81339907844c6bfb296353ed22269706d46b497/minimizacao.jl I have this problem But specifically in the constraint @constraint(mo…

---

## [Constraints in a stochastic differential equation problem](https://discourse.julialang.org/t/constraints-in-a-stochastic-differential-equation-problem/90004)

<div class="topic-metadata">

**Author:** [@jmg367](https://discourse.julialang.org/u/jmg367)\
**Replies:** 1\
**Last updated:** [November 9, 2022, 8:39pm UTC](https://discourse.julialang.org/t/constraints-in-a-stochastic-differential-equation-problem/90004 "2022-11-09T20:39:54Z")

</div>

I am trying to implement constraints into a spatial chemical langevin equation. I have an array where every two indices corresponds to a spatial location. Every odd/even index corresponds to the number of agents of type …

---

## [Posing constraints on component array optimizations](https://discourse.julialang.org/t/posing-constraints-on-component-array-optimizations/90007)

<div class="topic-metadata">

**Author:** [@RuoyuWang72](https://discourse.julialang.org/u/RuoyuWang72)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 8:33pm UTC](https://discourse.julialang.org/t/posing-constraints-on-component-array-optimizations/90007 "2022-11-09T20:33:06Z")

</div>

I have a component array p I want to optimize, p.ps\_τ and p.ps\_J are parameters of neural nets, and p.ps\_F1 and p.ps\_F2 are two floats (I followed this example: Simultaneous Fitting of Multiple Neural Networks ) The con…

---

## [Is working with SubArrays of a SparseMatrix a bad idea?](https://discourse.julialang.org/t/is-working-with-subarrays-of-a-sparsematrix-a-bad-idea/90000)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 9\
**Last updated:** [November 9, 2022, 8:16pm UTC](https://discourse.julialang.org/t/is-working-with-subarrays-of-a-sparsematrix-a-bad-idea/90000 "2022-11-09T20:16:16Z")

</div>

I’ve been trying to work with views of a SparseMatrix for a while now. The goal is to avoid extra copies when you want to operate inplace on a subsection of the sparse matrix. I’ve run into enough issues that I’m startin…

---

## [Allocation and slow down when # of types involved increase (slower than C++ virtual methods)](https://discourse.julialang.org/t/allocation-and-slow-down-when-of-types-involved-increase-slower-than-c-virtual-methods/87656)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 56\
**Last updated:** [November 9, 2022, 7:38pm UTC](https://discourse.julialang.org/t/allocation-and-slow-down-when-of-types-involved-increase-slower-than-c-virtual-methods/87656 "2022-11-09T19:38:33Z")

</div>

\*Happy to pay someone to spend time investigating this The context is @peremato trying to present a Julia case for detector simulation used at e.g. CERN (the LHC) and other accelerator/medical research places: https://in…

---

## [Inverting the columns of \`LinearAlgebra.QRCompactWYQ\`](https://discourse.julialang.org/t/inverting-the-columns-of-linearalgebra-qrcompactwyq/90003)

<div class="topic-metadata">

**Author:** [@brainandforce](https://discourse.julialang.org/u/brainandforce)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 7:24pm UTC](https://discourse.julialang.org/t/inverting-the-columns-of-linearalgebra-qrcompactwyq/90003 "2022-11-09T19:24:53Z")

</div>

I need to perform a QR decomposition with all of the diagonal elements of R to be positive. I’d like to do this by multiplying relevant columns of Q and rows of R by -1, but the issue that comes up is that qr!() returns L…

---

## [Conditional constraint if else in JuMP](https://discourse.julialang.org/t/conditional-constraint-if-else-in-jump/6795)

<div class="topic-metadata">

**Author:** [@UserMorocco](https://discourse.julialang.org/u/UserMorocco)\
**Replies:** 14\
**Last updated:** [November 9, 2022, 6:43pm UTC](https://discourse.julialang.org/t/conditional-constraint-if-else-in-jump/6795 "2022-11-09T18:43:33Z")

</div>

Hello, How I can model the conditional constraint if else with JuMP in Julia ? Thank you

---

## [How a program coded and compiled in Julia compares to interpreted Julia in terms of performance?](https://discourse.julialang.org/t/how-a-program-coded-and-compiled-in-julia-compares-to-interpreted-julia-in-terms-of-performance/89995)

<div class="topic-metadata">

**Author:** [@phantomcraft](https://discourse.julialang.org/u/phantomcraft)\
**Replies:** 1\
**Last updated:** [November 9, 2022, 5:47pm UTC](https://discourse.julialang.org/t/how-a-program-coded-and-compiled-in-julia-compares-to-interpreted-julia-in-terms-of-performance/89995 "2022-11-09T17:47:20Z")

</div>

I know that I can generate an executable file in Julia: Creating a binary from Julia code · PackageCompiler In this page has a timing comparison between the interpreted and compiled app. My question is: How the perfor…

---

## [How to get the free variables of a function?](https://discourse.julialang.org/t/how-to-get-the-free-variables-of-a-function/89892)

<div class="topic-metadata">

**Author:** [@jt1](https://discourse.julialang.org/u/jt1)\
**Replies:** 3\
**Last updated:** [November 9, 2022, 4:52pm UTC](https://discourse.julialang.org/t/how-to-get-the-free-variables-of-a-function/89892 "2022-11-09T16:52:34Z")

</div>

Is there a way to get thefree variables of a function? For example: myfunc(a) = a+some\_func(b,a) free\_variables(myfunc) # returns (:b,) or (:b, :some\_func) is also fine A follow-up question (that I will likely have …

---

## [Add Test as a dependency of project](https://discourse.julialang.org/t/add-test-as-a-dependency-of-project/89043)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 6\
**Last updated:** [November 9, 2022, 4:46pm UTC](https://discourse.julialang.org/t/add-test-as-a-dependency-of-project/89043 "2022-11-09T16:46:16Z")

</div>

So I have a simple and small project that is completely standalone and doesn’t use anything outside of the standard library. The only thing in the standard library that I use is Test for my test suite which is located at…

---

## [Performing mul!() with Sparse Matrices inside DiffEq.jl model](https://discourse.julialang.org/t/performing-mul-with-sparse-matrices-inside-diffeq-jl-model/89963)

<div class="topic-metadata">

**Author:** [@jarias9](https://discourse.julialang.org/u/jarias9)\
**Replies:** 2\
**Last updated:** [November 9, 2022, 4:04pm UTC](https://discourse.julialang.org/t/performing-mul-with-sparse-matrices-inside-diffeq-jl-model/89963 "2022-11-09T16:04:50Z")

</div>

Hello all, I was trying to improve the runtime of a model I am running in DiffEq.jl I have been going through the optimization steps for an eqnsystem!(du, u, p, t) however I am a bit stuck with regards to how to optimi…

---

## [Adding parameters to function definition avoids allocations](https://discourse.julialang.org/t/adding-parameters-to-function-definition-avoids-allocations/89975)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 3\
**Last updated:** [November 9, 2022, 3:43pm UTC](https://discourse.julialang.org/t/adding-parameters-to-function-definition-avoids-allocations/89975 "2022-11-09T15:43:32Z")

</div>

I’m trying to get a small piece of code that I’ll run millions of times to run without allocations. There is a small allocation that I cannot understand the cause of (for example, using Profile.Allocs cannot attribute th…

---

## [Error in creating a package using PkgTemplates.jl](https://discourse.julialang.org/t/error-in-creating-a-package-using-pkgtemplates-jl/48935)

<div class="topic-metadata">

**Author:** [@zoumuda](https://discourse.julialang.org/u/zoumuda)\
**Replies:** 7\
**Last updated:** [November 9, 2022, 3:03pm UTC](https://discourse.julialang.org/t/error-in-creating-a-package-using-pkgtemplates-jl/48935 "2022-11-09T15:03:27Z")

</div>

Hi, I would lile to learn to creat a package using PkgTemplates.jl When I try it according to the User Guilde: using PkgTemplates t = Template() t(“MyPkg”) It has the following error: Git: Git hosting service user…

---

## [No console window with Gtk](https://discourse.julialang.org/t/no-console-window-with-gtk/89979)

<div class="topic-metadata">

**Author:** [@tresgrospipo](https://discourse.julialang.org/u/tresgrospipo)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 12:15pm UTC](https://discourse.julialang.org/t/no-console-window-with-gtk/89979 "2022-11-09T12:15:17Z")

</div>

Hi everyone, new in Julia, I need to have a GUI on Julia in WIN11 (can’t choose OS), I choose Gtk.jl and test a simple script using Gtk win = GtkWindow(“My First Gtk.jl Program”, 400, 200) b = GtkButton(“Click Me”) p…

---

## [Print optimization problem using Ipopt](https://discourse.julialang.org/t/print-optimization-problem-using-ipopt/89786)

<div class="topic-metadata">

**Author:** [@Katti](https://discourse.julialang.org/u/Katti)\
**Replies:** 6\
**Last updated:** [November 9, 2022, 1:18pm UTC](https://discourse.julialang.org/t/print-optimization-problem-using-ipopt/89786 "2022-11-09T13:18:57Z")

</div>

Hello all, I am building a pretty complex optimization problem with the Ipopt solver (NLP). Since the results are not as I expected, I guess that I made a mistake in the model definition. Therefore, I would like to prin…

---

## [Mesh Parametric Surface](https://discourse.julialang.org/t/mesh-parametric-surface/84579)

<div class="topic-metadata">

**Author:** [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Replies:** 4\
**Last updated:** [November 9, 2022, 12:04pm UTC](https://discourse.julialang.org/t/mesh-parametric-surface/84579 "2022-11-09T12:04:46Z")

</div>

I have a surface that can be described by f(u,v), and I would like to generate a mesh of this object (so that I can later put it in Blender/Paraview). Any guidelines on how to do it in Julia?

---

## [Help solving coupled differential equations involving complex numbers](https://discourse.julialang.org/t/help-solving-coupled-differential-equations-involving-complex-numbers/89893)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 6\
**Last updated:** [November 9, 2022, 11:13am UTC](https://discourse.julialang.org/t/help-solving-coupled-differential-equations-involving-complex-numbers/89893 "2022-11-09T11:13:36Z")

</div>

Original title: “Some help solving set of differential equations” Hi. I am stuck in doing some homework, and I was hoping I could get some help. The task is to analytically or numerically solve some differential equati…

---

## [Linear algebra -- block diagonal matrix?](https://discourse.julialang.org/t/linear-algebra-block-diagonal-matrix/89971)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [November 9, 2022, 10:28am UTC](https://discourse.julialang.org/t/linear-algebra-block-diagonal-matrix/89971 "2022-11-09T10:28:10Z")

</div>

In MATLAB, there is a constructor diagm for block diagonal matrices. I seem to recall that this is missing in Julia. If I am wrong, what is the most elegant way to create one?

---

## [Speeding up plotting inside of a loop?](https://discourse.julialang.org/t/speeding-up-plotting-inside-of-a-loop/89942)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 3\
**Last updated:** [November 9, 2022, 10:15am UTC](https://discourse.julialang.org/t/speeding-up-plotting-inside-of-a-loop/89942 "2022-11-09T10:15:52Z")

</div>

I am creating a custom surface plot piece-by-piece inside of a for loop. Here’s a very simplified example: mutable struct MyPlotType{T} x::T end @recipe function f(::Type{MyPlotType{T}}, my\_plot\_type::MyPlotType{T}…

---

## [Parsing ProtoBuf Text Format](https://discourse.julialang.org/t/parsing-protobuf-text-format/84721)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 3\
**Last updated:** [November 9, 2022, 8:59am UTC](https://discourse.julialang.org/t/parsing-protobuf-text-format/84721 "2022-11-09T08:59:17Z")

</div>

Hi, I’m trying to use ProtoBuf.jl to deserialize objects. Managed to generate code from .proto files Now I want to read and write objects with Protocol Buffer Text Format Language Specification. However, I could only …

---

## [Remove the redundant element type without coping the source data](https://discourse.julialang.org/t/remove-the-redundant-element-type-without-coping-the-source-data/89646)

<div class="topic-metadata">

**Author:** [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Replies:** 7\
**Last updated:** [November 9, 2022, 8:54am UTC](https://discourse.julialang.org/t/remove-the-redundant-element-type-without-coping-the-source-data/89646 "2022-11-09T08:54:26Z")

</div>

I have a vector a = Union{Misisng, Int}\[1, 2, 3\] The all elements of a is Int. Is there a way I can remove the Missing element type in place? some\_function!(a) #change the element type in place a 3-element Vector{Int…

---

## [Why plots do not display in the VSCode Julia Plots pane when I run my program?](https://discourse.julialang.org/t/why-plots-do-not-display-in-the-vscode-julia-plots-pane-when-i-run-my-program/69339)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 2\
**Last updated:** [November 9, 2022, 8:11am UTC](https://discourse.julialang.org/t/why-plots-do-not-display-in-the-vscode-julia-plots-pane-when-i-run-my-program/69339 "2022-11-09T08:11:27Z")

</div>

Today I tried plotting for the first time with Julia. I installed the Plots package and was able to generate some plots. Things are not going as smoothly as I expected. When I plot from the REPL the plot shows in the VSC…

---

## [Puzzling behavior of "wrong" inner constructor](https://discourse.julialang.org/t/puzzling-behavior-of-wrong-inner-constructor/89954)

<div class="topic-metadata">

**Author:** [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Replies:** 4\
**Last updated:** [November 9, 2022, 6:58am UTC](https://discourse.julialang.org/t/puzzling-behavior-of-wrong-inner-constructor/89954 "2022-11-09T06:58:08Z")

</div>

Today I was quite surprised by this mistake of mine in an inner constructor not throwing an error, but leading to a silent bug. My actual case had many arguments and I missed several, but here is a MWE: julia\> struct My…

---

## [Suggestion: change "Documentation" to "Learn" as the second main button on julialang.org](https://discourse.julialang.org/t/suggestion-change-documentation-to-learn-as-the-second-main-button-on-julialang-org/89929)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [November 9, 2022, 5:06am UTC](https://discourse.julialang.org/t/suggestion-change-documentation-to-learn-as-the-second-main-button-on-julialang-org/89929 "2022-11-09T05:06:58Z")

</div>

My personal opinion: the second button after “Download” should point to “Learn” rather than directly to the “Documentation”. Reasons: interested users know how to go there already from the menu on the top (or directly …

---

## [Measure data movement Distributed](https://discourse.julialang.org/t/measure-data-movement-distributed/89966)

<div class="topic-metadata">

**Author:** [@jarbus](https://discourse.julialang.org/u/jarbus)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 4:30am UTC](https://discourse.julialang.org/t/measure-data-movement-distributed/89966 "2022-11-09T04:30:17Z")

</div>

Is there any way to measure the amount of data getting sent to workers? For the example in the Data Movement section of the Distributed Manual, it would be very helpful to tell if a call is moving data or not, to directl…

---

## [Shout Out to the Maintainers](https://discourse.julialang.org/t/shout-out-to-the-maintainers/89964)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 2:34am UTC](https://discourse.julialang.org/t/shout-out-to-the-maintainers/89964 "2022-11-09T02:34:17Z")

</div>

I just want to say how grateful I am to our community leaders and package maintainers. Compared to where I was just a year ago, my personal knowledge of computer science, software and language design, and Julia mechanic…

---

## [Plots failed to precompile due to Error in libgobject-2.0.so and libQt5Concurrent.so](https://discourse.julialang.org/t/plots-failed-to-precompile-due-to-error-in-libgobject-2-0-so-and-libqt5concurrent-so/89890)

<div class="topic-metadata">

**Author:** [@dchang10](https://discourse.julialang.org/u/dchang10)\
**Replies:** 2\
**Last updated:** [November 9, 2022, 2:26am UTC](https://discourse.julialang.org/t/plots-failed-to-precompile-due-to-error-in-libgobject-2-0-so-and-libqt5concurrent-so/89890 "2022-11-09T02:26:56Z")

</div>

Hello. I am trying to run my julia project on my school’s cluster. They have pre installed a Julia v1.7.1 Linux x86 binary. Adding Plots in the Pkg interface causes pre-compilation to fail: Precompiling project... ✗ P…

---

## [Mixers.jl question](https://discourse.julialang.org/t/mixers-jl-question/89961)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 0\
**Last updated:** [November 9, 2022, 1:24am UTC](https://discourse.julialang.org/t/mixers-jl-question/89961 "2022-11-09T01:24:27Z")

</div>

I’m creating structs for exotic options (Barriers, Digitals etc), using Mixers to add the common fields (Expiry, Notional, Currency etc) Another option would be to create a common fields struct and include this as a fie…

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

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