# Latest

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

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

**Page:** 707

---

## [We need a vs code plugin that could save ChatGPT questions, responses and user corrections](https://discourse.julialang.org/t/we-need-a-vs-code-plugin-that-could-save-chatgpt-questions-responses-and-user-corrections/98504)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 4\
**Last updated:** [May 9, 2023, 12:57am UTC](https://discourse.julialang.org/t/we-need-a-vs-code-plugin-that-could-save-chatgpt-questions-responses-and-user-corrections/98504 "2023-05-09T00:57:53Z")

</div>

I know that posting ideas really is not all the helpful but I’m going to throw it out there anyways as I really lack the skills to lead something like this but I think it’s really important. The largest impediment to th…

---

## [Embedding Julia code in C](https://discourse.julialang.org/t/embedding-julia-code-in-c/98507)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 4\
**Last updated:** [May 9, 2023, 12:13am UTC](https://discourse.julialang.org/t/embedding-julia-code-in-c/98507 "2023-05-09T00:13:10Z")

</div>

Hi there, I am trying to compile a simple C program that calls a Julia base function. However, it is not compiling. The C code reads as “”" #include \<stdio.h\> #include \<julia.h\> int main(){ jl\_init(); int index\_ve…

---

## [Pi (Π) operation in the objective function JuMP](https://discourse.julialang.org/t/pi-operation-in-the-objective-function-jump/97509)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 19\
**Last updated:** [May 8, 2023, 11:55pm UTC](https://discourse.julialang.org/t/pi-operation-in-the-objective-function-jump/97509 "2023-05-08T23:55:42Z")

</div>

I want to solve a quadratic programming problem with JuMP. I don’t know if Ipopt can solve it or not. I’m using HiGHS (Although I prefer Ipopt if it’s possible). Here is the model: \\eqalign{ & \\max z = \\prod\\limits\_{…

---

## [\[ANN\] PythonCall and JuliaCall](https://discourse.julialang.org/t/ann-pythoncall-and-juliacall/76778)

<div class="topic-metadata">

**Author:** [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Replies:** 84\
**Last updated:** [May 8, 2023, 11:35pm UTC](https://discourse.julialang.org/t/ann-pythoncall-and-juliacall/76778 "2023-05-08T23:35:55Z")

</div>

PythonCall & JuliaCall I’m very pleased to finally announce these packages on here. They have existed for quite some time, but I’m now happy to encourage more users to try them out. PythonCall is a Julia package to inte…

---

## [HDF5 utilising only a fraction of available system resources](https://discourse.julialang.org/t/hdf5-utilising-only-a-fraction-of-available-system-resources/98481)

<div class="topic-metadata">

**Author:** [@silkskier](https://discourse.julialang.org/u/silkskier)\
**Replies:** 5\
**Last updated:** [May 8, 2023, 10:41pm UTC](https://discourse.julialang.org/t/hdf5-utilising-only-a-fraction-of-available-system-resources/98481 "2023-05-08T22:41:37Z")

</div>

I’ve recently written a simple script converting the OCVS (OGLE Collection of Variable Stars) database (which is basically a single text file containing a list of attributes of every star in the collection) and a large a…

---

## [Create array of empty (separate) vectors](https://discourse.julialang.org/t/create-array-of-empty-separate-vectors/98493)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 5\
**Last updated:** [May 8, 2023, 10:27pm UTC](https://discourse.julialang.org/t/create-array-of-empty-separate-vectors/98493 "2023-05-08T22:27:56Z")

</div>

I want to initialise a number of (in this case empty) vectors. However, if I do e.g. x = fill(\[\],4) push!(x\[1\],3) x\[2\] I get \[3\]. Basically, I put in the same vector 4 times, so now when I modify one, I modify all. Wh…

---

## [Randomized SVD](https://discourse.julialang.org/t/randomized-svd/98488)

<div class="topic-metadata">

**Author:** [@Desmond](https://discourse.julialang.org/u/Desmond)\
**Replies:** 6\
**Last updated:** [May 8, 2023, 10:25pm UTC](https://discourse.julialang.org/t/randomized-svd/98488 "2023-05-08T22:25:37Z")

</div>

I am implement the randomized SVD without power iteration and I am just getting a black and white dots as the output of the SVD. I can’t seem to spot the problem. Here is the code function rsvd(X,k) (m,n)=size(X) …

---

## [Using literal 1.0 in JuMP @constraint throws an error](https://discourse.julialang.org/t/using-literal-1-0-in-jump-constraint-throws-an-error/98496)

<div class="topic-metadata">

**Author:** [@gmsowers](https://discourse.julialang.org/u/gmsowers)\
**Replies:** 2\
**Last updated:** [May 8, 2023, 9:58pm UTC](https://discourse.julialang.org/t/using-literal-1-0-in-jump-constraint-throws-an-error/98496 "2023-05-08T21:58:00Z")

</div>

The following code throws an error: using JuMP m = Model() @variable(m, x) y = Vector{Any}(undef, 2) y\[1\] = @variable(m, base\_name=“y1”) y\[2\] = 1.0 @constraint(m, sum(\[x \* yi for yi in y\]) == 1.0) ERROR: MethodError:…

---

## [Help with GAMS.jl "unrecognized operation" error](https://discourse.julialang.org/t/help-with-gams-jl-unrecognized-operation-error/98498)

<div class="topic-metadata">

**Author:** [@Huan\_Deng](https://discourse.julialang.org/u/Huan_Deng)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 9:26pm UTC](https://discourse.julialang.org/t/help-with-gams-jl-unrecognized-operation-error/98498 "2023-05-08T21:26:56Z")

</div>

Hi, I am trying to use GAMS to solve a constrained optimization problem. My own problem is quite complicated, and I must use user-defined functions for both the objective and constraints. Below is a reproducible, simple…

---

## [Help with multi-objective, non-linear JuMP problem](https://discourse.julialang.org/t/help-with-multi-objective-non-linear-jump-problem/98487)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 9:13pm UTC](https://discourse.julialang.org/t/help-with-multi-objective-non-linear-jump-problem/98487 "2023-05-08T21:13:29Z")

</div>

This single objective version below works just fine: using JuMP using Ipopt S, L, U = 1000, 15, 40 N = 54 r = rand(54, 2) model = Model(Ipopt.Optimizer) @variable(model, s\[i=1:N\], start=14) @NLexpression…

---

## [Current directory @\_\_DIR\_\_](https://discourse.julialang.org/t/current-directory-dir/98502)

<div class="topic-metadata">

**Author:** [@sirion34](https://discourse.julialang.org/u/sirion34)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 7:34pm UTC](https://discourse.julialang.org/t/current-directory-dir/98502 "2023-05-08T19:34:51Z")

</div>

How do i make julia think she is in a specific directory? exe = """ begin @info @\_\_DIR\_\_ @info pwd() end """ cmd = Base.julia\_cmd() cmd = \`$cmd -e $exe\` procs = open(cmd) I need to be able to …

---

## [Adding Plotly Traces to an Array](https://discourse.julialang.org/t/adding-plotly-traces-to-an-array/75889)

<div class="topic-metadata">

**Author:** [@pimler73](https://discourse.julialang.org/u/pimler73)\
**Replies:** 6\
**Last updated:** [May 8, 2023, 7:33pm UTC](https://discourse.julialang.org/t/adding-plotly-traces-to-an-array/75889 "2023-05-08T19:33:22Z")

</div>

I am attempting to plot multiple traces using the PlotlyJS backend and there are too many to do manually. My idea is to do something of the sort: for idx in 1:size(data)\[2\] traces\[idx\] = scatter(x=r\_range, …

---

## [To have a conversation requires not to shut it down](https://discourse.julialang.org/t/to-have-a-conversation-requires-not-to-shut-it-down/98491)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 27\
**Last updated:** [May 8, 2023, 7:31pm UTC](https://discourse.julialang.org/t/to-have-a-conversation-requires-not-to-shut-it-down/98491 "2023-05-08T19:31:58Z")

</div>

---

## [\[ANN\] ObjectPools.jl](https://discourse.julialang.org/t/ann-objectpools-jl/98497)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 0\
**Last updated:** [May 8, 2023, 5:38pm UTC](https://discourse.julialang.org/t/ann-objectpools-jl/98497 "2023-05-08T17:38:23Z")

</div>

ObjectPools.jl is a small package that enables convenient semi-manual memory management. It has proven to be very useful in my own work hence I’ve spun it out into a separate package which I just registered in General. …

---

## [Avoiding computing inverse of matrix, don't think it's possible in my case](https://discourse.julialang.org/t/avoiding-computing-inverse-of-matrix-dont-think-its-possible-in-my-case/98478)

<div class="topic-metadata">

**Author:** [@p\_f](https://discourse.julialang.org/u/p_f)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 4:03pm UTC](https://discourse.julialang.org/t/avoiding-computing-inverse-of-matrix-dont-think-its-possible-in-my-case/98478 "2023-05-08T16:03:53Z")

</div>

I have a system of (6+3N) equations given by: A\*inv(B)\*C\*dX = K which I then solve using dX = (A\*inv(B)\*C) \\ K A\*inv(B)\*C form a square (6+3N) matrix but the submatrices have sizes: A: (6+3N) x (6N) B: (6N) x (6N) …

---

## [How to find the local extrema of the solutions when solving a differential equation？](https://discourse.julialang.org/t/how-to-find-the-local-extrema-of-the-solutions-when-solving-a-differential-equation/94628)

<div class="topic-metadata">

**Author:** [@YiboXia](https://discourse.julialang.org/u/YiboXia)\
**Replies:** 15\
**Last updated:** [May 8, 2023, 3:48pm UTC](https://discourse.julialang.org/t/how-to-find-the-local-extrema-of-the-solutions-when-solving-a-differential-equation/94628 "2023-05-08T15:48:40Z")

</div>

Hello guys, I got a problem when I want to calculate the local extrema in an ODE. I did the following steps: define the ODE problem; define a integrator integ; take 2000 successful step ahead to insure the trajectory …

---

## [Food for thought for the AI fans](https://discourse.julialang.org/t/food-for-thought-for-the-ai-fans/98473)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [May 8, 2023, 3:44pm UTC](https://discourse.julialang.org/t/food-for-thought-for-the-ai-fans/98473 "2023-05-08T15:44:56Z")

</div>

---

## [Disabling zoom events for PlotlyJS backend for Plots.jl](https://discourse.julialang.org/t/disabling-zoom-events-for-plotlyjs-backend-for-plots-jl/97340)

<div class="topic-metadata">

**Author:** [@viperML](https://discourse.julialang.org/u/viperML)\
**Replies:** 2\
**Last updated:** [May 8, 2023, 3:42pm UTC](https://discourse.julialang.org/t/disabling-zoom-events-for-plotlyjs-backend-for-plots-jl/97340 "2023-05-08T15:42:07Z")

</div>

Hello :wave: I would like to disable zoom events for my interactive plot. Apparently you can do this with plotly.js by setting this layout option: Disable zoom events in JavaScript xaxis: {fixedrange: true} Is it poss…

---

## [Problem with CI of documentation](https://discourse.julialang.org/t/problem-with-ci-of-documentation/98480)

<div class="topic-metadata">

**Author:** [@vladdez](https://discourse.julialang.org/u/vladdez)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 3:26pm UTC](https://discourse.julialang.org/t/problem-with-ci-of-documentation/98480 "2023-05-08T15:26:12Z")

</div>

Hi! I am trying to deploy my own library, but I have a problem with GitHub Actions: CI.yaml and docs.yaml do not work. And … it’s even hard to explain what is the problem. Here are some screenshots: error in build and…

---

## [Tracking the cause of allocation in the presence of a generated function](https://discourse.julialang.org/t/tracking-the-cause-of-allocation-in-the-presence-of-a-generated-function/98215)

<div class="topic-metadata">

**Author:** [@mateuszbaran](https://discourse.julialang.org/u/mateuszbaran)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 2:04pm UTC](https://discourse.julialang.org/t/tracking-the-cause-of-allocation-in-the-presence-of-a-generated-function/98215 "2023-05-08T14:04:42Z")

</div>

I have some trouble tracking why the following code allocates: julia\> using HybridArrays, StaticArrays \[ Info: Precompiling HybridArrays \[1baab800-613f-4b0a-84e4-9cd3431bfbb9\] julia\> using BenchmarkTools julia\> H = Hy…

---

## [Writing a neural network training code with ADAM optimizer](https://discourse.julialang.org/t/writing-a-neural-network-training-code-with-adam-optimizer/98472)

<div class="topic-metadata">

**Author:** [@Vahagn](https://discourse.julialang.org/u/Vahagn)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 2:00pm UTC](https://discourse.julialang.org/t/writing-a-neural-network-training-code-with-adam-optimizer/98472 "2023-05-08T14:00:20Z")

</div>

I have a code for my DSGE model and I want to find decision functions using neural networks, namely using deep learning with ADAM optimizer. I read the quick start example in Flux, but I, unfortunately, I don’t know how …

---

## [Very slow time to first plot, 2022](https://discourse.julialang.org/t/very-slow-time-to-first-plot-2022/88968)

<div class="topic-metadata">

**Author:** [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Replies:** 72\
**Last updated:** [May 8, 2023, 10:08am UTC](https://discourse.julialang.org/t/very-slow-time-to-first-plot-2022/88968 "2023-05-08T10:08:17Z")

</div>

Obviously, we all know this question has been asked numerous times. I am using latest Julia 1.8, and in my current research I am using Julia Makie/AlgebraOfGraphics for most of the analytics and plotting, and I am encou…

---

## [Using Flux: gradient on DifferentialEquations: solve results in an error](https://discourse.julialang.org/t/using-flux-gradient-on-differentialequations-solve-results-in-an-error/79564)

<div class="topic-metadata">

**Author:** [@vtac](https://discourse.julialang.org/u/vtac)\
**Replies:** 11\
**Last updated:** [May 8, 2023, 9:56am UTC](https://discourse.julialang.org/t/using-flux-gradient-on-differentialequations-solve-results-in-an-error/79564 "2023-05-08T09:56:27Z")

</div>

I am trying to take the derivative of a function that is defined as the solution of an ODE. But gradient throws an error: using Flux: gradient using DifferentialEquations: Tsit5, ODEProblem, solve using DiffEqSensitivit…

---

## [Is it ok to write interfaces that require field access on subtypes?](https://discourse.julialang.org/t/is-it-ok-to-write-interfaces-that-require-field-access-on-subtypes/98429)

<div class="topic-metadata">

**Author:** [@aleferna12](https://discourse.julialang.org/u/aleferna12)\
**Replies:** 6\
**Last updated:** [May 8, 2023, 9:12am UTC](https://discourse.julialang.org/t/is-it-ok-to-write-interfaces-that-require-field-access-on-subtypes/98429 "2023-05-08T09:12:04Z")

</div>

Hello! Since we can’t define fields on abstract types (at least yet, see this very long discussion), I was wondering whether the following design pattern is considered good practice in Julia: abstract type A end struc…

---

## [Performance of function with pre-allocated outputs](https://discourse.julialang.org/t/performance-of-function-with-pre-allocated-outputs/98457)

<div class="topic-metadata">

**Author:** [@jekyllstein](https://discourse.julialang.org/u/jekyllstein)\
**Replies:** 3\
**Last updated:** [May 8, 2023, 8:19am UTC](https://discourse.julialang.org/t/performance-of-function-with-pre-allocated-outputs/98457 "2023-05-08T08:19:37Z")

</div>

Consider the following mutating function that mutates a vector input: function f\_test!(xout::Vector{T}, a::T, b::T) where T \<: Real xout .= a .\* b view(xout, 1:max(1, lastindex(xout)-5)) .-= b return xout end I time…

---

## [IOError undocumented](https://discourse.julialang.org/t/ioerror-undocumented/98156)

<div class="topic-metadata">

**Author:** [@screw\_dog](https://discourse.julialang.org/u/screw_dog)\
**Replies:** 1\
**Last updated:** [May 8, 2023, 7:34am UTC](https://discourse.julialang.org/t/ioerror-undocumented/98156 "2023-05-08T07:34:58Z")

</div>

The Base.Filesystem module tends to throw IOError exceptions but these aren’t documented at all. I want to be able to catch these and determine the exact problem (ie incorrect permissions, file doesn’t exist, etc) but th…

---

## [Kernel density estimation status](https://discourse.julialang.org/t/kernel-density-estimation-status/5928)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 30\
**Last updated:** [May 7, 2023, 6:42pm UTC](https://discourse.julialang.org/t/kernel-density-estimation-status/5928 "2023-05-07T18:42:46Z")

</div>

What is the de facto standard package for KDE in Julia? KernelDensity.jl KernelDensityEstimate.jl KernelEstimator.jl My attempts with the packages listed above were not very successful.

---

## [Stereo audio in PortAudio.jl](https://discourse.julialang.org/t/stereo-audio-in-portaudio-jl/98455)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 2\
**Last updated:** [May 8, 2023, 3:52am UTC](https://discourse.julialang.org/t/stereo-audio-in-portaudio-jl/98455 "2023-05-08T03:52:46Z")

</div>

How do I play stereo audio using PortAudio? Here, I have two tones s1 and s2. I want to play one on the right speaker, on on the left. This plays only s1 in both speakers. using PortAudio s1 = 2 \* pi \* (1 : 2 \* 12\_000…

---

## [\[ANN\] PrivateFields.jl](https://discourse.julialang.org/t/ann-privatefields-jl/98454)

<div class="topic-metadata">

**Author:** [@sbuercklin](https://discourse.julialang.org/u/sbuercklin)\
**Replies:** 0\
**Last updated:** [May 8, 2023, 1:43am UTC](https://discourse.julialang.org/t/ann-privatefields-jl/98454 "2023-05-08T01:43:37Z")

</div>

GitHub link: GitHub - SBuercklin/PrivateFields.jl: No touching! (should land on the General Registry in ~3 days from posting) Overview PrivateFields.jl implements the @private\_struct, @private\_method macros. @private\_s…

---

## [Decomposing struct in function argument](https://discourse.julialang.org/t/decomposing-struct-in-function-argument/97468)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 12:06am UTC](https://discourse.julialang.org/t/decomposing-struct-in-function-argument/97468 "2023-05-08T00:06:08Z")

</div>

is it possible to to something like this? struct X a b end f((a,b)::X) = a+b

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

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