# Latest

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

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

**Page:** 448

---

## [Sorting matrix according to the first column](https://discourse.julialang.org/t/sorting-matrix-according-to-the-first-column/112196)

<div class="topic-metadata">

**Author:** [@baprata](https://discourse.julialang.org/u/baprata)\
**Replies:** 12\
**Last updated:** [March 28, 2024, 12:43pm UTC](https://discourse.julialang.org/t/sorting-matrix-according-to-the-first-column/112196 "2024-03-28T12:43:49Z")

</div>

In the matrix below, the first, second, and third columns represent the height, area, and volume of rectangular objects, respectively. I need to sort the items in non-ascending order of height (from the highest to the lo…

---

## [CPU multithreading: why can't my code estimate PI (throwing darts)?](https://discourse.julialang.org/t/cpu-multithreading-why-cant-my-code-estimate-pi-throwing-darts/112228)

<div class="topic-metadata">

**Author:** [@ErwinMoller](https://discourse.julialang.org/u/ErwinMoller)\
**Replies:** 2\
**Last updated:** [March 28, 2024, 12:36pm UTC](https://discourse.julialang.org/t/cpu-multithreading-why-cant-my-code-estimate-pi-throwing-darts/112228 "2024-03-28T12:36:45Z")

</div>

Hello, Goal: Estimating PI by throwing darts in a square and checking if they hit the unit-circle. I have 2 questions: Why does the following code always underestimate the value of PI? Second piece of code: Why does …

---

## [Cuda.versioninfo() error "NVML could not be initialized"](https://discourse.julialang.org/t/cuda-versioninfo-error-nvml-could-not-be-initialized/112123)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [March 28, 2024, 10:48am UTC](https://discourse.julialang.org/t/cuda-versioninfo-error-nvml-could-not-be-initialized/112123 "2024-03-28T10:48:45Z")

</div>

When I type CUDA.versioninfo() on a Ubuntu 22.04 box I got the following error: julia\> CUDA.versioninfo() CUDA runtime 12.3, artifact installation CUDA driver 12.3 ┌ Error: Cannot use NVML, as it failed to initialize │ …

---

## [Why CUDA is so slow on y = x\*w + w0?](https://discourse.julialang.org/t/why-cuda-is-so-slow-on-y-x-w-w0/112144)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [March 28, 2024, 10:43am UTC](https://discourse.julialang.org/t/why-cuda-is-so-slow-on-y-x-w-w0/112144 "2024-03-28T10:43:14Z")

</div>

Hi, I am doing my first steps on GPU programming, using the Array interface on CUDA. Wondering why CUDA is so slower than CPU on matrix multiplication: julia\> using CUDA, BenchmarkTools julia\> a = 100; julia\> b = 30; …

---

## [Trying to use the new optimization algorithm: Sophia](https://discourse.julialang.org/t/trying-to-use-the-new-optimization-algorithm-sophia/110259)

<div class="topic-metadata">

**Author:** [@KianH](https://discourse.julialang.org/u/KianH)\
**Replies:** 12\
**Last updated:** [March 28, 2024, 9:47am UTC](https://discourse.julialang.org/t/trying-to-use-the-new-optimization-algorithm-sophia/110259 "2024-03-28T09:47:13Z")

</div>

I am trying to use the new optimization algorithm in Optimization.jl called Sophia, which is the first algorithm that shows up in the link below. However, I seem to get an error message that Sophia is an undefined var…

---

## [Change font size in Gtk4.jl](https://discourse.julialang.org/t/change-font-size-in-gtk4-jl/112223)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [March 28, 2024, 9:41am UTC](https://discourse.julialang.org/t/change-font-size-in-gtk4-jl/112223 "2024-03-28T09:41:01Z")

</div>

How can I change the font size of a label in Gtk4.jl? I have the following code: using Gtk4 win = GtkWindow("My First Gtk4.jl Program", 400, 200) hbox = GtkBox(:h) # :h makes a horizontal layout, :v a vertical layout…

---

## [Unable to update packages](https://discourse.julialang.org/t/unable-to-update-packages/69161)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 1\
**Last updated:** [March 28, 2024, 9:04am UTC](https://discourse.julialang.org/t/unable-to-update-packages/69161 "2024-03-28T09:04:05Z")

</div>

I am unable to update packages. I am trying to find out if the problem is with Julia or some internet routing problem. Can anyone help? $ julia -O3 \_ \_ \_ \_(\_)\_ | Documentation: https://docs.…

---

## [Is anyone aware of a parallel implementation of mesh coloring?](https://discourse.julialang.org/t/is-anyone-aware-of-a-parallel-implementation-of-mesh-coloring/112100)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [March 28, 2024, 8:26am UTC](https://discourse.julialang.org/t/is-anyone-aware-of-a-parallel-implementation-of-mesh-coloring/112100 "2024-03-28T08:26:09Z")

</div>

Mesh coloring = graph coloring here (NOT graphics). Thanks for any pointers.

---

## [Problem with MKL\_jll in Mac OS](https://discourse.julialang.org/t/problem-with-mkl-jll-in-mac-os/112121)

<div class="topic-metadata">

**Author:** [@Sharara](https://discourse.julialang.org/u/Sharara)\
**Replies:** 4\
**Last updated:** [March 28, 2024, 7:18am UTC](https://discourse.julialang.org/t/problem-with-mkl-jll-in-mac-os/112121 "2024-03-28T07:18:05Z")

</div>

Hi there! I am using the book pro-M2, and now using VSC to implement Julia codes, I just wrote several using the package and ran the program as below: using LinearAlgebra using JuMP using Mosek using MosekTools using…

---

## [Julia 1.10.2 + IJulia + ubuntu mate 22.04 = blank page](https://discourse.julialang.org/t/julia-1-10-2-ijulia-ubuntu-mate-22-04-blank-page/112213)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 0\
**Last updated:** [March 28, 2024, 6:55am UTC](https://discourse.julialang.org/t/julia-1-10-2-ijulia-ubuntu-mate-22-04-blank-page/112213 "2024-03-28T06:55:23Z")

</div>

Hi, two days ago I installed ubuntu mate 22.04 (=last LTS) on my PC together with julia 10.2 I installed the IJulia package as usual (add IJulia) but now when I open julia in a terminal, hitting using IJulia notebook…

---

## [Least square with multi-value function](https://discourse.julialang.org/t/least-square-with-multi-value-function/47943)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 3\
**Last updated:** [March 28, 2024, 4:33am UTC](https://discourse.julialang.org/t/least-square-with-multi-value-function/47943 "2024-03-28T04:33:46Z")

</div>

I have a model which takes 3 independent variables, 4 parameters and returns 2 values. I am trying to fit the parameters to a certain dataset. LsqFit does not seem to like multivalues function but maybe I am not using …

---

## [Is there a way to get \`mul\_hi\`/\`umulh\`?](https://discourse.julialang.org/t/is-there-a-way-to-get-mul-hi-umulh/112109)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 5\
**Last updated:** [March 28, 2024, 4:12am UTC](https://discourse.julialang.org/t/is-there-a-way-to-get-mul-hi-umulh/112109 "2024-03-28T04:12:54Z")

</div>

Similar to (identical to) \`mul\_hi\` in Julia?, is there a way of accessing the high bits of a product between two bit integers? I want a function mul\_hi such that widen(mul\_hi(x, y)) \<\< 8sizeof(T) + x\*y == widemul(x,y) f…

---

## [MethodError in Custom Flux model](https://discourse.julialang.org/t/methoderror-in-custom-flux-model/112204)

<div class="topic-metadata">

**Author:** [@CM1](https://discourse.julialang.org/u/CM1)\
**Replies:** 1\
**Last updated:** [March 28, 2024, 2:25am UTC](https://discourse.julialang.org/t/methoderror-in-custom-flux-model/112204 "2024-03-28T02:25:19Z")

</div>

Hey everyone, I have been trying to get my custom model running, which should be able to optimize both for a set of paramters and some initial conditions of an ODE model. The ODE’s dynamics are defined in ode(), the mod…

---

## [How to Filter 2D Fourier Coefficients](https://discourse.julialang.org/t/how-to-filter-2d-fourier-coefficients/112108)

<div class="topic-metadata">

**Author:** [@balancedflow](https://discourse.julialang.org/u/balancedflow)\
**Replies:** 15\
**Last updated:** [March 27, 2024, 10:57pm UTC](https://discourse.julialang.org/t/how-to-filter-2d-fourier-coefficients/112108 "2024-03-27T22:57:45Z")

</div>

I have a real 2D Array (Nx,Ny) of some variable, let’s say absolute vorticity. I perform a 2d fft on the matrix by: fc\_2d = FFTW.r2r(arr,FFTW.R2HC) which returns a 2d matrix of the same size of Fourier coefficients. I…

---

## [StringIndex idea (Julia 2.0)](https://discourse.julialang.org/t/stringindex-idea-julia-2-0/107185)

<div class="topic-metadata">

**Author:** [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Replies:** 71\
**Last updated:** [March 27, 2024, 10:11pm UTC](https://discourse.julialang.org/t/stringindex-idea-julia-2-0/107185 "2024-03-27T22:11:11Z")

</div>

Continuing the discussion from String indices : byte indexing feels wrong… The other day I had a somewhat clever idea for how to preserve the O(1) indexing benefits that Julia currently has, while making string indexing …

---

## [A question about Distances.jl](https://discourse.julialang.org/t/a-question-about-distances-jl/76022)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 24\
**Last updated:** [March 27, 2024, 9:47pm UTC](https://discourse.julialang.org/t/a-question-about-distances-jl/76022 "2024-03-27T21:47:32Z")

</div>

this is my code: using Distances dm=pairwise(dist, X1, dims=2) LoadError: UndefVarError: pairwise not defined Stacktrace: \[1\] \_kmeans!(X::Matrix{Float64}, weights::Nothing, centers::Matrix{Float64}, maxiter::Int64,…

---

## [How to make Quarto with Julia in VSCode work?](https://discourse.julialang.org/t/how-to-make-quarto-with-julia-in-vscode-work/111882)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 4\
**Last updated:** [March 27, 2024, 9:07pm UTC](https://discourse.julialang.org/t/how-to-make-quarto-with-julia-in-vscode-work/111882 "2024-03-27T21:07:02Z")

</div>

I am facing difficulties trying to use Quarto in VSCode with Julia (again). I have asked a question here before (see this), but at the time I gave using Quarto in VSCode with Julia and simply used Quarto in RStudio with …

---

## [Writing Multidimensional FreqTable to CSV](https://discourse.julialang.org/t/writing-multidimensional-freqtable-to-csv/112192)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 6\
**Last updated:** [March 27, 2024, 8:37pm UTC](https://discourse.julialang.org/t/writing-multidimensional-freqtable-to-csv/112192 "2024-03-27T20:37:09Z")

</div>

I need to take a cross-tab of a DataFrame and write it out to CSV. This cross-tab has 3 dimensions. If I were to use pandas for this, it would create a multi-index, but FreqTables.jl creates a multidimensional NamedArray.…

---

## [Anonymous function with get() misunderstanding](https://discourse.julialang.org/t/anonymous-function-with-get-misunderstanding/112198)

<div class="topic-metadata">

**Author:** [@mtesseracted](https://discourse.julialang.org/u/mtesseracted)\
**Replies:** 2\
**Last updated:** [March 27, 2024, 8:01pm UTC](https://discourse.julialang.org/t/anonymous-function-with-get-misunderstanding/112198 "2024-03-27T20:01:43Z")

</div>

I’m learning Julia and looking at the anonymous functions page: Functions · The Julia Language Why does the anonymous function go as the first argument to get when the doc says the default parameter for an undefined key…

---

## [Exclude pattern from the REPL history](https://discourse.julialang.org/t/exclude-pattern-from-the-repl-history/111999)

<div class="topic-metadata">

**Author:** [@shg](https://discourse.julialang.org/u/shg)\
**Replies:** 17\
**Last updated:** [March 27, 2024, 7:55pm UTC](https://discourse.julialang.org/t/exclude-pattern-from-the-repl-history/111999 "2024-03-27T19:55:46Z")

</div>

Is there any way to prevent some inputs that match a specific pattern from being stored in the REPL history?

---

## [3D terrain graph with colour (as 4th dimension of dataset)](https://discourse.julialang.org/t/3d-terrain-graph-with-colour-as-4th-dimension-of-dataset/112178)

<div class="topic-metadata">

**Author:** [@Qmot](https://discourse.julialang.org/u/Qmot)\
**Replies:** 4\
**Last updated:** [March 27, 2024, 7:54pm UTC](https://discourse.julialang.org/t/3d-terrain-graph-with-colour-as-4th-dimension-of-dataset/112178 "2024-03-27T19:54:43Z")

</div>

Hello, Relatively new to Julia and enjoying it a lot! However, I would like to display data that has 4 dimensions, x, y, z (terrain) with a color that is independent of z. For context I’m trying to display geophysics on…

---

## [Building docs with Documenter.jl](https://discourse.julialang.org/t/building-docs-with-documenter-jl/63159)

<div class="topic-metadata">

**Author:** [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)\
**Replies:** 7\
**Last updated:** [March 27, 2024, 7:12pm UTC](https://discourse.julialang.org/t/building-docs-with-documenter-jl/63159 "2024-03-27T19:12:44Z")

</div>

I’ve been trying to get docs to build here, but for some reason only dev gets built after a new release gets tagged and registered ( even stable doesn’t get built). I thought adding the versions argument to the deploydoc…

---

## [What is the fastest way to find if a real nonsquare matrix is injective?](https://discourse.julialang.org/t/what-is-the-fastest-way-to-find-if-a-real-nonsquare-matrix-is-injective/112176)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 8\
**Last updated:** [March 27, 2024, 4:57pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-to-find-if-a-real-nonsquare-matrix-is-injective/112176 "2024-03-27T16:57:00Z")

</div>

Hello guys! The title says all. I have a certain M\\times N real valued matrix A and I would like to know if it is injective. What would be the fastest way to accomplish that? I know that I could calculate the determinan…

---

## [Contour goes out of grid in Meshes.jl](https://discourse.julialang.org/t/contour-goes-out-of-grid-in-meshes-jl/112187)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 0\
**Last updated:** [March 27, 2024, 3:48pm UTC](https://discourse.julialang.org/t/contour-goes-out-of-grid-in-meshes-jl/112187 "2024-03-27T15:48:06Z")

</div>

I am using Meshes.jl and GLMakie.jl for plotting on irregular grid. Contour of psi\[1,:,:\] (red lines) goes out of the circular sector. I want to apply contour on this irregular grid (circular sector). begin grid = S…

---

## [Bypass inner constructor / call \`new\` outside inner constructor](https://discourse.julialang.org/t/bypass-inner-constructor-call-new-outside-inner-constructor/112142)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 10\
**Last updated:** [March 27, 2024, 4:20pm UTC](https://discourse.julialang.org/t/bypass-inner-constructor-call-new-outside-inner-constructor/112142 "2024-03-27T16:20:18Z")

</div>

I have defined a struct with an inner constructor that enforces some invariants, similar to the example in the Documentation julia\> struct OrderedPair x::Real y::Real OrderedPair(x,y) =…

---

## [Scope issue with begin/end](https://discourse.julialang.org/t/scope-issue-with-begin-end/112188)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 2\
**Last updated:** [March 27, 2024, 3:59pm UTC](https://discourse.julialang.org/t/scope-issue-with-begin-end/112188 "2024-03-27T15:59:03Z")

</div>

Hi, I thought that module MyPkg const b = begin a = 2 b = a end end MyPkg.b # return 2 as wantedd MyPkg.a # return 2, but I wanted it not to exist. would give me a variable b with the value …

---

## [Zero Order Extinction Reaction](https://discourse.julialang.org/t/zero-order-extinction-reaction/108749)

<div class="topic-metadata">

**Author:** [@kkakosim](https://discourse.julialang.org/u/kkakosim)\
**Replies:** 21\
**Last updated:** [March 27, 2024, 3:25pm UTC](https://discourse.julialang.org/t/zero-order-extinction-reaction/108749 "2024-03-27T15:25:57Z")

</div>

Is there any way to achieve the positive\_domain effect with the Catalyst.jl syntax? In my example (decomposition of CaC2 yielding Calcium gas and solid Carbon): CaC2 → Ca(g) + 2C(s) I am looking for a way to “remove” …

---

## [Using the \`opt\` from Julia's LLVM?](https://discourse.julialang.org/t/using-the-opt-from-julias-llvm/112161)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 2\
**Last updated:** [March 27, 2024, 2:55pm UTC](https://discourse.julialang.org/t/using-the-opt-from-julias-llvm/112161 "2024-03-27T14:55:06Z")

</div>

Hi all— This may be a bit of a weird one, but I’m looking for a way to use the opt from Julia’s LLVM on some \*.ll files. The “why” is that I am compiling Enzyme with Julia’s LLVM following the dev docs here, which is mu…

---

## [Poor time performance in modifying parameters of JuMP models when using Gurobi](https://discourse.julialang.org/t/poor-time-performance-in-modifying-parameters-of-jump-models-when-using-gurobi/106982)

<div class="topic-metadata">

**Author:** [@NataponW](https://discourse.julialang.org/u/NataponW)\
**Replies:** 11\
**Last updated:** [March 27, 2024, 2:44pm UTC](https://discourse.julialang.org/t/poor-time-performance-in-modifying-parameters-of-jump-models-when-using-gurobi/106982 "2024-03-27T14:44:19Z")

</div>

Hello, I have a large LP model that I want to iteratively solve over changing parameters. Up until now, using set\_normalized\_rhs and set\_normalized\_coefficient works very well when HiGHS is an optimizer. However, when I…

---

## [EnzymeCon Live Stream Links](https://discourse.julialang.org/t/enzymecon-live-stream-links/112102)

<div class="topic-metadata">

**Author:** [@wsmoses](https://discourse.julialang.org/u/wsmoses)\
**Replies:** 0\
**Last updated:** [March 25, 2024, 6:02pm UTC](https://discourse.julialang.org/t/enzymecon-live-stream-links/112102 "2024-03-25T18:02:38Z")

</div>

We’re trying our best to live stream the talks (though our AV may go down). The full schedule of talks for EnzmyeCon is here: Enzyme Conference 2024 Day 1: https://youtube.com/live/Mju\_RAXMYis?feature=share Day 1 (par…

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

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