# Latest

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

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

**Page:** 1466

---

## [Finding the mean value of subsets of an array](https://discourse.julialang.org/t/finding-the-mean-value-of-subsets-of-an-array/56848)

<div class="topic-metadata">

**Author:** [@EmadMasroor](https://discourse.julialang.org/u/EmadMasroor)\
**Replies:** 4\
**Last updated:** [March 10, 2021, 5:37am UTC](https://discourse.julialang.org/t/finding-the-mean-value-of-subsets-of-an-array/56848 "2021-03-10T05:37:16Z")

</div>

Hello, I am trying to take the mean value of a grid of subregions of an image. The images are from a video, hence the using VideoIO. My question does not actually depend on video-reading functionality using VideoIO fun…

---

## [Householder routines reflector! and reflectorApply! in LinearAlgebra](https://discourse.julialang.org/t/householder-routines-reflector-and-reflectorapply-in-linearalgebra/56766)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 4\
**Last updated:** [March 10, 2021, 3:15am UTC](https://discourse.julialang.org/t/householder-routines-reflector-and-reflectorapply-in-linearalgebra/56766 "2021-03-10T03:15:33Z")

</div>

Hello, I would like to use the routines reflector! and reflectorApply! of LinearAlgebra (julia/generic.jl at master · JuliaLang/julia · GitHub) to efficiently apply an Householder reflection to a vector a. The setup is…

---

## [How to write a macro whose generated code depends on a runtime expression?](https://discourse.julialang.org/t/how-to-write-a-macro-whose-generated-code-depends-on-a-runtime-expression/56635)

<div class="topic-metadata">

**Author:** [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Replies:** 4\
**Last updated:** [March 10, 2021, 1:31am UTC](https://discourse.julialang.org/t/how-to-write-a-macro-whose-generated-code-depends-on-a-runtime-expression/56635 "2021-03-10T01:31:55Z")

</div>

I want to define several structs having nearly identical bodies, and avoid repetitive coding using macros. Example: The As have identical bodies; B adds a single field. struct A1 a::Int end struct A2 a::Int end…

---

## [The max matrix of two matrices](https://discourse.julialang.org/t/the-max-matrix-of-two-matrices/56841)

<div class="topic-metadata">

**Author:** [@Oko](https://discourse.julialang.org/u/Oko)\
**Replies:** 2\
**Last updated:** [March 10, 2021, 1:27am UTC](https://discourse.julialang.org/t/the-max-matrix-of-two-matrices/56841 "2021-03-10T01:27:18Z")

</div>

If I have two N-by-N matrices A and B, how can I find the N-by-N matrix C such that its (m,n)th element is the max of the (m,n)th element in A and the (m,n)th element in B? What would be the simplest way to get the outpu…

---

## [Getting the third Friday of the month](https://discourse.julialang.org/t/getting-the-third-friday-of-the-month/56787)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 8\
**Last updated:** [March 10, 2021, 12:28am UTC](https://discourse.julialang.org/t/getting-the-third-friday-of-the-month/56787 "2021-03-10T00:28:51Z")

</div>

Given a particular month, I need to find the third Friday of that month. I just found out that there is a function called dayofweekofmonth which basically does the reverse of what I want. You give it a date and it tells …

---

## [Permutations of a vector that retain the vector "structure"](https://discourse.julialang.org/t/permutations-of-a-vector-that-retain-the-vector-structure/56790)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 6\
**Last updated:** [March 10, 2021, 12:16am UTC](https://discourse.julialang.org/t/permutations-of-a-vector-that-retain-the-vector-structure/56790 "2021-03-10T00:16:24Z")

</div>

Is there a built-in function that returns the permutations of a vector that are based on the unique elements of the vector, i.e. where the “structure” of the vector is retained ? For example given y = \["a","a","a","b","…

---

## [I noticed two packages \`IntervalSets\` and \`Intervals\` that do the same thing, and](https://discourse.julialang.org/t/i-noticed-two-packages-intervalsets-and-intervals-that-do-the-same-thing-and/56824)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 9, 2021, 10:37pm UTC](https://discourse.julialang.org/t/i-noticed-two-packages-intervalsets-and-intervals-that-do-the-same-thing-and/56824 "2021-03-09T22:37:49Z")

</div>

I noticed two packages IntervalSets and Intervals that do the same thing, and both have a similar number of transitive dependents: https://juliahub.com/ui/Packages/IntervalSets/2FHuv/0.5.2 and https://juliahub.com/ui/Pac…

---

## [Generating Custom Structs](https://discourse.julialang.org/t/generating-custom-structs/56768)

<div class="topic-metadata">

**Author:** [@olynch](https://discourse.julialang.org/u/olynch)\
**Replies:** 13\
**Last updated:** [March 9, 2021, 10:26pm UTC](https://discourse.julialang.org/t/generating-custom-structs/56768 "2021-03-09T22:26:15Z")

</div>

For a variety of reasons, it would be very useful for several projects within AlgebraicJulia · GitHub to generate struct definitions based on values that are only present at run time. Essentially, we are working with “s…

---

## [MethodError no method matching and no hints either](https://discourse.julialang.org/t/methoderror-no-method-matching-and-no-hints-either/56772)

<div class="topic-metadata">

**Author:** [@Paht\_J](https://discourse.julialang.org/u/Paht_J)\
**Replies:** 8\
**Last updated:** [March 9, 2021, 8:28pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-and-no-hints-either/56772 "2021-03-09T20:28:17Z")

</div>

Usually when Julia gives me a hint as to what types I should use. But in this case, it isn’t giving me any useful hints. Plot3D.jl ## Code dealing with Blocks @with\_kw struct Block IMAX::Int64 …

---

## [Please suggest improvements to the JuMP documentation](https://discourse.julialang.org/t/please-suggest-improvements-to-the-jump-documentation/55596)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 4\
**Last updated:** [March 9, 2021, 8:26pm UTC](https://discourse.julialang.org/t/please-suggest-improvements-to-the-jump-documentation/55596 "2021-03-09T20:26:37Z")

</div>

Dear all, I have been busy making improvements to the JuMP documentation that will be available in the next release. (You can find the development version here: Introduction · JuMP) Highlights of the changes include int…

---

## [Would it help to have a tool that automatically determines, which issues should be closed?](https://discourse.julialang.org/t/would-it-help-to-have-a-tool-that-automatically-determines-which-issues-should-be-closed/56274)

<div class="topic-metadata">

**Author:** [@vpetukhov](https://discourse.julialang.org/u/vpetukhov)\
**Replies:** 15\
**Last updated:** [March 9, 2021, 7:02pm UTC](https://discourse.julialang.org/t/would-it-help-to-have-a-tool-that-automatically-determines-which-issues-should-be-closed/56274 "2021-03-09T19:02:12Z")

</div>

I’m looking at big packages, like Plots.jl, GR.jl or DataFrames.jl, which have all 100+ open issues. And from my humble experience, issues get lost there very quickly if not resolved immediately. So I wonder if it’s poss…

---

## [The slowest zipper](https://discourse.julialang.org/t/the-slowest-zipper/56815)

<div class="topic-metadata">

**Author:** [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Replies:** 5\
**Last updated:** [March 9, 2021, 5:33pm UTC](https://discourse.julialang.org/t/the-slowest-zipper/56815 "2021-03-09T17:33:21Z")

</div>

I have an array of 1000 points, an Array{Array{Float64,1}} with length 1000. To separate the points into vectors of coordinates for each dimension, my Python instinct is to unpack the zipped points. For example, in Julia…

---

## [Do Julia resources improve in background?](https://discourse.julialang.org/t/do-julia-resources-improve-in-background/56776)

<div class="topic-metadata">

**Author:** [@HexSpin](https://discourse.julialang.org/u/HexSpin)\
**Replies:** 4\
**Last updated:** [March 9, 2021, 5:29pm UTC](https://discourse.julialang.org/t/do-julia-resources-improve-in-background/56776 "2021-03-09T17:29:19Z")

</div>

Code I wrote in December has not undergone significant modification, I’m still using Julia 1.0, and I’ve added no new packages. However, I executed the code over the last few days on the same machine and it appears 4x f…

---

## [How to force compile-time evaluation of literal calculations?](https://discourse.julialang.org/t/how-to-force-compile-time-evaluation-of-literal-calculations/56822)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 4\
**Last updated:** [March 9, 2021, 5:18pm UTC](https://discourse.julialang.org/t/how-to-force-compile-time-evaluation-of-literal-calculations/56822 "2021-03-09T17:18:16Z")

</div>

I often want to write large integer values such as 10^6 in performance critical functions. I would expect Julia to perform these calculations at compile-time when possible, but it doesn’t appear to do so: julia\> functi…

---

## [KeyError: key not found](https://discourse.julialang.org/t/keyerror-key-not-found/56813)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 1\
**Last updated:** [March 9, 2021, 5:03pm UTC](https://discourse.julialang.org/t/keyerror-key-not-found/56813 "2021-03-09T17:03:58Z")

</div>

Hello everybody Because when I try to compile this part of the model it returns this error to me: KeyError: key 5 not found using JuMP, GLPK, GLPKMathProgInterface ModelD = Model(GLPK.Optimizer) t = 1:4 w = 1:2 l = …

---

## [Dict key=\>value to array in comprehension](https://discourse.julialang.org/t/dict-key-value-to-array-in-comprehension/56818)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 3\
**Last updated:** [March 9, 2021, 4:52pm UTC](https://discourse.julialang.org/t/dict-key-value-to-array-in-comprehension/56818 "2021-03-09T16:52:16Z")

</div>

I’m trying to build a Cmd from the kwargs of a function. Basically, I want to turn eg foo("some\_option"; opt1 = "thing", opt2="other\_thing") into run(\`my\_cli some\_option --opt1 thing --opt2 other\_thing\`). Cmd() can take …

---

## [Using PyPlot in VSCode makes Julia REPL crash](https://discourse.julialang.org/t/using-pyplot-in-vscode-makes-julia-repl-crash/56810)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 1\
**Last updated:** [March 9, 2021, 4:07pm UTC](https://discourse.julialang.org/t/using-pyplot-in-vscode-makes-julia-repl-crash/56810 "2021-03-09T16:07:50Z")

</div>

Dear all Today I started experiencing a disturbing VSCode behaviour (I am on MacOS X Big Sur): I start julia REPL from VSCode I make a julia\> using PyPlot and the REPL window crashes. Unfortunately I cannot record t…

---

## [JuMP Mosek sparsity scaling](https://discourse.julialang.org/t/jump-mosek-sparsity-scaling/56731)

<div class="topic-metadata">

**Author:** [@Philip\_Olhager](https://discourse.julialang.org/u/Philip_Olhager)\
**Replies:** 6\
**Last updated:** [March 9, 2021, 4:00pm UTC](https://discourse.julialang.org/t/jump-mosek-sparsity-scaling/56731 "2021-03-09T16:00:54Z")

</div>

I’m trying to solve an SDP problem on the form \\begin{align} \\min \\hspace{0.5cm} & c^\\intercal x \\\\ \\text{s.t.} \\hspace{0.5cm} & A\_0 + \\sum A\_i x\_i \\succeq 0 \\end{align} with x being of size ~370 and the A matrices …

---

## [Are integers immutable and are they acceptable as keys in](https://discourse.julialang.org/t/are-integers-immutable-and-are-they-acceptable-as-keys-in/56816)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 1\
**Last updated:** [March 9, 2021, 3:57pm UTC](https://discourse.julialang.org/t/are-integers-immutable-and-are-they-acceptable-as-keys-in/56816 "2021-03-09T15:57:28Z")

</div>

I was reading about Mutable Composite Types, and it says: In particular, this means that small enough immutable values like integers and floats are typically passed to functions in registers (or stack allocated). Are…

---

## [How to assign Matrix with dimensions (1,1) to a scalar](https://discourse.julialang.org/t/how-to-assign-matrix-with-dimensions-1-1-to-a-scalar/56808)

<div class="topic-metadata">

**Author:** [@tqml](https://discourse.julialang.org/u/tqml)\
**Replies:** 9\
**Last updated:** [March 9, 2021, 3:38pm UTC](https://discourse.julialang.org/t/how-to-assign-matrix-with-dimensions-1-1-to-a-scalar/56808 "2021-03-09T15:38:01Z")

</div>

Hello I’m quite new to Julia and coming from MATLAB and Python and I have some trouble with operations that should be quite common but I haven’t found any workaround/solution in the usual places (Manual, Github and here)…

---

## [How to save ensemble solutions?](https://discourse.julialang.org/t/how-to-save-ensemble-solutions/54876)

<div class="topic-metadata">

**Author:** [@minou92](https://discourse.julialang.org/u/minou92)\
**Replies:** 5\
**Last updated:** [March 9, 2021, 3:12pm UTC](https://discourse.julialang.org/t/how-to-save-ensemble-solutions/54876 "2021-03-09T15:12:37Z")

</div>

Once I create ensemble systems, How could we save the solution in text or csv files ? γ = 0.2647 D = 0.4811 μ= 34 u₀=34 #7.0 f(u,p,t) = -γ\*(u - μ) g(u,p,t) = sqrt(D) dt = 1 tspan = (1,60) prob = SDEProblem(f,g,…

---

## [Reverse proxy needed for Dash.jl app?](https://discourse.julialang.org/t/reverse-proxy-needed-for-dash-jl-app/56812)

<div class="topic-metadata">

**Author:** [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Replies:** 0\
**Last updated:** [March 9, 2021, 3:03pm UTC](https://discourse.julialang.org/t/reverse-proxy-needed-for-dash-jl-app/56812 "2021-03-09T15:03:09Z")

</div>

I have a dashboard written in Dash.jl targeted at a relatively small audience. However, for the small Heroku dynos there’s just not enough memory and the larger ones get quite expensive so we were looking into hosting th…

---

## [Interpolating an \`Expr\` containing \`SSAValue\`s/\`Slot\`s into another \`Expr\`](https://discourse.julialang.org/t/interpolating-an-expr-containing-ssavalue-s-slot-s-into-another-expr/56796)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 9, 2021, 2:59pm UTC](https://discourse.julialang.org/t/interpolating-an-expr-containing-ssavalue-s-slot-s-into-another-expr/56796 "2021-03-09T14:59:04Z")

</div>

Anyone know a way to interpolate an Expr containing SSAValues/Slots into another expression? Something like julia\> @eval Main ans = $(QuoteNode(code\_typed(cos, (Float64, ))\[1\]\[1\].code\[50\])) ERROR: syntax: SSAValue objec…

---

## [SVD gives different results from Python with MWE](https://discourse.julialang.org/t/svd-gives-different-results-from-python-with-mwe/56674)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 15\
**Last updated:** [March 9, 2021, 2:32pm UTC](https://discourse.julialang.org/t/svd-gives-different-results-from-python-with-mwe/56674 "2021-03-09T14:32:53Z")

</div>

Hello, I have a python written code, and it uses svd from numpy. And I am trying to port the same code in Julia. The problem I am facing is that after some point, even though I read the same files for both programming …

---

## [VSCode's linter is now available in Atom/Juno](https://discourse.julialang.org/t/vscodes-linter-is-now-available-in-atom-juno/56802)

<div class="topic-metadata">

**Author:** [@takbal](https://discourse.julialang.org/u/takbal)\
**Replies:** 0\
**Last updated:** [March 9, 2021, 1:30pm UTC](https://discourse.julialang.org/t/vscodes-linter-is-now-available-in-atom-juno/56802 "2021-03-09T13:30:26Z")

</div>

I have modified the linter-julia Atom package so it now uses StaticLint.jl, the same package that is behind the VSCode plugin: With help from @Amin\_Yahyaabadi, it should be now available as the 0.9.0 upgrade of ‘linte…

---

## [How to resolve \`Any\`s in this function?](https://discourse.julialang.org/t/how-to-resolve-any-s-in-this-function/56717)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 16\
**Last updated:** [March 9, 2021, 12:44pm UTC](https://discourse.julialang.org/t/how-to-resolve-any-s-in-this-function/56717 "2021-03-09T12:44:07Z")

</div>

Consider this: using ComponentArrays, Parameters function test(g, a; data=data) @unpack P = data if g == 1 oc = (g, a) -\> P\[g, a\] elseif g == 2 oc = (g, a) -\> P\[g, a\] + 1 end return…

---

## [How to submit an issue to dependent packages to alert to a breaking change](https://discourse.julialang.org/t/how-to-submit-an-issue-to-dependent-packages-to-alert-to-a-breaking-change/56749)

<div class="topic-metadata">

**Author:** [@j\_verzani](https://discourse.julialang.org/u/j_verzani)\
**Replies:** 3\
**Last updated:** [March 9, 2021, 12:19pm UTC](https://discourse.julialang.org/t/how-to-submit-an-issue-to-dependent-packages-to-alert-to-a-breaking-change/56749 "2021-03-09T12:19:45Z")

</div>

I recently tagged a breaking change to the Polynomials package. The change is modest, and will likely only be noticed by packages that subtype the abstract polynomial types, but there are numerous dependent packages, so …

---

## [Macro: is it possible to receive an evaluated argument?](https://discourse.julialang.org/t/macro-is-it-possible-to-receive-an-evaluated-argument/56788)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 8\
**Last updated:** [March 9, 2021, 11:02am UTC](https://discourse.julialang.org/t/macro-is-it-possible-to-receive-an-evaluated-argument/56788 "2021-03-09T11:02:24Z")

</div>

I’d like to manipulate function arguments easily and I expect that macro can do this. However, I probably misunderstood the usage of macro. For example, the following is a brief (probably not runnable) code describing …

---

## [Fast GPU Kernels differentiable with Zygote](https://discourse.julialang.org/t/fast-gpu-kernels-differentiable-with-zygote/56756)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 7\
**Last updated:** [March 9, 2021, 10:29am UTC](https://discourse.julialang.org/t/fast-gpu-kernels-differentiable-with-zygote/56756 "2021-03-09T10:29:15Z")

</div>

Hey, so far I was using Tullio.jl to generate array based regularizers which are also (very) fast using Zygote.jl. So as an example a Total Variation regularizer: reg(x) = @tullio res = sqrt(abs2(x\[i, j\] - x\[i+1, j\]) …

---

## [ReadOnlyMemoryError](https://discourse.julialang.org/t/readonlymemoryerror/8548)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 14\
**Last updated:** [March 9, 2021, 7:20am UTC](https://discourse.julialang.org/t/readonlymemoryerror/8548 "2021-03-09T07:20:27Z")

</div>

I have a lengthy code that recently has stopped working on my Linux machine (Julia 0.6.2) although it’s still fine on Windows. I don’t have a MWE; the site of the error moves with small changes to the code. Anyone hav…

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

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