# Latest

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

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

**Page:** 769

---

## [Accessing abstract array struct field allocates memory?](https://discourse.julialang.org/t/accessing-abstract-array-struct-field-allocates-memory/95313)

<div class="topic-metadata">

**Author:** [@Kirby\_Zhang](https://discourse.julialang.org/u/Kirby_Zhang)\
**Replies:** 3\
**Last updated:** [February 28, 2023, 8:07am UTC](https://discourse.julialang.org/t/accessing-abstract-array-struct-field-allocates-memory/95313 "2023-02-28T08:07:04Z")

</div>

The following code uses AbstractVector as a struct field, and it results in memory being allocated: struct S1 A::AbstractVector{Int} end function f(s::S1) s.A\[end\] end s = S1(\[1,2,3\]) f(s) @code\_warntype f(s)…

---

## [Offline HTML plot](https://discourse.julialang.org/t/offline-html-plot/93609)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 5\
**Last updated:** [February 28, 2023, 8:05am UTC](https://discourse.julialang.org/t/offline-html-plot/93609 "2023-02-28T08:05:36Z")

</div>

Interactive HTML-plots are one of the nice features of plotly / plotlyJS but the standard HTML-output does not include a script tag containing the plotly.js source code (~3MB). In python this can be achieved via: fig.wr…

---

## [Transformers.jl: causal mask on decoder](https://discourse.julialang.org/t/transformers-jl-causal-mask-on-decoder/95212)

<div class="topic-metadata">

**Author:** [@Rrdd](https://discourse.julialang.org/u/Rrdd)\
**Replies:** 4\
**Last updated:** [February 28, 2023, 7:16am UTC](https://discourse.julialang.org/t/transformers-jl-causal-mask-on-decoder/95212 "2023-02-28T07:16:22Z")

</div>

hi, I am new to Transformers.jl and try to follow the tutorial (Tutorial · Transformers.jl). I wonder where I can find more details about this call t = decoder\_trf(e, m, attention\_mask, cross\_attention\_mask) In particu…

---

## [Why is my own simplified IO type slower than Base.IOBuffer?](https://discourse.julialang.org/t/why-is-my-own-simplified-io-type-slower-than-base-iobuffer/95308)

<div class="topic-metadata">

**Author:** [@cadaverous](https://discourse.julialang.org/u/cadaverous)\
**Replies:** 1\
**Last updated:** [February 28, 2023, 6:35am UTC](https://discourse.julialang.org/t/why-is-my-own-simplified-io-type-slower-than-base-iobuffer/95308 "2023-02-28T06:35:09Z")

</div>

I am trying to extend Base to include an IO buffer type, similar to DevNull, which just throws away all data written to it, but keeps track of a pointer, in order to find the serialized size of an object. (as suggested i…

---

## [Performance of variants of findall](https://discourse.julialang.org/t/performance-of-variants-of-findall/31659)

<div class="topic-metadata">

**Author:** [@j2b2](https://discourse.julialang.org/u/j2b2)\
**Replies:** 15\
**Last updated:** [February 28, 2023, 6:04am UTC](https://discourse.julialang.org/t/performance-of-variants-of-findall/31659 "2023-02-28T06:04:02Z")

</div>

Here is a small session: julia\> using BenchmarkTools julia\> A = rand(100, 100) 100×100 Array{Float64,2} \[...\] julia\> @btime findall(A .\> 0.5) 39.951 μs (7 allocations: 85.06 KiB) 5077-element Array{CartesianIndex{2…

---

## [How to get Simplified variance of a random variable?](https://discourse.julialang.org/t/how-to-get-simplified-variance-of-a-random-variable/95071)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 6\
**Last updated:** [February 28, 2023, 5:14am UTC](https://discourse.julialang.org/t/how-to-get-simplified-variance-of-a-random-variable/95071 "2023-02-28T05:14:53Z")

</div>

Hi all, I want to use Julia to get the end result like this: the Expectation of (X - \\mu)^{2} will be computed at the end to become: E(X^{2}) - \\mu^{2} but how? this is my try out: using SymPy # https://docs.symp…

---

## [Failed: Error validating submit job request](https://discourse.julialang.org/t/failed-error-validating-submit-job-request/95216)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 1\
**Last updated:** [February 28, 2023, 4:38am UTC](https://discourse.julialang.org/t/failed-error-validating-submit-job-request/95216 "2023-02-28T04:38:49Z")

</div>

I want to run Pluto notebook on JULIAHUB but on clicking Start it shows Failed: Error validating submit job request What should i do ? I have already added Credit card in payments section.

---

## [Where is the \`pdf\` function in Distribution.jl implemented?](https://discourse.julialang.org/t/where-is-the-pdf-function-in-distribution-jl-implemented/23896)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 6\
**Last updated:** [February 28, 2023, 4:38am UTC](https://discourse.julialang.org/t/where-is-the-pdf-function-in-distribution-jl-implemented/23896 "2023-02-28T04:38:13Z")

</div>

Hello Julia community, julia\> pdf(Normal(), 0.3) 0.38138781546052414 I want to know how the pdf function is implemented, but the source code for Distribution.jl tells me nothing (in fact it looks like an infinite loop)…

---

## [Method Error? objects of type Vector{Float64} are not callable Use square brackets \[\] for indexing an Array](https://discourse.julialang.org/t/method-error-objects-of-type-vector-float64-are-not-callable-use-square-brackets-for-indexing-an-array/95305)

<div class="topic-metadata">

**Author:** [@Andrew\_S1](https://discourse.julialang.org/u/Andrew_S1)\
**Replies:** 1\
**Last updated:** [February 28, 2023, 4:03am UTC](https://discourse.julialang.org/t/method-error-objects-of-type-vector-float64-are-not-callable-use-square-brackets-for-indexing-an-array/95305 "2023-02-28T04:03:43Z")

</div>

I am writing a function for the Runge-Kutta method (Rk4) and when I try to put values into the equation I get a method error. function explicit\_rk4(f::Function, yo::Vector, t\_final::Real, N::Int) t=range(0, t\_final, N+…

---

## [\`let x\` without assignment (\`let x = 1\`)](https://discourse.julialang.org/t/let-x-without-assignment-let-x-1/95297)

<div class="topic-metadata">

**Author:** [@maxchendt](https://discourse.julialang.org/u/maxchendt)\
**Replies:** 1\
**Last updated:** [February 28, 2023, 1:34am UTC](https://discourse.julialang.org/t/let-x-without-assignment-let-x-1/95297 "2023-02-28T01:34:01Z")

</div>

Example from Let Blocks var1 = let x display(@isdefined x) #false for i in 1:5 (i == 4) && (x = i; break) end x end we see that x is undefined before the a…

---

## [Multidimensional linear interpolation](https://discourse.julialang.org/t/multidimensional-linear-interpolation/35299)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 10\
**Last updated:** [February 27, 2023, 11:29pm UTC](https://discourse.julialang.org/t/multidimensional-linear-interpolation/35299 "2023-02-27T23:29:01Z")

</div>

I have some 2D Array data x that I want to (linearly) interpolate along a single vector a uniformly in each dimension (with the Interpolations package). An example is below: using Interpolations a = collect(range(0, s…

---

## [Deleting a container of constraints](https://discourse.julialang.org/t/deleting-a-container-of-constraints/95257)

<div class="topic-metadata">

**Author:** [@A\_M](https://discourse.julialang.org/u/A_M)\
**Replies:** 3\
**Last updated:** [February 27, 2023, 11:10pm UTC](https://discourse.julialang.org/t/deleting-a-container-of-constraints/95257 "2023-02-27T23:10:08Z")

</div>

I am trying to remove a container of constraints after solving it to add a new set of constraints before resolving it: @constraint(model, A\[s=1:n\], x\[s\] == y\[s\]) I tried for s in 1:n delete(model, A\[s\]) end or del…

---

## [Error when constraining variable to be Hermitian PSD](https://discourse.julialang.org/t/error-when-constraining-variable-to-be-hermitian-psd/95223)

<div class="topic-metadata">

**Author:** [@araujoms](https://discourse.julialang.org/u/araujoms)\
**Replies:** 12\
**Last updated:** [February 27, 2023, 10:50pm UTC](https://discourse.julialang.org/t/error-when-constraining-variable-to-be-hermitian-psd/95223 "2023-02-27T22:50:41Z")

</div>

I’m writing an SDP for a traditional problem in quantum information, state discrimination. When I constrain the variables to real symmetric, it works. But the problem really needs them to be complex Hermitian. The code i…

---

## [Order of eigenvectors by using eigvecs()](https://discourse.julialang.org/t/order-of-eigenvectors-by-using-eigvecs/95048)

<div class="topic-metadata">

**Author:** [@jisutich](https://discourse.julialang.org/u/jisutich)\
**Replies:** 2\
**Last updated:** [February 27, 2023, 10:47pm UTC](https://discourse.julialang.org/t/order-of-eigenvectors-by-using-eigvecs/95048 "2023-02-27T22:47:41Z")

</div>

Hi, I have a very simple question. Suppose I have a Hermitian matrix A and I want to calculate its eigenvectors. I can use eigvecs(A) and the columns of it are the eigenvectors. But I want to know what is the order of t…

---

## [PartitionedArrays and DifferentialEquations](https://discourse.julialang.org/t/partitionedarrays-and-differentialequations/93853)

<div class="topic-metadata">

**Author:** [@bmxam](https://discourse.julialang.org/u/bmxam)\
**Replies:** 3\
**Last updated:** [February 27, 2023, 10:02pm UTC](https://discourse.julialang.org/t/partitionedarrays-and-differentialequations/93853 "2023-02-27T22:02:27Z")

</div>

Hi everyone, Are there any example combining DifferentialEquations and PartitionedArrays? Of course I’ve tried myself, but I’ve encountered obstacles because DifferentialEquations implies explicit indexing a\[i\] while P…

---

## [Multiplication, sum and Cholesky decomposition of sparse matrices](https://discourse.julialang.org/t/multiplication-sum-and-cholesky-decomposition-of-sparse-matrices/95196)

<div class="topic-metadata">

**Author:** [@andresdrenik](https://discourse.julialang.org/u/andresdrenik)\
**Replies:** 4\
**Last updated:** [February 27, 2023, 8:10pm UTC](https://discourse.julialang.org/t/multiplication-sum-and-cholesky-decomposition-of-sparse-matrices/95196 "2023-02-27T20:10:38Z")

</div>

I’m trying to solve a system of differential equations involving variational inequalities. I’m currently using the LCP solver in LCPsolve.jl. I’ve profiled my code and found that the bottleneck is in lines 216-219 here. …

---

## [Naming variable bound and integrality constraints in Jump](https://discourse.julialang.org/t/naming-variable-bound-and-integrality-constraints-in-jump/95270)

<div class="topic-metadata">

**Author:** [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Replies:** 2\
**Last updated:** [February 27, 2023, 7:03pm UTC](https://discourse.julialang.org/t/naming-variable-bound-and-integrality-constraints-in-jump/95270 "2023-02-27T19:03:12Z")

</div>

Diagnosing an infeasible model can be tricky. Sometimes solvers provide useful information like conflict reports and the constraints involved in the infeasibility - for these to be useful, we have to be able to relate th…

---

## [\[ANN\] PowerSystems.jl v2](https://discourse.julialang.org/t/ann-powersystems-jl-v2/95284)

<div class="topic-metadata">

**Author:** [@jdlara-berkeley](https://discourse.julialang.org/u/jdlara-berkeley)\
**Replies:** 0\
**Last updated:** [February 27, 2023, 6:56pm UTC](https://discourse.julialang.org/t/ann-powersystems-jl-v2/95284 "2023-02-27T18:56:32Z")

</div>

We are happy to announce the release of PowerSystems.jl v2, where we have made several improvements to the modeling of loads in AC and have also removed from the package the power flow and network matrices representation…

---

## [JuMP Support for solver specific methods to create fixed MIP](https://discourse.julialang.org/t/jump-support-for-solver-specific-methods-to-create-fixed-mip/94775)

<div class="topic-metadata">

**Author:** [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Replies:** 5\
**Last updated:** [February 27, 2023, 6:56pm UTC](https://discourse.julialang.org/t/jump-support-for-solver-specific-methods-to-create-fixed-mip/94775 "2023-02-27T18:56:14Z")

</div>

It seems that a very common requirement is to get duals from a MIP problem. The traditional way of doing this is to relax the integer variables in the problem and fix them to their MIP solution and obtain the duals from …

---

## [CuPy CuFFT ~2x faster than CUDA.jl CuFFT](https://discourse.julialang.org/t/cupy-cufft-2x-faster-than-cuda-jl-cufft/89151)

<div class="topic-metadata">

**Author:** [@Dreycen\_Foiles](https://discourse.julialang.org/u/Dreycen_Foiles)\
**Replies:** 15\
**Last updated:** [February 27, 2023, 6:42pm UTC](https://discourse.julialang.org/t/cupy-cufft-2x-faster-than-cuda-jl-cufft/89151 "2023-02-27T18:42:31Z")

</div>

I am working on a simulation whose bottleneck is lots of FFT-based convolutions performed on the GPU. I wanted to see how FFT’s from CUDA.jl would compare with one of bigger Python GPU libraries CuPy. I was surprised to …

---

## [How to guarantee that using @Threads/@tspawnat will create threads that work on different Cores?](https://discourse.julialang.org/t/how-to-guarantee-that-using-threads-tspawnat-will-create-threads-that-work-on-different-cores/95280)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 18\
**Last updated:** [February 27, 2023, 6:21pm UTC](https://discourse.julialang.org/t/how-to-guarantee-that-using-threads-tspawnat-will-create-threads-that-work-on-different-cores/95280 "2023-02-27T18:21:25Z")

</div>

I am defining julia -t 2 before running my julia code which contains @Threads/@tspawnat to let some works run on the two threads. However, these two threads could be ruining on the same core and I am wondering if there …

---

## [BinStatistics.jl: Highly flexible and efficient computation of n-dimensional binned statistic(s) for n-variable(s)](https://discourse.julialang.org/t/binstatistics-jl-highly-flexible-and-efficient-computation-of-n-dimensional-binned-statistic-s-for-n-variable-s/95283)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 0\
**Last updated:** [February 27, 2023, 5:46pm UTC](https://discourse.julialang.org/t/binstatistics-jl-highly-flexible-and-efficient-computation-of-n-dimensional-binned-statistic-s-for-n-variable-s/95283 "2023-02-27T17:46:34Z")

</div>

I often need to apply functions or calculate statistics on grouped variables for large datasets (e.g scipy’s binned\_statistic). I could not find a good function for this in Julia, hence BinStatistics. BinStatistics incl…

---

## [Neo4j Connection](https://discourse.julialang.org/t/neo4j-connection/95031)

<div class="topic-metadata">

**Author:** [@SergeantMike67](https://discourse.julialang.org/u/SergeantMike67)\
**Replies:** 5\
**Last updated:** [February 27, 2023, 5:08pm UTC](https://discourse.julialang.org/t/neo4j-connection/95031 "2023-02-27T17:08:30Z")

</div>

Does anybody have experience trying to connect with a Neo4j database on a port other than the default provided for in Neo4j.jl? I can’t make heads or tails of it and Julia keeps yelling at me that I am doing it wrong, w…

---

## [Help with custom packets over raw sockets](https://discourse.julialang.org/t/help-with-custom-packets-over-raw-sockets/95205)

<div class="topic-metadata">

**Author:** [@Fragamir](https://discourse.julialang.org/u/Fragamir)\
**Replies:** 1\
**Last updated:** [February 27, 2023, 4:27pm UTC](https://discourse.julialang.org/t/help-with-custom-packets-over-raw-sockets/95205 "2023-02-27T16:27:14Z")

</div>

Hi, I’m trying to write some custom packets (That I have already created and verified they are valid) to the network, I have tried using both tap interfaces and raw sockets. I created the raw socket following this thre…

---

## [Fastest way to convert an MVector/NTuple to a different sized SVector/NTuple?](https://discourse.julialang.org/t/fastest-way-to-convert-an-mvector-ntuple-to-a-different-sized-svector-ntuple/95240)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 8\
**Last updated:** [February 27, 2023, 3:35pm UTC](https://discourse.julialang.org/t/fastest-way-to-convert-an-mvector-ntuple-to-a-different-sized-svector-ntuple/95240 "2023-02-27T15:35:35Z")

</div>

I have tried a number of things to convert an MVector to an SVector and they all result in various numbers of allocations and/or poor performance. My understanding is that an MVector is just a tuple wrapped in a struct. …

---

## [Running a Julia Programm without a Window popping up](https://discourse.julialang.org/t/running-a-julia-programm-without-a-window-popping-up/95185)

<div class="topic-metadata">

**Author:** [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Replies:** 9\
**Last updated:** [February 27, 2023, 3:25pm UTC](https://discourse.julialang.org/t/running-a-julia-programm-without-a-window-popping-up/95185 "2023-02-27T15:25:14Z")

</div>

Is it possible to start a Julia program via a shortcut so that no window opens? I’ve been struggling with this for days and can’t find an easy solution. I just wrote the following micro program to test it: File: test.j…

---

## [Display @code\_warntype output in docs](https://discourse.julialang.org/t/display-code-warntype-output-in-docs/95264)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 2\
**Last updated:** [February 27, 2023, 2:25pm UTC](https://discourse.julialang.org/t/display-code-warntype-output-in-docs/95264 "2023-02-27T14:25:35Z")

</div>

Hi! How would one go about displaying the output of @code\_warntype in a Documenter-generated webpage? From what I can tell, there are two obstacles: @code\_warntype prints its output in the REPL instead of returning …

---

## [\[FluxML + Functors\] How to walk the model and ∇model simultaneously?](https://discourse.julialang.org/t/fluxml-functors-how-to-walk-the-model-and-model-simultaneously/95170)

<div class="topic-metadata">

**Author:** [@mariusd](https://discourse.julialang.org/u/mariusd)\
**Replies:** 7\
**Last updated:** [February 27, 2023, 12:51pm UTC](https://discourse.julialang.org/t/fluxml-functors-how-to-walk-the-model-and-model-simultaneously/95170 "2023-02-27T12:51:53Z")

</div>

The following two lines of code are commonly used when training a model in Julia. ∇model = gradient(m → loss(m, x, y), model)\[1\] opt\_state, model = Optimisers.update!(opt\_state, model, ∇model) For debugging purspose…

---

## [Taija - Trustworthy Artificial Intelligence in Julia](https://discourse.julialang.org/t/taija-trustworthy-artificial-intelligence-in-julia/95265)

<div class="topic-metadata">

**Author:** [@pat-alt](https://discourse.julialang.org/u/pat-alt)\
**Replies:** 0\
**Last updated:** [February 27, 2023, 12:06pm UTC](https://discourse.julialang.org/t/taija-trustworthy-artificial-intelligence-in-julia/95265 "2023-02-27T12:06:39Z")

</div>

Are you working on explainable, interpretable, responsible, robust or secure Artificial Intelligence, Machine Learning and Data Science in Julia? Then you may be interested in Taija :dog: Taija stands for “Trustwort…

---

## [A better git workflow?](https://discourse.julialang.org/t/a-better-git-workflow/95248)

<div class="topic-metadata">

**Author:** [@uje](https://discourse.julialang.org/u/uje)\
**Replies:** 3\
**Last updated:** [February 27, 2023, 10:56am UTC](https://discourse.julialang.org/t/a-better-git-workflow/95248 "2023-02-27T10:56:12Z")

</div>

Having a defined Git workflow is crucial for efficient and organized software development. As a developer working on Julia projects and other open-source projects, not having a defined workflow has been frustrating and h…

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

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