# Latest

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

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

**Page:** 528

---

## [Pairs index API](https://discourse.julialang.org/t/pairs-index-api/107786)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [December 18, 2023, 8:04pm UTC](https://discourse.julialang.org/t/pairs-index-api/107786 "2023-12-18T20:04:49Z")

</div>

Why are these different? julia\> first(pairs(\[10,20,30\])) 1 =\> 10 julia\> pairs(\[10,20,30\])\[1\] 10

---

## [Smoothest method to iterate on individual lines of a package?](https://discourse.julialang.org/t/smoothest-method-to-iterate-on-individual-lines-of-a-package/107781)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 0\
**Last updated:** [December 18, 2023, 5:56pm UTC](https://discourse.julialang.org/t/smoothest-method-to-iterate-on-individual-lines-of-a-package/107781 "2023-12-18T17:56:30Z")

</div>

Continuing the discussion from Executing code blocks with REPL workspace: I think the main workflow I am trying to understand/improve is a way to test and iterate on individual lines in a function in a package without h…

---

## [Efficient ways to raise an array by a scalar power](https://discourse.julialang.org/t/efficient-ways-to-raise-an-array-by-a-scalar-power/107688)

<div class="topic-metadata">

**Author:** [@valentin.m](https://discourse.julialang.org/u/valentin.m)\
**Replies:** 7\
**Last updated:** [December 18, 2023, 4:40pm UTC](https://discourse.julialang.org/t/efficient-ways-to-raise-an-array-by-a-scalar-power/107688 "2023-12-18T16:40:55Z")

</div>

Hello! I’m currently working on optimizing an algorithm to match the performance of an existing Fortran implementation. A key part of the algorithm involves computing the power of large arrays of floats raised to a scal…

---

## [Converting a Vector{Vector{String}} to Dict{String, String}](https://discourse.julialang.org/t/converting-a-vector-vector-string-to-dict-string-string/107733)

<div class="topic-metadata">

**Author:** [@Cortexture](https://discourse.julialang.org/u/Cortexture)\
**Replies:** 6\
**Last updated:** [December 18, 2023, 4:32pm UTC](https://discourse.julialang.org/t/converting-a-vector-vector-string-to-dict-string-string/107733 "2023-12-18T16:32:21Z")

</div>

using Pipe text\_vector = open("../data/exploring\_the\_wonders\_of\_nature.txt") |\> readlines words = replace(text\_vector\[1\], "," =\> "", "." =\> "", "—" =\> " ") |\> split .|\> String cmu\_dat…

---

## [Saved .png/.pdf shows title on top of plot](https://discourse.julialang.org/t/saved-png-pdf-shows-title-on-top-of-plot/107650)

<div class="topic-metadata">

**Author:** [@peremato](https://discourse.julialang.org/u/peremato)\
**Replies:** 5\
**Last updated:** [December 18, 2023, 2:45pm UTC](https://discourse.julialang.org/t/saved-png-pdf-shows-title-on-top-of-plot/107650 "2023-12-18T14:45:23Z")

</div>

With Plots v1.39.0 on a MacOS arm 14.2, when saving plots (histograms) as .png or .pdf I get a different figure where the title is put on top of the plot. I am using the following code to plot: lay = @layout \[°;°;°…

---

## [Searchsorted by attribute](https://discourse.julialang.org/t/searchsorted-by-attribute/107754)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 5\
**Last updated:** [December 18, 2023, 2:29pm UTC](https://discourse.julialang.org/t/searchsorted-by-attribute/107754 "2023-12-18T14:29:02Z")

</div>

Suppose I have an array inventory::Vector{InventoryObject} that is sorted by the name attribute of each element (sort with by=(obj-\>obj.name)) The InventoryObject is defined as @kwdef struct InventoryObject name::S…

---

## [PINN in Julia](https://discourse.julialang.org/t/pinn-in-julia/107771)

<div class="topic-metadata">

**Author:** [@gagankaushikmanyam](https://discourse.julialang.org/u/gagankaushikmanyam)\
**Replies:** 0\
**Last updated:** [December 18, 2023, 2:11pm UTC](https://discourse.julialang.org/t/pinn-in-julia/107771 "2023-12-18T14:11:36Z")

</div>

Hello Flux Experts /Users I have been working recently with Flux.jl in Julia and have been trying to code an ANN that uses strain (from FEM as input to the ANN) and then calculates the residual based on the output of th…

---

## [How to find solution from certain index in DifferentialEquations.jl](https://discourse.julialang.org/t/how-to-find-solution-from-certain-index-in-differentialequations-jl/107766)

<div class="topic-metadata">

**Author:** [@aoifehealy](https://discourse.julialang.org/u/aoifehealy)\
**Replies:** 2\
**Last updated:** [December 18, 2023, 1:37pm UTC](https://discourse.julialang.org/t/how-to-find-solution-from-certain-index-in-differentialequations-jl/107766 "2023-12-18T13:37:07Z")

</div>

Hi there, I have a DiffrentialEquations.jl solution from a model I created using ModelingToolkit.jl where u has a number of different columns. Is there a way of displaying the results of just the columns of a specified…

---

## [Registering a time dependent function inside a function in ModelingToolkit.jl](https://discourse.julialang.org/t/registering-a-time-dependent-function-inside-a-function-in-modelingtoolkit-jl/100402)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 5\
**Last updated:** [December 18, 2023, 1:21pm UTC](https://discourse.julialang.org/t/registering-a-time-dependent-function-inside-a-function-in-modelingtoolkit-jl/100402 "2023-12-18T13:21:07Z")

</div>

Let’s say that I build my model using functions that, if need be create variables and parameters, and return equations. In the end of the code i put all equations together. Let’s say I have an example block such as usin…

---

## [High Memory Usage when using offline\_run from Agents.jl in for loops](https://discourse.julialang.org/t/high-memory-usage-when-using-offline-run-from-agents-jl-in-for-loops/107731)

<div class="topic-metadata">

**Author:** [@PaoloBova](https://discourse.julialang.org/u/PaoloBova)\
**Replies:** 3\
**Last updated:** [December 18, 2023, 1:19pm UTC](https://discourse.julialang.org/t/high-memory-usage-when-using-offline-run-from-agents-jl-in-for-loops/107731 "2023-12-18T13:19:35Z")

</div>

Hello Julia Community, I’m currently working with the Agents.jl package, specifically using the offline\_run function. I’ve encountered an issue where my program seems to be consuming a significant amount of memory when …

---

## [Collapse all functions in Outline section of VS Code](https://discourse.julialang.org/t/collapse-all-functions-in-outline-section-of-vs-code/107765)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 2\
**Last updated:** [December 18, 2023, 12:21pm UTC](https://discourse.julialang.org/t/collapse-all-functions-in-outline-section-of-vs-code/107765 "2023-12-18T12:21:33Z")

</div>

Is it possible to collapse all functions in the Outline section, like you would do with the folders in the Explorer? Currently, every function has underneath it its parameters and local variables. I can collapse each…

---

## [Cannot use CUDA nor GLMakie](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742)

<div class="topic-metadata">

**Author:** [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Replies:** 4\
**Last updated:** [December 18, 2023, 12:06pm UTC](https://discourse.julialang.org/t/cannot-use-cuda-nor-glmakie/107742 "2023-12-18T12:06:58Z")

</div>

might be two problems for two questions, but I am not sure if they might be related. I have these nvidia drivers and CUDA: +-----------------------------------------------------------------------------+ | NVIDIA-SMI 52…

---

## [Reinterpret vector into single struct](https://discourse.julialang.org/t/reinterpret-vector-into-single-struct/107709)

<div class="topic-metadata">

**Author:** [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Replies:** 9\
**Last updated:** [December 18, 2023, 10:46am UTC](https://discourse.julialang.org/t/reinterpret-vector-into-single-struct/107709 "2023-12-18T10:46:03Z")

</div>

Hi, I’m optimizing a bit of code where I need to reinterpret a vector into a struct. For example, I have the MWE example below struct Test a1::Float64 a2::Float64 end vec = \[2.0, 1.0\] using BenchmarkTools @be…

---

## [Test if two vertices are connected in a graph](https://discourse.julialang.org/t/test-if-two-vertices-are-connected-in-a-graph/107675)

<div class="topic-metadata">

**Author:** [@jonlym](https://discourse.julialang.org/u/jonlym)\
**Replies:** 4\
**Last updated:** [December 18, 2023, 10:34am UTC](https://discourse.julialang.org/t/test-if-two-vertices-are-connected-in-a-graph/107675 "2023-12-18T10:34:27Z")

</div>

Hello all, I would like to create a graph with no weights and efficiently test if vertices are connected (not necessarily neighbors). I learned I can do this using shortest\_path algorithms and connected\_components but …

---

## [Internship: Quant Developer in Algorithmic Trading (Switzerland)](https://discourse.julialang.org/t/internship-quant-developer-in-algorithmic-trading-switzerland/107648)

<div class="topic-metadata">

**Author:** [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Replies:** 4\
**Last updated:** [December 18, 2023, 10:29am UTC](https://discourse.julialang.org/t/internship-quant-developer-in-algorithmic-trading-switzerland/107648 "2023-12-18T10:29:24Z")

</div>

I am happy to announce that we are looking for a 6-month internship/temp position in our team at Axpo Solutions AG. We are a small team specializing in algorithmic trading in the European energy market. Our office is lo…

---

## [Specifying plot colours using Plots.jl, getting multicolour lines](https://discourse.julialang.org/t/specifying-plot-colours-using-plots-jl-getting-multicolour-lines/107735)

<div class="topic-metadata">

**Author:** [@aoifehealy](https://discourse.julialang.org/u/aoifehealy)\
**Replies:** 2\
**Last updated:** [December 18, 2023, 10:18am UTC](https://discourse.julialang.org/t/specifying-plot-colours-using-plots-jl-getting-multicolour-lines/107735 "2023-12-18T10:18:04Z")

</div>

Hi there, I’m tring to plot two different datasets on the same axis, the first as a blue line and the second as a red line. I have tried plot(sol, idxs = \[idx1, idx2\], linecolor=\[:blue,:red\]) but instead of one line b…

---

## [How to get the "interior" view of a multidimensional array with unknown number of axes](https://discourse.julialang.org/t/how-to-get-the-interior-view-of-a-multidimensional-array-with-unknown-number-of-axes/107759)

<div class="topic-metadata">

**Author:** [@jinfreedom](https://discourse.julialang.org/u/jinfreedom)\
**Replies:** 1\
**Last updated:** [December 18, 2023, 10:13am UTC](https://discourse.julialang.org/t/how-to-get-the-interior-view-of-a-multidimensional-array-with-unknown-number-of-axes/107759 "2023-12-18T10:13:11Z")

</div>

Hi, I would like to extract “interior” part of an array A\_int=A\[h:end-h,h:end-h,...\] where I don’t know how many axes A have. What is the correct syntax for this purpose?

---

## [Matrix input field: bug in StippleUI?](https://discourse.julialang.org/t/matrix-input-field-bug-in-stippleui/107617)

<div class="topic-metadata">

**Author:** [@StijnSchildermans](https://discourse.julialang.org/u/StijnSchildermans)\
**Replies:** 2\
**Last updated:** [December 18, 2023, 9:41am UTC](https://discourse.julialang.org/t/matrix-input-field-bug-in-stippleui/107617 "2023-12-18T09:41:09Z")

</div>

I am trying to write a function that allows me to render table-like structures so users can input matrices. However, when I use a matrix as a reactive variable for the structure backend the table does not behave as it sh…

---

## [How can I simplify this code](https://discourse.julialang.org/t/how-can-i-simplify-this-code/107757)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 0\
**Last updated:** [December 18, 2023, 8:02am UTC](https://discourse.julialang.org/t/how-can-i-simplify-this-code/107757 "2023-12-18T08:02:18Z")

</div>

How can I simplify the creation of a system of equations in a loop: using ModelingToolkit, OrdinaryDiffEq, LinearAlgebra G\_EARTH = Float64\[0.0, 0.0, -9.81\] # gravitational acceleration \[m/s²\] L0::Float…

---

## [Julia killed on Mac Pro](https://discourse.julialang.org/t/julia-killed-on-mac-pro/107748)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [December 18, 2023, 6:36am UTC](https://discourse.julialang.org/t/julia-killed-on-mac-pro/107748 "2023-12-18T06:36:49Z")

</div>

Mac Pro - Tower: Apple M2 Ultra julia is run to execute a series of simulations. After a few, the shell kills the process with nothing more than zsh: killed. julia\> versioninfo() Julia Version 1.9.4 Commit 8e5136fa297 …

---

## [Installing Julia on Raspberry Pi 5](https://discourse.julialang.org/t/installing-julia-on-raspberry-pi-5/107694)

<div class="topic-metadata">

**Author:** [@Alis](https://discourse.julialang.org/u/Alis)\
**Replies:** 3\
**Last updated:** [December 18, 2023, 3:57am UTC](https://discourse.julialang.org/t/installing-julia-on-raspberry-pi-5/107694 "2023-12-18T03:57:39Z")

</div>

Hi all, I can’t seem to get Julia to execute on a Raspberry Pi 5. I’m downloading the AArch64 v1.9.4 release (https://julialang-s3.julialang.org/bin/linux/aarch64/1.9/julia-1.9.4-linux-aarch64.tar.gz). After untarring…

---

## [JuMP constraint MethodError](https://discourse.julialang.org/t/jump-constraint-methoderror/107752)

<div class="topic-metadata">

**Author:** [@AP\_profile](https://discourse.julialang.org/u/AP_profile)\
**Replies:** 1\
**Last updated:** [December 18, 2023, 2:39am UTC](https://discourse.julialang.org/t/jump-constraint-methoderror/107752 "2023-12-18T02:39:54Z")

</div>

I’ve been trying to use a constraint that uses Distribution.cdf() in optimization using JuMP. An example of this usage would be similar to the below code. model = JuMP.Model(NLopt.Optimizer); set\_optimizer\_attribute(mod…

---

## [Continuation of Periodic Solutions - trouble with large predictor](https://discourse.julialang.org/t/continuation-of-periodic-solutions-trouble-with-large-predictor/107403)

<div class="topic-metadata">

**Author:** [@Mahnoor\_Pop](https://discourse.julialang.org/u/Mahnoor_Pop)\
**Replies:** 4\
**Last updated:** [December 17, 2023, 9:51pm UTC](https://discourse.julialang.org/t/continuation-of-periodic-solutions-trouble-with-large-predictor/107403 "2023-12-17T21:51:14Z")

</div>

Hi all! I’m trying to recreate a continuation figure from a paper using the package BifurcationKit.jl, and so far have done okay for the equilibrium solutions. However, now I’m trying to continue the periodic solutions,…

---

## [How to deal with vectors in NLsolve.jl](https://discourse.julialang.org/t/how-to-deal-with-vectors-in-nlsolve-jl/107488)

<div class="topic-metadata">

**Author:** [@khaledharizb](https://discourse.julialang.org/u/khaledharizb)\
**Replies:** 2\
**Last updated:** [December 17, 2023, 9:49pm UTC](https://discourse.julialang.org/t/how-to-deal-with-vectors-in-nlsolve-jl/107488 "2023-12-17T21:49:17Z")

</div>

Hi guys! I didn’t find a way to deal with vector using pkg NLSolve in the following problem. Let q=\[x,y\] and p=\[u,v\] and defining the functions f and g as f(q) = q / (√(q'\*q))^3,\\ g(p) = p. Now, giving q\_0=\[0.4,0\] an…

---

## [GPU gradient calculation with Zygote failling with an RTX 4060](https://discourse.julialang.org/t/gpu-gradient-calculation-with-zygote-failling-with-an-rtx-4060/107746)

<div class="topic-metadata">

**Author:** [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Replies:** 1\
**Last updated:** [December 17, 2023, 9:43pm UTC](https://discourse.julialang.org/t/gpu-gradient-calculation-with-zygote-failling-with-an-rtx-4060/107746 "2023-12-17T21:43:57Z")

</div>

Hello all, I’m having an issue with gradient calculation on gpu. The minimal code exemple is very minimal, using Flux,CUDA,cuDNN x = rand(Float32,1,1000) |\> gpu y = rand(Float32,1,1000) |\> gpu model = Flux.Chain( …

---

## [QR decomposition on large (\>1TB) matrix](https://discourse.julialang.org/t/qr-decomposition-on-large-1tb-matrix/50552)

<div class="topic-metadata">

**Author:** [@casv2](https://discourse.julialang.org/u/casv2)\
**Replies:** 5\
**Last updated:** [December 17, 2023, 9:17pm UTC](https://discourse.julialang.org/t/qr-decomposition-on-large-1tb-matrix/50552 "2023-12-17T21:17:58Z")

</div>

I’d like to perform a QR decomposition on a large (\> 1TB) matrix. Much larger than the available memory on a single node on our HPC. My idea is to set up a DistributedArray (GitHub - JuliaParallel/DistributedArrays.jl: …

---

## [Incorrect Hessian when using \`exp\` function with complex input](https://discourse.julialang.org/t/incorrect-hessian-when-using-exp-function-with-complex-input/107739)

<div class="topic-metadata">

**Author:** [@rz.yu](https://discourse.julialang.org/u/rz.yu)\
**Replies:** 1\
**Last updated:** [December 17, 2023, 8:23pm UTC](https://discourse.julialang.org/t/incorrect-hessian-when-using-exp-function-with-complex-input/107739 "2023-12-17T20:23:32Z")

</div>

Incorrect Hessian by exp function · Issue #677 · JuliaDiff/ForwardDiff.jl (github.com) I was trying to calculate the Hessian of a simple function such as using ForwardDiff function busPQ(Ybus, Vθ) n = length(Vθ) …

---

## [How to augment an \`Int64\` 1-D array or vector](https://discourse.julialang.org/t/how-to-augment-an-int64-1-d-array-or-vector/107729)

<div class="topic-metadata">

**Author:** [@chandra](https://discourse.julialang.org/u/chandra)\
**Replies:** 8\
**Last updated:** [December 17, 2023, 3:32pm UTC](https://discourse.julialang.org/t/how-to-augment-an-int64-1-d-array-or-vector/107729 "2023-12-17T15:32:55Z")

</div>

function continued\_fraction(num, denom) a = \[\] quo, rem = divrem(num, denom) a0 = quo push!(a, a0) num = denom denom = rem i = 1 while (rem != 0) quo, rem = divrem(num, denom) …

---

## [MathTeX font does not match pdfLaTeX font](https://discourse.julialang.org/t/mathtex-font-does-not-match-pdflatex-font/107670)

<div class="topic-metadata">

**Author:** [@dchang10](https://discourse.julialang.org/u/dchang10)\
**Replies:** 3\
**Last updated:** [December 17, 2023, 3:13pm UTC](https://discourse.julialang.org/t/mathtex-font-does-not-match-pdflatex-font/107670 "2023-12-17T15:13:47Z")

</div>

I’m using LaTeXstrings in GLMakie to render math. It seems like the mathcal font in LaTeXstrings is different from the typical font used for mathcal pdfLaTeX. Here’s an example of a render with LaTeXStrings: L"$\\mathcal…

---

## [Parameter Estimation of a 3 node thermal network](https://discourse.julialang.org/t/parameter-estimation-of-a-3-node-thermal-network/106232)

<div class="topic-metadata">

**Author:** [@Sooraj\_Krishnan](https://discourse.julialang.org/u/Sooraj_Krishnan)\
**Replies:** 9\
**Last updated:** [December 17, 2023, 1:14pm UTC](https://discourse.julialang.org/t/parameter-estimation-of-a-3-node-thermal-network/106232 "2023-12-17T13:14:39Z")

</div>

Im trying to formulate a parameter estimation problem to estimate the Resistance and Capacitance values of a 3 node thermal network. The thermal network is in the form of DAE with a mass matrix and exogenous inputs. I al…

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

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