# Latest

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

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

**Page:** 523

---

## [Does libjulia support dynamic reinitialization?](https://discourse.julialang.org/t/does-libjulia-support-dynamic-reinitialization/108035)

<div class="topic-metadata">

**Author:** [@Yurii\_Hamann](https://discourse.julialang.org/u/Yurii_Hamann)\
**Replies:** 4\
**Last updated:** [December 27, 2023, 1:12pm UTC](https://discourse.julialang.org/t/does-libjulia-support-dynamic-reinitialization/108035 "2023-12-27T13:12:44Z")

</div>

I need a dynamic Julia re-initialization but I guess it’s not supported or there is a bug in the libjulia because in the example below variable x keeps it’s previous value after second jl\_init call. #include \<julia.h\> #…

---

## [Need a simple backend for plots inside pluto that support click event when plotting implicit equations](https://discourse.julialang.org/t/need-a-simple-backend-for-plots-inside-pluto-that-support-click-event-when-plotting-implicit-equations/107862)

<div class="topic-metadata">

**Author:** [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Replies:** 1\
**Last updated:** [December 27, 2023, 10:32am UTC](https://discourse.julialang.org/t/need-a-simple-backend-for-plots-inside-pluto-that-support-click-event-when-plotting-implicit-equations/107862 "2023-12-27T10:32:19Z")

</div>

hello I want to get coordinates of implicit equations plot and pass it to a function, I have found using plots; plotlyjs() can do this but it doesn’t work inside pluto. Currently I use plotly backend and it gives a pop…

---

## [@view : No bound checkings?](https://discourse.julialang.org/t/view-no-bound-checkings/108068)

<div class="topic-metadata">

**Author:** [@hlbnet](https://discourse.julialang.org/u/hlbnet)\
**Replies:** 13\
**Last updated:** [December 27, 2023, 9:04am UTC](https://discourse.julialang.org/t/view-no-bound-checkings/108068 "2023-12-27T09:04:01Z")

</div>

I am trying the following code. v = Vector{Int8}(1:10) w = @view v\[3:8\] deleteat!(v, 3:8) println(v) w\[4\] = 42 println(w) The result is this: Int8\[1, 2, 9, 10\] Int8\[9, 10, 0, 42, 7, 8\] My question is about the second…

---

## [Error when run GRETNA in MATLAB](https://discourse.julialang.org/t/error-when-run-gretna-in-matlab/108083)

<div class="topic-metadata">

**Author:** [@Sally](https://discourse.julialang.org/u/Sally)\
**Replies:** 5\
**Last updated:** [December 27, 2023, 7:42am UTC](https://discourse.julialang.org/t/error-when-run-gretna-in-matlab/108083 "2023-12-27T07:42:25Z")

</div>

Hello everyone, I use MacBook Pro M1 with macOS 14.2.1. When I run GRETNA in MATLAB, the following error message appears: Referenced from: \<91A4AFCA-5C23-6A30-FB8C-A4C2CD09609E\> /Users/mymatalbtoolbox/GRETNA-2.0.0\_re…

---

## [Flux loss with contribution gradient is slow](https://discourse.julialang.org/t/flux-loss-with-contribution-gradient-is-slow/107956)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 5\
**Last updated:** [December 27, 2023, 5:20am UTC](https://discourse.julialang.org/t/flux-loss-with-contribution-gradient-is-slow/107956 "2023-12-27T05:20:29Z")

</div>

I am trying to replicate some computations on solving PDEs with neural networks (the committor problem, see \[1802.10275\] Solving for high dimensional committor functions using artificial neural networks). This involves …

---

## [StaticCompiler - how to handle integer division error?](https://discourse.julialang.org/t/staticcompiler-how-to-handle-integer-division-error/108061)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [December 27, 2023, 3:17am UTC](https://discourse.julialang.org/t/staticcompiler-how-to-handle-integer-division-error/108061 "2023-12-27T03:17:18Z")

</div>

StaticCompiler.jl does not allow exceptions. I got stuck trying to compile code involving the mod operator %, as it can raise an exception DivideError if you’re dividing by zero. How can I work around this?

---

## [Rand in Julia vs MATLAB](https://discourse.julialang.org/t/rand-in-julia-vs-matlab/6505)

<div class="topic-metadata">

**Author:** [@rohith14](https://discourse.julialang.org/u/rohith14)\
**Replies:** 10\
**Last updated:** [December 27, 2023, 3:13am UTC](https://discourse.julialang.org/t/rand-in-julia-vs-matlab/6505 "2023-12-27T03:13:33Z")

</div>

Hi, Based on this issue, https://github.com/JuliaLang/julia/issues/8606, I see we are generating different random number sequence in Julia and MATLAB. Is their a way to get same random numbers in both languages ? I se…

---

## [Flux.withgradient() doesn't work in a CUDA kernel](https://discourse.julialang.org/t/flux-withgradient-doesnt-work-in-a-cuda-kernel/108076)

<div class="topic-metadata">

**Author:** [@ily.idli](https://discourse.julialang.org/u/ily.idli)\
**Replies:** 0\
**Last updated:** [December 27, 2023, 1:24am UTC](https://discourse.julialang.org/t/flux-withgradient-doesnt-work-in-a-cuda-kernel/108076 "2023-12-27T01:24:53Z")

</div>

Hi all, I’m adapting some work for approximations of the Hilbert-Schmidt Independence Criterion (HSIC) from Python to Julia, and part of the code involves optimising which samples should be taken and what the widths of …

---

## [Round off decision variable](https://discourse.julialang.org/t/round-off-decision-variable/107988)

<div class="topic-metadata">

**Author:** [@quais](https://discourse.julialang.org/u/quais)\
**Replies:** 2\
**Last updated:** [December 26, 2023, 8:50pm UTC](https://discourse.julialang.org/t/round-off-decision-variable/107988 "2023-12-26T20:50:57Z")

</div>

Hey, is there a way to round off decision variables? I initialized the following variable, which is given in hours: n = 4 model = Model() @variable(model, start\_n\[1:n\] \>= 0, Int) In one of my cost functions, however, I…

---

## [Unable to create vector out of AffExpr in some cases](https://discourse.julialang.org/t/unable-to-create-vector-out-of-affexpr-in-some-cases/107968)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 3\
**Last updated:** [December 26, 2023, 9:09pm UTC](https://discourse.julialang.org/t/unable-to-create-vector-out-of-affexpr-in-some-cases/107968 "2023-12-26T21:09:51Z")

</div>

MWE: using JuMP model = Model() x1 = @variable(model, base\_name = "x1") x2 = x1 + 1 x3::AffExpr = x1 # Works: x1 is of type VariableRef v1 = \[sin(x1), x1\] # Works: x2 is of type AffExpr v2 = \[sin(x1), x2\] # Does not …

---

## [Potential Bug in Optimization.jl](https://discourse.julialang.org/t/potential-bug-in-optimization-jl/108066)

<div class="topic-metadata">

**Author:** [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Replies:** 1\
**Last updated:** [December 26, 2023, 7:17pm UTC](https://discourse.julialang.org/t/potential-bug-in-optimization-jl/108066 "2023-12-26T19:17:21Z")

</div>

Here is my code which utilizes Optimization.jl and ModelingToolkit.jl: using BenchmarkTools, Optimization, OptimizationNLopt, ModelingToolkit function func\_1(x0,p) sse = sum(x0) + p\[1\] return sse end funct…

---

## [\[ANN\] VectorizationTransformations.jl](https://discourse.julialang.org/t/ann-vectorizationtransformations-jl/108069)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 2\
**Last updated:** [December 26, 2023, 7:11pm UTC](https://discourse.julialang.org/t/ann-vectorizationtransformations-jl/108069 "2023-12-26T19:11:35Z")

</div>

I was working through a new econometric estimator and found that it made extensive usage of matrix vectorization operators like vech and moving between vec and vech. I could not find implementations of them anywhere so I…

---

## [How to programmatically create symbolic variable names in Symbolics.jl](https://discourse.julialang.org/t/how-to-programmatically-create-symbolic-variable-names-in-symbolics-jl/96948)

<div class="topic-metadata">

**Author:** [@pluie](https://discourse.julialang.org/u/pluie)\
**Replies:** 7\
**Last updated:** [December 26, 2023, 5:58pm UTC](https://discourse.julialang.org/t/how-to-programmatically-create-symbolic-variable-names-in-symbolics-jl/96948 "2023-12-26T17:58:16Z")

</div>

Essentially, I am looping over indices and I need to use those indices to create symbolic variable names. A simplified version of what I am trying to do as shown using SymPy: vars=\[\] for i=1:5 for j=2:7 push!…

---

## [Understanding ModelingToolkit connectors and components](https://discourse.julialang.org/t/understanding-modelingtoolkit-connectors-and-components/107783)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 9\
**Last updated:** [December 26, 2023, 5:48pm UTC](https://discourse.julialang.org/t/understanding-modelingtoolkit-connectors-and-components/107783 "2023-12-26T17:48:35Z")

</div>

Context As discussed in Broadcast inside of \`@mtkmodel\` macro causes precompilation failures when put into a package - #11 by BambOoxX, I’m trying to define mtkmodels to model a moving rigid body submitted to some actio…

---

## [Mutable struct assignment overloading / fast management of temporaries in expression](https://discourse.julialang.org/t/mutable-struct-assignment-overloading-fast-management-of-temporaries-in-expression/108056)

<div class="topic-metadata">

**Author:** [@mattsignorelli](https://discourse.julialang.org/u/mattsignorelli)\
**Replies:** 2\
**Last updated:** [December 26, 2023, 3:01pm UTC](https://discourse.julialang.org/t/mutable-struct-assignment-overloading-fast-management-of-temporaries-in-expression/108056 "2023-12-26T15:01:28Z")

</div>

I’m creating a package which interfaces to a C library with C structs, and implements all the operator overloading for these structs. For example it looks a bit like mutable struct MyStruct t::Ptr{CStruct} # Constru…

---

## [Avoid downloading MKL artifact as FFTW dependency](https://discourse.julialang.org/t/avoid-downloading-mkl-artifact-as-fftw-dependency/108054)

<div class="topic-metadata">

**Author:** [@Vasily\_Pisarev](https://discourse.julialang.org/u/Vasily_Pisarev)\
**Replies:** 2\
**Last updated:** [December 26, 2023, 2:15pm UTC](https://discourse.julialang.org/t/avoid-downloading-mkl-artifact-as-fftw-dependency/108054 "2023-12-26T14:15:07Z")

</div>

I am developing a package that uses FFTW. Changing Manifest.toml by adding or removing packages triggers precompilation of all dependencies, during which MKL\_jll downloads MKL binary. BUT MKL in my case is only an opti…

---

## [Error during package installation (ADCME)](https://discourse.julialang.org/t/error-during-package-installation-adcme/107824)

<div class="topic-metadata">

**Author:** [@jsbyrnes](https://discourse.julialang.org/u/jsbyrnes)\
**Replies:** 6\
**Last updated:** [December 26, 2023, 1:53pm UTC](https://discourse.julialang.org/t/error-during-package-installation-adcme/107824 "2023-12-26T13:53:54Z")

</div>

I am attempting to install the package ADCME, which is installed when installing ADSeismic. I get an error with ADCME ERROR: Error building ADSeismic: ERROR: LoadError: ADCME is not properly built; run Pkg.build("ADCME…

---

## [Example of index.jl for static-export-template with links to notebooks](https://discourse.julialang.org/t/example-of-index-jl-for-static-export-template-with-links-to-notebooks/108051)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 1\
**Last updated:** [December 26, 2023, 1:39pm UTC](https://discourse.julialang.org/t/example-of-index-jl-for-static-export-template-with-links-to-notebooks/108051 "2023-12-26T13:39:24Z")

</div>

Is there a working example of index.jl for static-export-template? I am struggling to get the index links working.

---

## [Best practice to document non-API functions](https://discourse.julialang.org/t/best-practice-to-document-non-api-functions/108025)

<div class="topic-metadata">

**Author:** [@David\_Sagan](https://discourse.julialang.org/u/David_Sagan)\
**Replies:** 5\
**Last updated:** [December 26, 2023, 11:59am UTC](https://discourse.julialang.org/t/best-practice-to-document-non-api-functions/108025 "2023-12-26T11:59:17Z")

</div>

I am developing a rather large package that will have a substantial number of functions that are low level and not part of the API. I am new to Julia and am not sure the best way of documenting these. I could write doc s…

---

## [How to extract data from pdf with two columns](https://discourse.julialang.org/t/how-to-extract-data-from-pdf-with-two-columns/108008)

<div class="topic-metadata">

**Author:** [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Replies:** 6\
**Last updated:** [December 26, 2023, 11:59am UTC](https://discourse.julialang.org/t/how-to-extract-data-from-pdf-with-two-columns/108008 "2023-12-26T11:59:09Z")

</div>

I am trying to extract text from a pdf using PDFIO.jl. Problem is that some slides have text on double columns, and the extraction with the provided example fails to reconstruct the text the proper way. For example usin…

---

## [Higher order derivatives/ automatic differentiation](https://discourse.julialang.org/t/higher-order-derivatives-automatic-differentiation/107936)

<div class="topic-metadata">

**Author:** [@ayushinav](https://discourse.julialang.org/u/ayushinav)\
**Replies:** 5\
**Last updated:** [December 26, 2023, 10:05am UTC](https://discourse.julialang.org/t/higher-order-derivatives-automatic-differentiation/107936 "2023-12-26T10:05:01Z")

</div>

Tldr: Getting gradients for training PINNs for higher order ODEs/PDEs. There’s a certain Diff Eq I want to solve using PINNs. Let’s say a damped harmonic oscillator: u''(t)+ \\mu u'(t)+ k u(t)= 0 with a Dirichlet BC (u…

---

## [Here's a fun thing](https://discourse.julialang.org/t/heres-a-fun-thing/106556)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 16\
**Last updated:** [December 26, 2023, 7:25am UTC](https://discourse.julialang.org/t/heres-a-fun-thing/106556 "2023-12-26T07:25:16Z")

</div>

Here is a Lisp-y or Scheme-y, if you prefer, way to deal with deeply nested dicts in Julia. Don’t ask why, but I have an application with deeply nested data structures. I serialize them to and from YAML, which isn’t a ma…

---

## [Documenter.jl - Creating Documentation for Arbitrary Julia Scripts](https://discourse.julialang.org/t/documenter-jl-creating-documentation-for-arbitrary-julia-scripts/108038)

<div class="topic-metadata">

**Author:** [@General.T.Case](https://discourse.julialang.org/u/General.T.Case)\
**Replies:** 1\
**Last updated:** [December 26, 2023, 6:37am UTC](https://discourse.julialang.org/t/documenter-jl-creating-documentation-for-arbitrary-julia-scripts/108038 "2023-12-26T06:37:07Z")

</div>

Is it possible to use Documenter.jl to create documentation for an arbitrary set of Julia scripts located in arbitrary directories? In particular, suppose the scripts are not part of package. It seems straightforward e…

---

## [No autocompletion for the built-in Dates module?](https://discourse.julialang.org/t/no-autocompletion-for-the-built-in-dates-module/108015)

<div class="topic-metadata">

**Author:** [@GeorgeTheFifth](https://discourse.julialang.org/u/GeorgeTheFifth)\
**Replies:** 6\
**Last updated:** [December 26, 2023, 4:56am UTC](https://discourse.julialang.org/t/no-autocompletion-for-the-built-in-dates-module/108015 "2023-12-26T04:56:29Z")

</div>

I am using the VSCode Julia extension v1.65.2. When I import Dates, I get no autocompletion for Dates.. Simply the extension does not suggest anything from Dates module. Is this behavior normal? Is VSCode Julia extension…

---

## [NeuralPDE - example is taking hours to run](https://discourse.julialang.org/t/neuralpde-example-is-taking-hours-to-run/108024)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 4\
**Last updated:** [December 26, 2023, 3:58am UTC](https://discourse.julialang.org/t/neuralpde-example-is-taking-hours-to-run/108024 "2023-12-26T03:58:19Z")

</div>

I am following the example of solving an ODE using PINN. However, on my machine, it’s been 2+ hours, and I am only on iteration 5 of 200… Does anyone know what could be going wrong here? Is it the matter of Flux vs Lux? …

---

## [Help needed: Building an intuitive understanding of closures, scoping and type-stability](https://discourse.julialang.org/t/help-needed-building-an-intuitive-understanding-of-closures-scoping-and-type-stability/107960)

<div class="topic-metadata">

**Author:** [@Bizzi](https://discourse.julialang.org/u/Bizzi)\
**Replies:** 3\
**Last updated:** [December 26, 2023, 12:30am UTC](https://discourse.julialang.org/t/help-needed-building-an-intuitive-understanding-of-closures-scoping-and-type-stability/107960 "2023-12-26T00:30:20Z")

</div>

Even after quite some time, I still struggle with understanding how to create type-stable wrappers around simple functions. I’ve read the docs, I know that closures in julia use reference semantics instead of value seman…

---

## [Expert Julia consultant](https://discourse.julialang.org/t/expert-julia-consultant/107641)

<div class="topic-metadata">

**Author:** [@ilanggear](https://discourse.julialang.org/u/ilanggear)\
**Replies:** 1\
**Last updated:** [December 25, 2023, 10:46pm UTC](https://discourse.julialang.org/t/expert-julia-consultant/107641 "2023-12-25T22:46:03Z")

</div>

I’ve been working on an (unpaid) side project using Julia to collect counts and compute odds for natural language features in parsed web crawl data. My eventual goals are to build a dependency parser for English and a s…

---

## [Why am I only getting a partial string here?](https://discourse.julialang.org/t/why-am-i-only-getting-a-partial-string-here/108043)

<div class="topic-metadata">

**Author:** [@Kyjor](https://discourse.julialang.org/u/Kyjor)\
**Replies:** 0\
**Last updated:** [December 25, 2023, 10:44pm UTC](https://discourse.julialang.org/t/why-am-i-only-getting-a-partial-string-here/108043 "2023-12-25T22:44:54Z")

</div>

Hello, I’m trying to handle errors using SDL2 and I’m getting some garbled text here when an error is caught and I try to print it. I’m sure there’s something simple I’m doing wrong, but I’m not super familiar with handl…

---

## [Can't access pkg.julialang.org](https://discourse.julialang.org/t/cant-access-pkg-julialang-org/107901)

<div class="topic-metadata">

**Author:** [@xiangluoming](https://discourse.julialang.org/u/xiangluoming)\
**Replies:** 4\
**Last updated:** [December 25, 2023, 9:07pm UTC](https://discourse.julialang.org/t/cant-access-pkg-julialang-org/107901 "2023-12-25T21:07:27Z")

</div>

I can’t access pkg.julialang.org. It redirect me to https://cn-northeast.pkg.juliacn.com/, which is broken several months ago. (@v1.8) pkg\> registry up ┌ Warning: could not download https://pkg.julialang.org/registries …

---

## [Having legend on top of twinx() line](https://discourse.julialang.org/t/having-legend-on-top-of-twinx-line/107970)

<div class="topic-metadata">

**Author:** [@aoifehealy](https://discourse.julialang.org/u/aoifehealy)\
**Replies:** 1\
**Last updated:** [December 24, 2023, 2:52pm UTC](https://discourse.julialang.org/t/having-legend-on-top-of-twinx-line/107970 "2023-12-24T14:52:59Z")

</div>

Hi there, I am plotting 4 different sine waves. The scale of one of these waves is on a seperate y axis. Using the code below, I have obtained the following graph: plot(sol\_2\_elem, idxs = wk2model.source.Δp, labels="2 E…

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

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