# Latest

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

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

**Page:** 542

---

## [Performance of streaming \`mean\`](https://discourse.julialang.org/t/performance-of-streaming-mean/106999)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 4\
**Last updated:** [December 1, 2023, 3:49pm UTC](https://discourse.julialang.org/t/performance-of-streaming-mean/106999 "2023-12-01T15:49:25Z")

</div>

Here’s a basic streaming mean function (called avg for convenience): function avg(itr) a = zero(eltype(x)) for (i, x) in enumerate(itr) a += (x - a) / i end return a end Why does it allocate so …

---

## [\[ANN\] SFTPClient v3.10 - Julia SFTP Client](https://discourse.julialang.org/t/ann-sftpclient-v3-10-julia-sftp-client/107000)

<div class="topic-metadata">

**Author:** [@stene](https://discourse.julialang.org/u/stene)\
**Replies:** 0\
**Last updated:** [December 1, 2023, 3:58pm UTC](https://discourse.julialang.org/t/ann-sftpclient-v3-10-julia-sftp-client/107000 "2023-12-01T15:58:29Z")

</div>

(GitHub - stensmo/SFTPClient.jl: Julia SFTP Client),an SFTP client for Julia with most features you need.

---

## [Splitting and joining Flux model chains](https://discourse.julialang.org/t/splitting-and-joining-flux-model-chains/34636)

<div class="topic-metadata">

**Author:** [@fastwave](https://discourse.julialang.org/u/fastwave)\
**Replies:** 4\
**Last updated:** [December 1, 2023, 3:49pm UTC](https://discourse.julialang.org/t/splitting-and-joining-flux-model-chains/34636 "2023-12-01T15:49:54Z")

</div>

I would like to create a Flux model that splits the input into two, processes it in two different ways and then joins it together using a model. Chain does not seem to allow parallel data paths. The diagram is here:Netwo…

---

## [Redefine the show function](https://discourse.julialang.org/t/redefine-the-show-function/106993)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [December 1, 2023, 3:28pm UTC](https://discourse.julialang.org/t/redefine-the-show-function/106993 "2023-12-01T15:28:45Z")

</div>

function Base.show(io::IO, b::BasisSetRep) print(io, "BasisSetRep($(b.h)) with dimension $(dimension(b)) and $(nnz(b.sm)) stored entries:") show(io, MIME"text/plain"(), b.sm) end This is some people’s code. I a…

---

## [What is the argument to change the legend title?](https://discourse.julialang.org/t/what-is-the-argument-to-change-the-legend-title/106996)

<div class="topic-metadata">

**Author:** [@vladdez](https://discourse.julialang.org/u/vladdez)\
**Replies:** 1\
**Last updated:** [December 1, 2023, 2:58pm UTC](https://discourse.julialang.org/t/what-is-the-argument-to-change-the-legend-title/106996 "2023-12-01T14:58:27Z")

</div>

In Makie documentation I have seen this way to put a label of the legend: f\[1, 2\] = Legend(f, ax, “Trig Functions”, framevisible = false) But is there a way to assing a legend title using some kwarg (argument) like a “…

---

## [Make \`find\_zero\` more robust](https://discourse.julialang.org/t/make-find-zero-more-robust/106983)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 3\
**Last updated:** [December 1, 2023, 2:18pm UTC](https://discourse.julialang.org/t/make-find-zero-more-robust/106983 "2023-12-01T14:18:15Z")

</div>

In my PowerAnalyses.jl package, I’m having trouble in finding a robust way to solve for zero. It works, but it’s not very robust. For example: ArgumentError when effect size is small (\<=0.10) · Issue #21 · rikhuijzer/Pow…

---

## [Fastest algorithm for (xi - xj) \* (yi - yj) for i in 1:n, j in 1:n](https://discourse.julialang.org/t/fastest-algorithm-for-xi-xj-yi-yj-for-i-in-1-n-j-in-1-n/106988)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 13\
**Last updated:** [December 1, 2023, 2:11pm UTC](https://discourse.julialang.org/t/fastest-algorithm-for-xi-xj-yi-yj-for-i-in-1-n-j-in-1-n/106988 "2023-12-01T14:11:33Z")

</div>

Suppose we are given two “big” vectors x and y of real numbers (e.g. Float64), both with the same length n. What is the fastest algorithm to compute \[(x\[i\] - x\[j\]) \* (y\[i\] - y\[j\]) for i in 1:n, j in 1:n\] ? Here is a b…

---

## [I created an online multiplayer game with Julia!](https://discourse.julialang.org/t/i-created-an-online-multiplayer-game-with-julia/106406)

<div class="topic-metadata">

**Author:** [@Kyjor](https://discourse.julialang.org/u/Kyjor)\
**Replies:** 13\
**Last updated:** [December 1, 2023, 12:07pm UTC](https://discourse.julialang.org/t/i-created-an-online-multiplayer-game-with-julia/106406 "2023-12-01T12:07:19Z")

</div>

Hey all! It’s been awhile since my last update on my online multiplayer game. Honestly, I got very busy, and didn’t feel like taking the time to work on this. It’s a pain because whenever I was working on this, I h…

---

## [Should custom hash functions distinguish types?](https://discourse.julialang.org/t/should-custom-hash-functions-distinguish-types/106984)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [December 1, 2023, 11:16am UTC](https://discourse.julialang.org/t/should-custom-hash-functions-distinguish-types/106984 "2023-12-01T11:16:17Z")

</div>

Suppose my package define two struct types A and B, each containing just a single field called data. Then I overload Base.hash as follows: import Base: hash hash(a::A, i) = hash(a.data, i) hash(b::B, i) = hash(b.data,…

---

## [Solving PDE with MethodOfLines](https://discourse.julialang.org/t/solving-pde-with-methodoflines/106936)

<div class="topic-metadata">

**Author:** [@Cwmeyer](https://discourse.julialang.org/u/Cwmeyer)\
**Replies:** 3\
**Last updated:** [December 1, 2023, 9:17am UTC](https://discourse.julialang.org/t/solving-pde-with-methodoflines/106936 "2023-12-01T09:17:40Z")

</div>

Hi, I am new to Julia. I’m trying to solve a PDE using Method of lines but I am running into a unexpected error. ERROR: type Term has no field lhs. My code as follows: using DifferentialEquations using Plots using Metho…

---

## [Position of axis labels and titles with Plots](https://discourse.julialang.org/t/position-of-axis-labels-and-titles-with-plots/99925)

<div class="topic-metadata">

**Author:** [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)\
**Replies:** 2\
**Last updated:** [December 1, 2023, 8:30am UTC](https://discourse.julialang.org/t/position-of-axis-labels-and-titles-with-plots/99925 "2023-12-01T08:30:19Z")

</div>

Dear julia community, I am struggling trying to adjust the position of the x and y labels of my plots. I have a figure made by 4 heatmaps with a nearby colormap: plot\_xlim\_heat = (-3,3) plot\_xlim\_diss = (-5,5) #…

---

## [How can I move an axis in a 3d plot, so that it is shown "outside" of the grid?](https://discourse.julialang.org/t/how-can-i-move-an-axis-in-a-3d-plot-so-that-it-is-shown-outside-of-the-grid/96365)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 9\
**Last updated:** [December 1, 2023, 8:02am UTC](https://discourse.julialang.org/t/how-can-i-move-an-axis-in-a-3d-plot-so-that-it-is-shown-outside-of-the-grid/96365 "2023-12-01T08:02:35Z")

</div>

Hi all, I’m making a plot using Plots.jl with the default GR backend. When I run this code # density\_matrix contains the data I want to plot p = plot(density\_matrix, st = :surface, xlabel="Binary weight", ylab…

---

## [3d Plots - change axis intersection // inverse axis](https://discourse.julialang.org/t/3d-plots-change-axis-intersection-inverse-axis/51109)

<div class="topic-metadata">

**Author:** [@neo\_abs](https://discourse.julialang.org/u/neo_abs)\
**Replies:** 11\
**Last updated:** [December 1, 2023, 7:00am UTC](https://discourse.julialang.org/t/3d-plots-change-axis-intersection-inverse-axis/51109 "2023-12-01T07:00:24Z")

</div>

I have a 3d plot: using Plots x = \[0,0,0,1,1,1,2,2,2\] y=\[0,1,2,0,1,2,0,1,2\] z = 10\*rand(9) .+ 2\*collect(1:9) plot(x,y,z, st=:surface,camera = (60,15)) axes intersect at: How can I change it so: z and y on min z and…

---

## [Can I change axis position in Plots](https://discourse.julialang.org/t/can-i-change-axis-position-in-plots/38966)

<div class="topic-metadata">

**Author:** [@Eris](https://discourse.julialang.org/u/Eris)\
**Replies:** 12\
**Last updated:** [December 1, 2023, 6:59am UTC](https://discourse.julialang.org/t/can-i-change-axis-position-in-plots/38966 "2023-12-01T06:59:10Z")

</div>

I’m trying to change an axis position. For example make the xaxis at y=0 instead of y=-3 here using Plots f(x)=x-3 plot(f,0,5,xlabel=“x”,ylabel= “y”) I tried the documentation for Plots but I didn’t find a possible…

---

## [Can't use Process type even though it's in Base.jl](https://discourse.julialang.org/t/cant-use-process-type-even-though-its-in-base-jl/106974)

<div class="topic-metadata">

**Author:** [@Conrad\_Wiebe](https://discourse.julialang.org/u/Conrad_Wiebe)\
**Replies:** 1\
**Last updated:** [December 1, 2023, 4:22am UTC](https://discourse.julialang.org/t/cant-use-process-type-even-though-its-in-base-jl/106974 "2023-12-01T04:22:31Z")

</div>

I see Process defined in process.jl: and included in Base here: but if I use it in code, it isn’t recognized: why is this? Tested on versions: 1.10.0-beta3+0.aarch64.apple.darwin14 1.10.0-rc1+0.aarch64.ap…

---

## [Row wise median for julia dataframes](https://discourse.julialang.org/t/row-wise-median-for-julia-dataframes/106922)

<div class="topic-metadata">

**Author:** [@AUK1939](https://discourse.julialang.org/u/AUK1939)\
**Replies:** 18\
**Last updated:** [November 30, 2023, 10:40pm UTC](https://discourse.julialang.org/t/row-wise-median-for-julia-dataframes/106922 "2023-11-30T22:40:50Z")

</div>

I’ve been advised to ask this here vs stackoverflow I want to compute the median values of all rows in a dataframe. Some columns contain NaN values. Some rows even have all NaN values. The problem with median is if th…

---

## [Something like \`grep -q String Filename\` in Julia?](https://discourse.julialang.org/t/something-like-grep-q-string-filename-in-julia/106959)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [November 30, 2023, 10:15pm UTC](https://discourse.julialang.org/t/something-like-grep-q-string-filename-in-julia/106959 "2023-11-30T22:15:29Z")

</div>

Is there something similar to grep -q Filename String in Julia? Meaning, a command that just checks if a string is present in a text file and returns true or false? Alternatively (this is actually what I need), is there…

---

## [MultiObjectiveAlgorithms.jl (Error Message)](https://discourse.julialang.org/t/multiobjectivealgorithms-jl-error-message/106876)

<div class="topic-metadata">

**Author:** [@IgorESMelo](https://discourse.julialang.org/u/IgorESMelo)\
**Replies:** 7\
**Last updated:** [November 30, 2023, 10:01pm UTC](https://discourse.julialang.org/t/multiobjectivealgorithms-jl-error-message/106876 "2023-11-30T22:01:52Z")

</div>

Hi everyone, I’ve modeled a simple model to assign instruments to procedures. I’ve implemented the model in JuMP using the solver Gurobi and package MOA.jl. When I tried to solve the model, the message below appear to m…

---

## [How to use AlgebraOfGraphics to plot three figures together](https://discourse.julialang.org/t/how-to-use-algebraofgraphics-to-plot-three-figures-together/106920)

<div class="topic-metadata">

**Author:** [@Chao](https://discourse.julialang.org/u/Chao)\
**Replies:** 3\
**Last updated:** [November 30, 2023, 9:58pm UTC](https://discourse.julialang.org/t/how-to-use-algebraofgraphics-to-plot-three-figures-together/106920 "2023-11-30T21:58:26Z")

</div>

Hello, the current plots I have are as follows: These are three different figures. I just paste them together. I want to have them in one figure. This is my code: using AlgebraOfGraphics, CairoMakie gdfc data(gdfc)…

---

## [UndefRefError - Trying access variable inside for](https://discourse.julialang.org/t/undefreferror-trying-access-variable-inside-for/106963)

<div class="topic-metadata">

**Author:** [@th.simoes](https://discourse.julialang.org/u/th.simoes)\
**Replies:** 0\
**Last updated:** [November 30, 2023, 8:30pm UTC](https://discourse.julialang.org/t/undefreferror-trying-access-variable-inside-for/106963 "2023-11-30T20:30:10Z")

</div>

I’m using DBInterface and MySQL to interact with my MySQL database, but my function is stucking into a strange error. This function below works well, but is slow and inefficient: function insertNewDebDataIntoDatabase(d…

---

## [Static array with uniform distribution](https://discourse.julialang.org/t/static-array-with-uniform-distribution/106961)

<div class="topic-metadata">

**Author:** [@sand](https://discourse.julialang.org/u/sand)\
**Replies:** 2\
**Last updated:** [November 30, 2023, 8:11pm UTC](https://discourse.julialang.org/t/static-array-with-uniform-distribution/106961 "2023-11-30T20:11:50Z")

</div>

Hello, I would like to know how to generate a static array with a uniform distribution (-2, 2). Here is an example: using StaticArrays using Distributions @SVector(randn(5)) # works rand(Uniform(-2, 2), 5) # w…

---

## [Trying to develop an extension](https://discourse.julialang.org/t/trying-to-develop-an-extension/106921)

<div class="topic-metadata">

**Author:** [@feribg](https://discourse.julialang.org/u/feribg)\
**Replies:** 5\
**Last updated:** [November 30, 2023, 6:55pm UTC](https://discourse.julialang.org/t/trying-to-develop-an-extension/106921 "2023-11-30T18:55:07Z")

</div>

I find the process of developing an extension and all the steps extremely puzzling. So far i have these files: – Package.jk – – Utils.jl Package is as follows: module Package include("Utils.jl") export Utils.Marsa…

---

## [Sum an SVector skipping one element](https://discourse.julialang.org/t/sum-an-svector-skipping-one-element/106943)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [November 30, 2023, 6:12pm UTC](https://discourse.julialang.org/t/sum-an-svector-skipping-one-element/106943 "2023-11-30T18:12:04Z")

</div>

I am optimizing a tight loop where one operation is summing an SVector except that it is required that an element is skipped. Its index is not known at compile time, it is obtained from a lookup table. Some attempts: u…

---

## [What workflows for missing values are more ergonomic in Julia?](https://discourse.julialang.org/t/what-workflows-for-missing-values-are-more-ergonomic-in-julia/106923)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 2\
**Last updated:** [November 30, 2023, 5:59pm UTC](https://discourse.julialang.org/t/what-workflows-for-missing-values-are-more-ergonomic-in-julia/106923 "2023-11-30T17:59:48Z")

</div>

Continuing the discussion from Why are missing values not ignored by default?: Hi, all, we started talking about some issues about dropping missing automatically, in the discussion it became clear that some people tend …

---

## [AD with Enzyme.jl: "task switch not allowed from inside staged nor pure functions"](https://discourse.julialang.org/t/ad-with-enzyme-jl-task-switch-not-allowed-from-inside-staged-nor-pure-functions/106944)

<div class="topic-metadata">

**Author:** [@Joh11](https://discourse.julialang.org/u/Joh11)\
**Replies:** 3\
**Last updated:** [November 30, 2023, 5:58pm UTC](https://discourse.julialang.org/t/ad-with-enzyme-jl-task-switch-not-allowed-from-inside-staged-nor-pure-functions/106944 "2023-11-30T17:58:22Z")

</div>

Hi all, I am trying to use Enzyme.jl to compute a gradient. I want to use gradient descent to find the optimal parameters to reproduce the spectrum of a family of Hamiltonians (i.e. just 2x2 hermitian matrices). Here is…

---

## [Batched matrix multiplication in CUDA](https://discourse.julialang.org/t/batched-matrix-multiplication-in-cuda/106918)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 8\
**Last updated:** [November 30, 2023, 4:59pm UTC](https://discourse.julialang.org/t/batched-matrix-multiplication-in-cuda/106918 "2023-11-30T16:59:39Z")

</div>

I am thinking of performing the following batched matrix multiplication using CUDA, but I can’t find an appropriate function for it. using LinearAlgebra N = 50; Nt = 3000; A = rand(Nt,2\*N,2\*N); C = rand(Nt,2\*N,2\*N); B …

---

## [\`@mtkmodel\` & \`constants\`?](https://discourse.julialang.org/t/mtkmodel-constants/106955)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 0\
**Last updated:** [November 30, 2023, 2:31pm UTC](https://discourse.julialang.org/t/mtkmodel-constants/106955 "2023-11-30T14:31:18Z")

</div>

I’m using ModelingToolkit v8.73.1. I’m trying to use @constants with a begin...end construct within an MTK model created by @mtkmodel \[similar to using a @parameters construct\], but Julia tells me that @constants is not…

---

## [What’s your secret in your uncanny ability to optimize code?](https://discourse.julialang.org/t/what-s-your-secret-in-your-uncanny-ability-to-optimize-code/106942)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 3\
**Last updated:** [November 30, 2023, 2:00pm UTC](https://discourse.julialang.org/t/what-s-your-secret-in-your-uncanny-ability-to-optimize-code/106942 "2023-11-30T14:00:05Z")

</div>

From a faster differential equation solver to faster sorting algorithm, people working with Julia have uncanny ability to optimize things with deceptively simple optimizations that are, indeed, the work of Julian in brin…

---

## [Override DocStringExtension @template](https://discourse.julialang.org/t/override-docstringextension-template/106954)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 0\
**Last updated:** [November 30, 2023, 1:59pm UTC](https://discourse.julialang.org/t/override-docstringextension-template/106954 "2023-11-30T13:59:21Z")

</div>

DocStringExtensions provides the @template macro that allows one to automatically interpolate the function signatures into their docstring without having to write them out or add $SIGNATURES into the docstring. Is there…

---

## [How to test differentiability efficiently](https://discourse.julialang.org/t/how-to-test-differentiability-efficiently/106631)

<div class="topic-metadata">

**Author:** [@Devetak](https://discourse.julialang.org/u/Devetak)\
**Replies:** 6\
**Last updated:** [November 30, 2023, 12:14pm UTC](https://discourse.julialang.org/t/how-to-test-differentiability-efficiently/106631 "2023-11-30T12:14:14Z")

</div>

Hello. As the tile suggest I am interested in testing (using Test) the “AD” capabilities of functions I write. My idea is to simply compare if Zygote.gradient() and finite differences give the same answer. Many times I…

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

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