# Latest

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

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

**Page:** 732

---

## [Expressions with Arbitrary Objects in their \`args\` Arguments](https://discourse.julialang.org/t/expressions-with-arbitrary-objects-in-their-args-arguments/94771)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 6\
**Last updated:** [April 8, 2023, 12:36pm UTC](https://discourse.julialang.org/t/expressions-with-arbitrary-objects-in-their-args-arguments/94771 "2023-04-08T12:36:21Z")

</div>

I checked Core.Expr, Core.eval, Metaprogramming, and Julia ASTs, and I wasn’t able to find an answer. Is this behavior intended and supported? Let’s build a couple of expressions: julia\> ax1, ax2 = :(\[1:5;\]), \[1:5;\] (:…

---

## [Weird behavior of ArbNumerics returning nan](https://discourse.julialang.org/t/weird-behavior-of-arbnumerics-returning-nan/97114)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 11\
**Last updated:** [April 8, 2023, 12:30pm UTC](https://discourse.julialang.org/t/weird-behavior-of-arbnumerics-returning-nan/97114 "2023-04-08T12:30:41Z")

</div>

I want to use elliptic integrals with complex arguments, and for that, I am using ArbNumerics.jl (as suggested in this post). The issue is that I get nan for a reason I do not understand. This code works great: ArbNum…

---

## [JuMP with nonlinear vector constraints?](https://discourse.julialang.org/t/jump-with-nonlinear-vector-constraints/97223)

<div class="topic-metadata">

**Author:** [@irudik](https://discourse.julialang.org/u/irudik)\
**Replies:** 2\
**Last updated:** [April 8, 2023, 12:25pm UTC](https://discourse.julialang.org/t/jump-with-nonlinear-vector-constraints/97223 "2023-04-08T12:25:44Z")

</div>

This question is related to this old post, but I’m wondering if JuMP can now handle vector-valued nonlinear functions for constraints. I have a large scale problem where a nonlinear function of the variables x, multiplie…

---

## [Why does Pluto instantiate each time a notebook is launched?](https://discourse.julialang.org/t/why-does-pluto-instantiate-each-time-a-notebook-is-launched/96965)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [April 8, 2023, 12:11pm UTC](https://discourse.julialang.org/t/why-does-pluto-instantiate-each-time-a-notebook-is-launched/96965 "2023-04-08T12:11:07Z")

</div>

Hi all, I’m a bit confused about how Pluto works. As shown in the screenshot below, I noticed that it instantiates each time I launch the same notebook (with no explicit changes to the dependencies). Instantiation accou…

---

## [Applying SnoopPrecompile to ProtoBuf Generated Code](https://discourse.julialang.org/t/applying-snoopprecompile-to-protobuf-generated-code/97240)

<div class="topic-metadata">

**Author:** [@ThomasPluck](https://discourse.julialang.org/u/ThomasPluck)\
**Replies:** 2\
**Last updated:** [April 8, 2023, 11:17am UTC](https://discourse.julialang.org/t/applying-snoopprecompile-to-protobuf-generated-code/97240 "2023-04-08T11:17:09Z")

</div>

Hi, so I’m generating some code using .protofiles, they are the usual messages etc. - I have some building automation that I’m fairly happy with and everything works as intended: These proto files can get quite large,…

---

## [UndefVarError: @formula not defined](https://discourse.julialang.org/t/undefvarerror-formula-not-defined/97243)

<div class="topic-metadata">

**Author:** [@nirong](https://discourse.julialang.org/u/nirong)\
**Replies:** 4\
**Last updated:** [April 8, 2023, 10:46am UTC](https://discourse.julialang.org/t/undefvarerror-formula-not-defined/97243 "2023-04-08T10:46:11Z")

</div>

I am using Julia version1.8.5. There was an error " LoadError: UndefVarError: @formula not defined" when I ran "fmla = @formula(outcome ~ GP(X1, X2) | region + covarA + covarB + categ)” in julia. The code and error is …

---

## [SDDP simulation command](https://discourse.julialang.org/t/sddp-simulation-command/97197)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 5\
**Last updated:** [April 8, 2023, 8:49am UTC](https://discourse.julialang.org/t/sddp-simulation-command/97197 "2023-04-08T08:49:27Z")

</div>

Hello everyone, I am using Julia and SDDP library to solve a multi-stage stochastic optimization model. The water inflow is my random variable. At the end of the SDDP, I used SDDP.train command to train the model. The…

---

## [Julia and Projective Geometric Algebra with GLMakie: Unable to Plot 3D Triangle](https://discourse.julialang.org/t/julia-and-projective-geometric-algebra-with-glmakie-unable-to-plot-3d-triangle/97244)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [April 8, 2023, 8:41am UTC](https://discourse.julialang.org/t/julia-and-projective-geometric-algebra-with-glmakie-unable-to-plot-3d-triangle/97244 "2023-04-08T08:41:25Z")

</div>

Hi all, I am following this medium: and I am trying the code to plot 3D Triangle from REPL: #= 1. includes “ripga3d.jl” so the REPL can evaluate 3D PGA expressions, 2. defines three vertices of a triangle in 3…

---

## [Best Debug Workflow for Dr Watson](https://discourse.julialang.org/t/best-debug-workflow-for-dr-watson/97234)

<div class="topic-metadata">

**Author:** [@WillHWThompson](https://discourse.julialang.org/u/WillHWThompson)\
**Replies:** 7\
**Last updated:** [April 8, 2023, 6:03am UTC](https://discourse.julialang.org/t/best-debug-workflow-for-dr-watson/97234 "2023-04-08T06:03:39Z")

</div>

I am extremely frustrated by my current workflow. There has to be a better way and I wanted to ask for advice. Here is how I have been working. I use Dr. Watson for all of my projects. I write all my store all my source…

---

## [Benchmark macro doesn't display anything in VSCode](https://discourse.julialang.org/t/benchmark-macro-doesnt-display-anything-in-vscode/97145)

<div class="topic-metadata">

**Author:** [@Nandophi](https://discourse.julialang.org/u/Nandophi)\
**Replies:** 13\
**Last updated:** [April 8, 2023, 6:00am UTC](https://discourse.julialang.org/t/benchmark-macro-doesnt-display-anything-in-vscode/97145 "2023-04-08T06:00:37Z")

</div>

I am new to Julia and very exited to get into it. As part of learning, I am trying to use the @benchmark macro to see how I can optimize different aspects of Julia code, as well as the impact of for example = vs .=, etc.…

---

## [SymPy to Solve Initial Value Condition (First Order Differential Equation)](https://discourse.julialang.org/t/sympy-to-solve-initial-value-condition-first-order-differential-equation/97203)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [April 8, 2023, 5:31am UTC](https://discourse.julialang.org/t/sympy-to-solve-initial-value-condition-first-order-differential-equation/97203 "2023-04-08T05:31:57Z")

</div>

Hi all, I want to check is my code correct to compute IVP of \\frac{dx}{dt} = \\sqrt{2g} \\frac{R}{\\sqrt{R+x}} the initial condition is x(0)=0 using SymPy @syms t, g, R @syms x() # Computing IVP with SymPy x(t).diff(t)…

---

## [Retrieving an instance of an enum using a string](https://discourse.julialang.org/t/retrieving-an-instance-of-an-enum-using-a-string/61183)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 6\
**Last updated:** [April 8, 2023, 3:19am UTC](https://discourse.julialang.org/t/retrieving-an-instance-of-an-enum-using-a-string/61183 "2023-04-08T03:19:50Z")

</div>

This has been posed, sort of, several times in Discourse or stackoverflow. For this example: @enum condition nil=5 mild sick severe It is easy to get the enum with an integer: julia\> condition(5) nil::condition = 5 I…

---

## [Efficient repeated sampling of small vector](https://discourse.julialang.org/t/efficient-repeated-sampling-of-small-vector/97093)

<div class="topic-metadata">

**Author:** [@PaterPen](https://discourse.julialang.org/u/PaterPen)\
**Replies:** 13\
**Last updated:** [April 8, 2023, 2:10am UTC](https://discourse.julialang.org/t/efficient-repeated-sampling-of-small-vector/97093 "2023-04-08T02:10:36Z")

</div>

Hi, my problem is simple: I am currently playing around with Multi-Armed Bandits and long story short in every iteration step I need to sample 10 iid. random variables (one for each arm). I noticed that it takes signifi…

---

## [Converting Tensorflow RNN to Flux](https://discourse.julialang.org/t/converting-tensorflow-rnn-to-flux/97236)

<div class="topic-metadata">

**Author:** [@Steve\_Lohrenz](https://discourse.julialang.org/u/Steve_Lohrenz)\
**Replies:** 0\
**Last updated:** [April 7, 2023, 8:09pm UTC](https://discourse.julialang.org/t/converting-tensorflow-rnn-to-flux/97236 "2023-04-07T20:09:13Z")

</div>

I am trying to create an RNN to predict the Google stock price based on the opening price for each day. I am following a tutorial where they do it in Tensorflow, and I am trying to do the same in Flux. My training data…

---

## [CUDA.jl crashes if a 4d FFT is asked](https://discourse.julialang.org/t/cuda-jl-crashes-if-a-4d-fft-is-asked/97165)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 2\
**Last updated:** [April 7, 2023, 9:42pm UTC](https://discourse.julialang.org/t/cuda-jl-crashes-if-a-4d-fft-is-asked/97165 "2023-04-07T21:42:04Z")

</div>

Hi, It seems that CUDA.jl and FFTW.jl do not work for Arrays with dimensions larger than 3: julia\> b = randn(8, 8, 8); julia\> cb = CuArray(b); julia\> fft(b); julia\> fft(cb); julia\> sum(fft(b) .- Array(fft(cb))) 3.31956…

---

## [Write data to Arrow file row by row](https://discourse.julialang.org/t/write-data-to-arrow-file-row-by-row/59165)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 7\
**Last updated:** [April 7, 2023, 9:31pm UTC](https://discourse.julialang.org/t/write-data-to-arrow-file-row-by-row/59165 "2023-04-07T21:31:06Z")

</div>

I have a large amount of data I am loading from an API and I would like to write the output of each call to a “row” of a file in order not to keep it in RAM/ in case the program errors. I have been using the Arrow.jl pac…

---

## [Can I SnoopPrecompile a Genie.jl app?](https://discourse.julialang.org/t/can-i-snoopprecompile-a-genie-jl-app/97202)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 3\
**Last updated:** [April 7, 2023, 7:51pm UTC](https://discourse.julialang.org/t/can-i-snoopprecompile-a-genie-jl-app/97202 "2023-04-07T19:51:07Z")

</div>

SnoopPrecompile can be used to precompile a set of function calls during package precompilation. As a Genie.jl app is a Julia project, I was wondering: Is it possible to package a Genie.jl app as a package, and thereby …

---

## [Open-source AI models, e.g. Vicuna close to ChatGPT; Julia applications](https://discourse.julialang.org/t/open-source-ai-models-e-g-vicuna-close-to-chatgpt-julia-applications/97115)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 4\
**Last updated:** [April 7, 2023, 6:46pm UTC](https://discourse.julialang.org/t/open-source-ai-models-e-g-vicuna-close-to-chatgpt-julia-applications/97115 "2023-04-07T18:46:44Z")

</div>

Stanford’s Alpaca lowered training cost to under $800, then came Koala, and now UC Berkeley improving more with Vicuna. It cost $300 to train, and I believe you can also get it for your local machine. It’s a bit slow for…

---

## [Constructing index with broadcasting operators vs loops](https://discourse.julialang.org/t/constructing-index-with-broadcasting-operators-vs-loops/97228)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 2\
**Last updated:** [April 7, 2023, 6:12pm UTC](https://discourse.julialang.org/t/constructing-index-with-broadcasting-operators-vs-loops/97228 "2023-04-07T18:12:47Z")

</div>

Hi, I am playing around with the following code and trying to find the most efficient way to construct indices based on a boolean condition: using BenchmarkTools, Random, Statistics; # Generate data n, m = 10^3, 5 fea…

---

## [How to plot solution from ODEProblem](https://discourse.julialang.org/t/how-to-plot-solution-from-odeproblem/97148)

<div class="topic-metadata">

**Author:** [@KZ-Spectra](https://discourse.julialang.org/u/KZ-Spectra)\
**Replies:** 4\
**Last updated:** [April 7, 2023, 5:56pm UTC](https://discourse.julialang.org/t/how-to-plot-solution-from-odeproblem/97148 "2023-04-07T17:56:35Z")

</div>

I am trying to plot the solution vector sol from the solver of an ODEProblem which is a 1432 element vector of 31x1 vectors. To do this, I attempted plotlyjs() y= sol.t z= \[abs(sol.u\[i\]\[j\])^2 for j=1:N₁, i=1:size(so…

---

## [Catalyst.jl VariableRateJump](https://discourse.julialang.org/t/catalyst-jl-variableratejump/97127)

<div class="topic-metadata">

**Author:** [@arnold-c](https://discourse.julialang.org/u/arnold-c)\
**Replies:** 5\
**Last updated:** [April 7, 2023, 1:48pm UTC](https://discourse.julialang.org/t/catalyst-jl-variableratejump/97127 "2023-04-07T13:48:02Z")

</div>

I’m trying to code up a JumpProcess of an SIR-style model that includes a VariableRateJump e.g. the transmission parameter varies throughout the year in a sinusoidal fashion. I have what I think is working code manually …

---

## [Has the categorical! function in DataFrames.jl been relegated?](https://discourse.julialang.org/t/has-the-categorical-function-in-dataframes-jl-been-relegated/97196)

<div class="topic-metadata">

**Author:** [@rud-lucien](https://discourse.julialang.org/u/rud-lucien)\
**Replies:** 2\
**Last updated:** [April 7, 2023, 1:23pm UTC](https://discourse.julialang.org/t/has-the-categorical-function-in-dataframes-jl-been-relegated/97196 "2023-04-07T13:23:50Z")

</div>

Hi, I was looking around for a quick way to convert columns of data in a DataFrame into categorical data and found and example in this link. However, when I tried it in my REPL, it didn’t work. Just wondering if this f…

---

## [Please help me out with this error](https://discourse.julialang.org/t/please-help-me-out-with-this-error/97206)

<div class="topic-metadata">

**Author:** [@Joosung\_Park](https://discourse.julialang.org/u/Joosung_Park)\
**Replies:** 5\
**Last updated:** [April 7, 2023, 1:18pm UTC](https://discourse.julialang.org/t/please-help-me-out-with-this-error/97206 "2023-04-07T13:18:58Z")

</div>

im trying to plot a graph using this code : plot(θ\_range, periods, xlabel=“Amplitude (rad)”, ylabel=“Period (s)”, legend=false) but it there is an error saying possible method call error. i tried reinstalling the packa…

---

## [Adding performant runtime dispatch to Julia](https://discourse.julialang.org/t/adding-performant-runtime-dispatch-to-julia/97214)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 3\
**Last updated:** [April 7, 2023, 12:54pm UTC](https://discourse.julialang.org/t/adding-performant-runtime-dispatch-to-julia/97214 "2023-04-07T12:54:53Z")

</div>

While Julia’s compile-time dispatch serves Julia users well, in some cases, runtime dispatch is needed. Runtime dispatch in Julia is not designed to be performant. This proposal attempts to add a limited dispatching (inc…

---

## [ProgressMeter in VSCode Jupyter Notebooks](https://discourse.julialang.org/t/progressmeter-in-vscode-jupyter-notebooks/97133)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 5\
**Last updated:** [April 7, 2023, 11:50am UTC](https://discourse.julialang.org/t/progressmeter-in-vscode-jupyter-notebooks/97133 "2023-04-07T11:50:05Z")

</div>

I am trying to use ProgressMeter and @showprogress in VS Code inside of a Jupyter notebook. When I do, I get many progress bars printed out in succession: This is not what happens when I use Jupyter notebooks in the …

---

## [Incorporating \`methodswith\`](https://discourse.julialang.org/t/incorporating-methodswith/95245)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 3\
**Last updated:** [April 7, 2023, 9:22am UTC](https://discourse.julialang.org/t/incorporating-methodswith/95245 "2023-04-07T09:22:15Z")

</div>

When programming in C++ or Rust or Python, we can just click . and obtain a list of available methods for an object. Since Julia is based on multiple dispatch, there is no such thing as obj.method(). But is it possible t…

---

## [If-else loop failure for a large array](https://discourse.julialang.org/t/if-else-loop-failure-for-a-large-array/97180)

<div class="topic-metadata">

**Author:** [@Sh\_166](https://discourse.julialang.org/u/Sh_166)\
**Replies:** 5\
**Last updated:** [April 7, 2023, 8:22am UTC](https://discourse.julialang.org/t/if-else-loop-failure-for-a-large-array/97180 "2023-04-07T08:22:24Z")

</div>

I have the following code: if sol\[5,i\] - sol\_1\[5,i\] \>= 0.0 s\[i\] = sol\[5,i\] - sol\_1\[5,i\] else s\[i\] = sol\_1\[5,i\] - sol\[5,i\] end end Now, here, sol and sol\_1 correspond to 2 solutions I have fr…

---

## [Example for the type T3 \[see its definition in the message\]?](https://discourse.julialang.org/t/example-for-the-type-t3-see-its-definition-in-the-message/97051)

<div class="topic-metadata">

**Author:** [@Antonio\_De\_Felice](https://discourse.julialang.org/u/Antonio_De_Felice)\
**Replies:** 7\
**Last updated:** [April 7, 2023, 8:22am UTC](https://discourse.julialang.org/t/example-for-the-type-t3-see-its-definition-in-the-message/97051 "2023-04-07T08:22:00Z")

</div>

I’m really new to Julia, sorry about it. After following the docs regarding Types, I was wondering how to build an explicit example, if possible, for the following type: const T3 = Array{Array{T, 1} where T \<: Real, 1} …

---

## [How do you iterate over a vector of ranges of different lengths?](https://discourse.julialang.org/t/how-do-you-iterate-over-a-vector-of-ranges-of-different-lengths/97181)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [April 6, 2023, 11:23pm UTC](https://discourse.julialang.org/t/how-do-you-iterate-over-a-vector-of-ranges-of-different-lengths/97181 "2023-04-06T23:23:40Z")

</div>

So I have an arbitrary vector of ranges julia\> kthNvals(k) = (1:(2^k)) .- 1; julia\> kthNvals.(1:4) 4-element Vector{UnitRange{Int64}}: 0:1 0:3 0:7 0:15 I need to generate all the vectors where each index is a val…

---

## [Anonymous function passed as a string gets overwritten](https://discourse.julialang.org/t/anonymous-function-passed-as-a-string-gets-overwritten/97195)

<div class="topic-metadata">

**Author:** [@oliviermilla](https://discourse.julialang.org/u/oliviermilla)\
**Replies:** 3\
**Last updated:** [April 6, 2023, 10:51pm UTC](https://discourse.julialang.org/t/anonymous-function-passed-as-a-string-gets-overwritten/97195 "2023-04-06T22:51:34Z")

</div>

Hello julians, I face a little puzzle in Julia that I can’t figure out. The code is straightforward: function tada(period::Union{Nothing,Type{T}}=nothing) where {T\<:Period}) key = Vector{Function}() p = Symbol(…

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

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