# Latest

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

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

**Page:** 593

---

## [What is idiomatic way of vectorizing longer operations in Julia?](https://discourse.julialang.org/t/what-is-idiomatic-way-of-vectorizing-longer-operations-in-julia/104117)

<div class="topic-metadata">

**Author:** [@Devetak](https://discourse.julialang.org/u/Devetak)\
**Replies:** 5\
**Last updated:** [September 21, 2023, 6:22pm UTC](https://discourse.julialang.org/t/what-is-idiomatic-way-of-vectorizing-longer-operations-in-julia/104117 "2023-09-21T18:22:06Z")

</div>

Hello. I have recently tried writing some code and need help with vectorization. I like that Julia’s loops are efficient, but sometimes I want to write less verbose code. How to do it in this case? What are the best pra…

---

## [Naming positional arguments at call site](https://discourse.julialang.org/t/naming-positional-arguments-at-call-site/103526)

<div class="topic-metadata">

**Author:** [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Replies:** 131\
**Last updated:** [September 21, 2023, 5:32pm UTC](https://discourse.julialang.org/t/naming-positional-arguments-at-call-site/103526 "2023-09-21T17:32:52Z")

</div>

I would love to be able to use keywords with positional arguments. It’s one of my favorite “code should be self-documenting” features.

---

## [Most efficient way to compute the roots of an equation involving Bessel functions?](https://discourse.julialang.org/t/most-efficient-way-to-compute-the-roots-of-an-equation-involving-bessel-functions/104112)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 2\
**Last updated:** [September 21, 2023, 5:09pm UTC](https://discourse.julialang.org/t/most-efficient-way-to-compute-the-roots-of-an-equation-involving-bessel-functions/104112 "2023-09-21T17:09:57Z")

</div>

I was wondering about what would be the most computationally efficient way in Julia to compute the zeros of the following equation involving Bessel functions derivatives: J\_m'(x)Y\_m'(ax)-J\_m'(ax)Y\_m'(x)=0, where a is a…

---

## [ERROR: UndefVarError: \`GPU\` not defined Stacktrace: \[1\] top-level scope](https://discourse.julialang.org/t/error-undefvarerror-gpu-not-defined-stacktrace-1-top-level-scope/104097)

<div class="topic-metadata">

**Author:** [@Abraham\_Lincoln](https://discourse.julialang.org/u/Abraham_Lincoln)\
**Replies:** 1\
**Last updated:** [September 21, 2023, 4:01pm UTC](https://discourse.julialang.org/t/error-undefvarerror-gpu-not-defined-stacktrace-1-top-level-scope/104097 "2023-09-21T16:01:44Z")

</div>

When i run this code appears this error:ERROR: UndefVarError: GPU not defined Stacktrace: \[1\] top-level scope CODE: using CUDA using Flux using Flux.Data: DataLoader using Flux: onehotbatch, onecold, crossentropy,…

---

## [Vegalite plot, facetting with different x scales for each row](https://discourse.julialang.org/t/vegalite-plot-facetting-with-different-x-scales-for-each-row/104111)

<div class="topic-metadata">

**Author:** [@Axze-rgb](https://discourse.julialang.org/u/Axze-rgb)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 2:22pm UTC](https://discourse.julialang.org/t/vegalite-plot-facetting-with-different-x-scales-for-each-row/104111 "2023-09-21T14:22:28Z")

</div>

Hello, I am plotting some features alongside 6 different chromosomes; each chromosome has a different length. The dataframe looks like this: chromosome position count String7 Int64 Int64 1 “Chrom\_3” 10000 68 2 “Chr…

---

## [Parameter optimization using Multiple shooting](https://discourse.julialang.org/t/parameter-optimization-using-multiple-shooting/104104)

<div class="topic-metadata">

**Author:** [@Marco\_Nesta](https://discourse.julialang.org/u/Marco_Nesta)\
**Replies:** 1\
**Last updated:** [September 21, 2023, 12:18pm UTC](https://discourse.julialang.org/t/parameter-optimization-using-multiple-shooting/104104 "2023-09-21T12:18:19Z")

</div>

'm using the same structure as in the link, but how can I view the updated parameters? this is my code: using DifferentialEquations, Plots, Flux,Optim, DiffEqFlux, DataInterpolations,Random, ComponentArrays, Lux …

---

## [Command hangs: \`run(pipeline(\`git diff\`, stderr=err, stdout=out), wait=true)\`](https://discourse.julialang.org/t/command-hangs-run-pipeline-git-diff-stderr-err-stdout-out-wait-true/103742)

<div class="topic-metadata">

**Author:** [@adomasbaliuka](https://discourse.julialang.org/u/adomasbaliuka)\
**Replies:** 3\
**Last updated:** [September 21, 2023, 9:05am UTC](https://discourse.julialang.org/t/command-hangs-run-pipeline-git-diff-stderr-err-stdout-out-wait-true/103742 "2023-09-21T09:05:43Z")

</div>

(Found while debugging DrWatson.jl) Setup (git repo with changed file): # julia 1.9.3, Commit bed2cd540a1 (2023-08-24 14:43 UTC) shell\> mkdir JuliaGitWithPipeHangs shell\> cd JuliaGitWithPipeHangs shell\> git init Initia…

---

## [ExampleSysimage The specified module could not be found](https://discourse.julialang.org/t/examplesysimage-the-specified-module-could-not-be-found/87039)

<div class="topic-metadata">

**Author:** [@AbhimanyuAryan](https://discourse.julialang.org/u/AbhimanyuAryan)\
**Replies:** 4\
**Last updated:** [September 21, 2023, 8:53am UTC](https://discourse.julialang.org/t/examplesysimage-the-specified-module-could-not-be-found/87039 "2023-09-21T08:53:23Z")

</div>

I compiled a sys image from guide given here: Sysimages · PackageCompiler julia\> versioninfo() Julia Version 1.8.0 Commit 5544a0fab7 (2022-08-17 13:38 UTC) Platform Info: OS: Windows (x86\_64-w64-mingw32) CPU: 16 × A…

---

## [Why the function sum1 is faster than builtin sum](https://discourse.julialang.org/t/why-the-function-sum1-is-faster-than-builtin-sum/104051)

<div class="topic-metadata">

**Author:** [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Replies:** 14\
**Last updated:** [September 21, 2023, 8:17am UTC](https://discourse.julialang.org/t/why-the-function-sum1-is-faster-than-builtin-sum/104051 "2023-09-21T08:17:21Z")

</div>

julia\> using BenchmarkTools julia\> function sum1(num) total = 0 for i in num total += i end return total end sum1 (generic function with 1 method) julia\> a = coll…

---

## [How to exchange x and y axis in band plot](https://discourse.julialang.org/t/how-to-exchange-x-and-y-axis-in-band-plot/104090)

<div class="topic-metadata">

**Author:** [@subsnutr](https://discourse.julialang.org/u/subsnutr)\
**Replies:** 3\
**Last updated:** [September 21, 2023, 7:24am UTC](https://discourse.julialang.org/t/how-to-exchange-x-and-y-axis-in-band-plot/104090 "2023-09-21T07:24:18Z")

</div>

Dear all Is there a way to exchange x and y axis in band plot in Makie.jl? For example, I want to have band(y,xlower,xupper) Thanks!

---

## [GR Mesh Shading](https://discourse.julialang.org/t/gr-mesh-shading/104092)

<div class="topic-metadata">

**Author:** [@Ian\_L](https://discourse.julialang.org/u/Ian_L)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 5:43am UTC](https://discourse.julialang.org/t/gr-mesh-shading/104092 "2023-09-21T05:43:50Z")

</div>

Hi, I was looking at Mesh3d · Plots and noticed there is no shading for the GR backend. Does anyone know the parameter to set this on? Thanks

---

## [Saving update state output](https://discourse.julialang.org/t/saving-update-state-output/103962)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 7\
**Last updated:** [September 21, 2023, 5:35am UTC](https://discourse.julialang.org/t/saving-update-state-output/103962 "2023-09-21T05:35:25Z")

</div>

Hi I am using below function to compare a scalar value and then use update state to update the inputs of function and get the updated value. function new\_EnergyState(ψPlusPrev\_in,ψhPos\_in) ψPlus\_in = ψhPos\_in i…

---

## [Tools for partitioning matrix columns?](https://discourse.julialang.org/t/tools-for-partitioning-matrix-columns/104055)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [September 21, 2023, 5:25am UTC](https://discourse.julialang.org/t/tools-for-partitioning-matrix-columns/104055 "2023-09-21T05:25:45Z")

</div>

Hello, I am looking for a convenient package to partition matrices into smaller matrices (ie. cut along the 2nd dim). However, I specifically need to be able to make partitions of unequal sizes. Let me illustrate with …

---

## [Tullio - missing elements in vectors](https://discourse.julialang.org/t/tullio-missing-elements-in-vectors/104091)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 4:44am UTC](https://discourse.julialang.org/t/tullio-missing-elements-in-vectors/104091 "2023-09-21T04:44:03Z")

</div>

Is it possible to do X::Vector{Any}=zeros(2) @tullio X\[i\] = \[1,missing\]\[i\] in one line? something like @tullio X\[i\]::Vector{Any} := \[1,missing\]\[i\] Also, is it possible to apply a custom aggregation function? some…

---

## [How to construct a struct with common field values efficiently](https://discourse.julialang.org/t/how-to-construct-a-struct-with-common-field-values-efficiently/104047)

<div class="topic-metadata">

**Author:** [@lukemin](https://discourse.julialang.org/u/lukemin)\
**Replies:** 32\
**Last updated:** [September 21, 2023, 3:13am UTC](https://discourse.julialang.org/t/how-to-construct-a-struct-with-common-field-values-efficiently/104047 "2023-09-21T03:13:35Z")

</div>

I am now developing a code which makes use of a huge number of modulo arithmetic. For a better readability, I tried to define custom types Modulus and ModNum. Modulus contains some values which is essential for the mod…

---

## [Convert unixtime to yyyymmdd::Int](https://discourse.julialang.org/t/convert-unixtime-to-yyyymmdd-int/104077)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 3\
**Last updated:** [September 20, 2023, 9:58pm UTC](https://discourse.julialang.org/t/convert-unixtime-to-yyyymmdd-int/104077 "2023-09-20T21:58:27Z")

</div>

Hello, how can I make this code more optimal? import Dates const Unixtime = Int function unix2yyyymmdd(unixtime::Unixtime)::Int datetime = Dates.unix2datetime(unixtime) date = floor(datetime, Dates.Day) st…

---

## [Using @view with CuArrays](https://discourse.julialang.org/t/using-view-with-cuarrays/104057)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 6\
**Last updated:** [September 20, 2023, 8:52pm UTC](https://discourse.julialang.org/t/using-view-with-cuarrays/104057 "2023-09-20T20:52:34Z")

</div>

Hi. I am new to GPU programming with Julia, and trying to run a matrix multiplication within a loop. It is important this is performant, so want to minimise allocations. But if I run the following minimal example (as I w…

---

## [BilevelJuMP and Lazy cns with Gurobi](https://discourse.julialang.org/t/bileveljump-and-lazy-cns-with-gurobi/104060)

<div class="topic-metadata">

**Author:** [@Fabrizio](https://discourse.julialang.org/u/Fabrizio)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 8:25pm UTC](https://discourse.julialang.org/t/bileveljump-and-lazy-cns-with-gurobi/104060 "2023-09-20T20:25:00Z")

</div>

I repost this here for conveniece Dear all, when using pure Jump model i exensively use the lazy attribute with some cns using Gurobi as a solver with the syntiax MOI.set(MyMod, Gurobi.ConstraintAttribute(“Lazy”), Cn…

---

## [Calling function from Makie Buttons and Menus](https://discourse.julialang.org/t/calling-function-from-makie-buttons-and-menus/103043)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 5\
**Last updated:** [September 20, 2023, 8:09pm UTC](https://discourse.julialang.org/t/calling-function-from-makie-buttons-and-menus/103043 "2023-09-20T20:09:28Z")

</div>

Hi everytone. I am trying to build a GUI to call a bunch of my functions. It is based on Makie as it was suggested in this forum because the idea is to read a data file and them cut, filter, etc the data while displayin…

---

## [Struggling to load a pre-trained PyTorch model into Julia](https://discourse.julialang.org/t/struggling-to-load-a-pre-trained-pytorch-model-into-julia/104068)

<div class="topic-metadata">

**Author:** [@Jian\_ZUO](https://discourse.julialang.org/u/Jian_ZUO)\
**Replies:** 2\
**Last updated:** [September 20, 2023, 7:34pm UTC](https://discourse.julialang.org/t/struggling-to-load-a-pre-trained-pytorch-model-into-julia/104068 "2023-09-20T19:34:24Z")

</div>

Hi all, I am coming back to this unsolved problem. The background is that I have trained a reinforcement learning agent and I want to load the pre-trained model (pytorch) into Julia for inference (it is much faster to …

---

## [Introducing PeaceFounder on Forem](https://discourse.julialang.org/t/introducing-peacefounder-on-forem/104054)

<div class="topic-metadata">

**Author:** [@oheil](https://discourse.julialang.org/u/oheil)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 6:43pm UTC](https://discourse.julialang.org/t/introducing-peacefounder-on-forem/104054 "2023-09-20T18:43:36Z")

</div>

Dear Julia friends, I would like to draw your attention to the following article with title Introducing PeaceFounder by @Janis\_Erdmanis on Forem The package was announced here: PeaceFounder.jl announcement a few years …

---

## [A chuckle a day](https://discourse.julialang.org/t/a-chuckle-a-day/104072)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [September 20, 2023, 6:20pm UTC](https://discourse.julialang.org/t/a-chuckle-a-day/104072 "2023-09-20T18:20:15Z")

</div>

Bing AI assistant:

---

## [How to Use Differential Equations to Model Phenomena in Patient Medical Records?](https://discourse.julialang.org/t/how-to-use-differential-equations-to-model-phenomena-in-patient-medical-records/104074)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 0\
**Last updated:** [September 20, 2023, 6:19pm UTC](https://discourse.julialang.org/t/how-to-use-differential-equations-to-model-phenomena-in-patient-medical-records/104074 "2023-09-20T18:19:20Z")

</div>

Hi folks, :wave: I am super thrilled to say I am finally making an initial foray into the SciML ecosystem! In brief, I am in a mathematical modeling course particularly utilizing Differential Equations to model various …

---

## [RigidBodySim.jl pkg issues](https://discourse.julialang.org/t/rigidbodysim-jl-pkg-issues/104073)

<div class="topic-metadata">

**Author:** [@jondavis847](https://discourse.julialang.org/u/jondavis847)\
**Replies:** 0\
**Last updated:** [September 20, 2023, 6:16pm UTC](https://discourse.julialang.org/t/rigidbodysim-jl-pkg-issues/104073 "2023-09-20T18:16:10Z")

</div>

I’m starting out with RigidBodyDynamics.jl and can successfully create and sim models in its environment. I’d like to try RigidBodySim.jl, mostly for the interface to DifferentialEquations.jl for its problem types and so…

---

## [Finding matrices with the same l1 and l2 norm](https://discourse.julialang.org/t/finding-matrices-with-the-same-l1-and-l2-norm/89404)

<div class="topic-metadata">

**Author:** [@ccccc](https://discourse.julialang.org/u/ccccc)\
**Replies:** 12\
**Last updated:** [November 1, 2022, 11:37pm UTC](https://discourse.julialang.org/t/finding-matrices-with-the-same-l1-and-l2-norm/89404 "2022-11-01T23:37:50Z")

</div>

I want to begin with a matrix, A, and find a matrix where the l2 norm is the same as it is for A, but the l1 norm is reduced so that it is the same as the l2 norm. There is only 1 eigenvalue, which is the square of the l…

---

## [XML to DataFrame converter](https://discourse.julialang.org/t/xml-to-dataframe-converter/104040)

<div class="topic-metadata">

**Author:** [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Replies:** 6\
**Last updated:** [September 20, 2023, 6:14pm UTC](https://discourse.julialang.org/t/xml-to-dataframe-converter/104040 "2023-09-20T18:14:03Z")

</div>

Many instruments write data in XML format, and I often find that I spend way too much time writing parsers to convert it to DataFrame. Do we have a package that can take a file like this: \<?xml version="1.0" encoding="…

---

## [Julian Alternative to Template by Value](https://discourse.julialang.org/t/julian-alternative-to-template-by-value/104070)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 3\
**Last updated:** [September 20, 2023, 6:08pm UTC](https://discourse.julialang.org/t/julian-alternative-to-template-by-value/104070 "2023-09-20T18:08:34Z")

</div>

I often find myself writing functions where the algorithm implemented depends on the value of an integer. For example, in numerical analysis I often have some numerical method, with 1st, 2nd, 3rd, and 4th order versions …

---

## [Filtering DataFrame on variable attribute type](https://discourse.julialang.org/t/filtering-dataframe-on-variable-attribute-type/104059)

<div class="topic-metadata">

**Author:** [@edo-0071](https://discourse.julialang.org/u/edo-0071)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 5:49pm UTC](https://discourse.julialang.org/t/filtering-dataframe-on-variable-attribute-type/104059 "2023-09-20T17:49:50Z")

</div>

Hi, i have a simple DataFrame and want to extract rows that match certain values ​​for some (not necessarily all) attributes. Starting from here, res = @from i in df begin @where i.A = "a1" @select i @collect DataFrame…

---

## [Trying to get an Expr from a type](https://discourse.julialang.org/t/trying-to-get-an-expr-from-a-type/103865)

<div class="topic-metadata">

**Author:** [@jeffreyesun](https://discourse.julialang.org/u/jeffreyesun)\
**Replies:** 6\
**Last updated:** [September 20, 2023, 5:33pm UTC](https://discourse.julialang.org/t/trying-to-get-an-expr-from-a-type/103865 "2023-09-20T17:33:44Z")

</div>

Hi all. I have a variable bar::DataType and I want to get the expression of that datatype, as follows. bar = Foo{T} Expr(bar) # :(Foo{T}). However, this gives an error, and I cannot seem to get it through interpolation…

---

## [Is array/vector handling this hard?](https://discourse.julialang.org/t/is-array-vector-handling-this-hard/104035)

<div class="topic-metadata">

**Author:** [@voroskoi](https://discourse.julialang.org/u/voroskoi)\
**Replies:** 14\
**Last updated:** [September 20, 2023, 4:57pm UTC](https://discourse.julialang.org/t/is-array-vector-handling-this-hard/104035 "2023-09-20T16:57:51Z")

</div>

Hi, I just started learning Julia and I try to solve some basic ML tasks. It is quite common to generate a vector of indices for the training data and I would like to generate the complement. For example I have a Vecto…

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

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