# Latest

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

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

**Page:** 1063

---

## [Getindex for AbstractArray with Function](https://discourse.julialang.org/t/getindex-for-abstractarray-with-function/79810)

<div class="topic-metadata">

**Author:** [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Replies:** 7\
**Last updated:** [April 22, 2022, 8:32am UTC](https://discourse.julialang.org/t/getindex-for-abstractarray-with-function/79810 "2022-04-22T08:32:01Z")

</div>

There is a AbstractArray: m=\[\[1,2,3\] \[2,3,4\]\] """ 3×2 Matrix{Int64}: 1 2 2 3 3 4 """ How can I dispath on Function to Base.getindex to have this custom method? m\[\>=(2),:\] """ 1×2 Matrix{Int64}: 2 3 3 4…

---

## [One-line \`if ... then ...\` syntax](https://discourse.julialang.org/t/one-line-if-then-syntax/79573)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 26\
**Last updated:** [April 22, 2022, 7:17am UTC](https://discourse.julialang.org/t/one-line-if-then-syntax/79573 "2022-04-22T07:17:20Z")

</div>

Which of the following two options do you prefer for a one-line if-then syntax? poll Related Github issue: https://github.com/JuliaLang/julia/issues/16389

---

## [State of gRPC in Julia](https://discourse.julialang.org/t/state-of-grpc-in-julia/79790)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 2\
**Last updated:** [April 22, 2022, 6:28am UTC](https://discourse.julialang.org/t/state-of-grpc-in-julia/79790 "2022-04-22T06:28:00Z")

</div>

Hi all :slight\_smile: I was looking at the gRPC package https://github.com/JuliaComputing/gRPCClient.jl and was wondering how it’s works and what the general status is. Any experiences or tutorials for that package? …

---

## [Multithreads in REPL](https://discourse.julialang.org/t/multithreads-in-repl/79792)

<div class="topic-metadata">

**Author:** [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Replies:** 2\
**Last updated:** [April 22, 2022, 4:34am UTC](https://discourse.julialang.org/t/multithreads-in-repl/79792 "2022-04-22T04:34:14Z")

</div>

I usually use Julia in Jupyter. While using Threads.@spawn, the threads of jupyter is occupied. Then, untie the whole task is finished, I can not do anything. So, is there a way I can forbbidden Threads.@spawn using #1 …

---

## [Transpose of a matrix of colors](https://discourse.julialang.org/t/transpose-of-a-matrix-of-colors/79809)

<div class="topic-metadata">

**Author:** [@ahmed](https://discourse.julialang.org/u/ahmed)\
**Replies:** 1\
**Last updated:** [April 22, 2022, 4:24am UTC](https://discourse.julialang.org/t/transpose-of-a-matrix-of-colors/79809 "2022-04-22T04:24:05Z")

</div>

I have an array(ColorsArray) that contains vectors with elements that are colors of the type RGB{Float64}. I arranged these vectors into a matrix by doing: reduce(hcat,ColorsArray). I wanna take the transpose of this m…

---

## [Strange behavior of plot](https://discourse.julialang.org/t/strange-behavior-of-plot/79803)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [April 22, 2022, 2:47am UTC](https://discourse.julialang.org/t/strange-behavior-of-plot/79803 "2022-04-22T02:47:10Z")

</div>

I noticed a very strange behavior of comment strings followed by the semi-colon. Consider the simple program: using Plots plot(1:10, 1:10, c=:blue) # This will create a plot as expected. However, if I change the last l…

---

## [Current state of Julia Probabilistic Programming Languages and functionalities](https://discourse.julialang.org/t/current-state-of-julia-probabilistic-programming-languages-and-functionalities/78711)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 9\
**Last updated:** [April 22, 2022, 2:33am UTC](https://discourse.julialang.org/t/current-state-of-julia-probabilistic-programming-languages-and-functionalities/78711 "2022-04-22T02:33:17Z")

</div>

Hey folks. I was looking over the various Julia probabilistic programming languages and was trying to reconcile the features of each. Unfortunately I did not get very far. But I was wondering if anyone can point me to a …

---

## [Merging two dataframes of different length](https://discourse.julialang.org/t/merging-two-dataframes-of-different-length/79806)

<div class="topic-metadata">

**Author:** [@Will\_G](https://discourse.julialang.org/u/Will_G)\
**Replies:** 2\
**Last updated:** [April 22, 2022, 2:02am UTC](https://discourse.julialang.org/t/merging-two-dataframes-of-different-length/79806 "2022-04-22T02:02:41Z")

</div>

I am a beginner with Julia and am struggling to merge two dataframes I have of various length. This is one of the dataframes, then I have another that is 5120 long, in interest of space I have only included the first 20,…

---

## [What have you been working on recently?](https://discourse.julialang.org/t/what-have-you-been-working-on-recently/79775)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 1\
**Last updated:** [April 22, 2022, 1:44am UTC](https://discourse.julialang.org/t/what-have-you-been-working-on-recently/79775 "2022-04-22T01:44:32Z")

</div>

I love coming onto Discourse, scanning the recent replies, and seeing what cool things people are doing in Julia. Often, however, you only get a glimpse at what’s going on because you only see when people need help, rath…

---

## [Tests passing on 1.6, segfault on 1.7](https://discourse.julialang.org/t/tests-passing-on-1-6-segfault-on-1-7/79487)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 6\
**Last updated:** [April 22, 2022, 1:09am UTC](https://discourse.julialang.org/t/tests-passing-on-1-6-segfault-on-1-7/79487 "2022-04-22T01:09:35Z")

</div>

I’m seeing some strange behavior here. I have some tests that pass for Julia 1.6, and also pass locally for Julia 1.7.0, but cause a segfault on 1.7 in Github actions (I think that’s 1.7.2?). Especially surprising is th…

---

## [Dynamic tick labels](https://discourse.julialang.org/t/dynamic-tick-labels/79802)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 2\
**Last updated:** [April 21, 2022, 10:34pm UTC](https://discourse.julialang.org/t/dynamic-tick-labels/79802 "2022-04-21T22:34:31Z")

</div>

I have a simple plot like this: using Plots plot(sind.(1:360)) It looks good by default, but when I use the pan and zoom tools to explore the plot, the x and y tick labels don’t automatically update with the changing …

---

## [Fastest way to fill a Sparse Matrix?](https://discourse.julialang.org/t/fastest-way-to-fill-a-sparse-matrix/79795)

<div class="topic-metadata">

**Author:** [@Alejandro\_Quiaro\_San](https://discourse.julialang.org/u/Alejandro_Quiaro_San)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 9:29pm UTC](https://discourse.julialang.org/t/fastest-way-to-fill-a-sparse-matrix/79795 "2022-04-21T21:29:05Z")

</div>

Hello guys, I am wondering which should be the right strategy to fill values in a big sparse matrix. I have a variable L, which is an n x m matrix, and is sparse. An outer loop runs on the row index, and just a few valu…

---

## [Zygote dozens\* of times slower than manually written function](https://discourse.julialang.org/t/zygote-dozens-of-times-slower-than-manually-written-function/79748)

<div class="topic-metadata">

**Author:** [@Gabrielmlando](https://discourse.julialang.org/u/Gabrielmlando)\
**Replies:** 17\
**Last updated:** [April 21, 2022, 9:25pm UTC](https://discourse.julialang.org/t/zygote-dozens-of-times-slower-than-manually-written-function/79748 "2022-04-21T21:25:48Z")

</div>

I am trying to use Zygote in order to avoid the need of manually passing gradients/Hessians. I started by the simplest possible example for my applications, namely a hydrogen atom. The Hamiltonian and initial point are d…

---

## [Bayes\_rule\_discrete.ipynb demo in ForneyLab](https://discourse.julialang.org/t/bayes-rule-discrete-ipynb-demo-in-forneylab/79758)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 9:23pm UTC](https://discourse.julialang.org/t/bayes-rule-discrete-ipynb-demo-in-forneylab/79758 "2022-04-21T21:23:17Z")

</div>

Hi, I am relatively new to ForneyLab and am trying it again after a year-long break using Julia 1.7 and ForneyLab 0.11.4 . While most of the demos provided run fine, the simplest demo of all, Bayes-rule\_discrete.ipynb g…

---

## [Convex.jl/Mosek/SCS setting callback](https://discourse.julialang.org/t/convex-jl-mosek-scs-setting-callback/79780)

<div class="topic-metadata">

**Author:** [@Alex\_W](https://discourse.julialang.org/u/Alex_W)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 8:12pm UTC](https://discourse.julialang.org/t/convex-jl-mosek-scs-setting-callback/79780 "2022-04-21T20:12:30Z")

</div>

Hello all, I am new to Julia so I apologize if this is trivial. I am calling Mosek and SCS through Convex.jl and want to track how quickly these solvers are converging (for plotting purposes). Is it possible to pass a …

---

## [Unexpected \`sizeof\` struct with long StaticArrays](https://discourse.julialang.org/t/unexpected-sizeof-struct-with-long-staticarrays/79797)

<div class="topic-metadata">

**Author:** [@cchderrick](https://discourse.julialang.org/u/cchderrick)\
**Replies:** 1\
**Last updated:** [April 21, 2022, 7:21pm UTC](https://discourse.julialang.org/t/unexpected-sizeof-struct-with-long-staticarrays/79797 "2022-04-21T19:21:06Z")

</div>

Consider this: using StaticArrays struct Dummy B::SVector{34,UInt8} end @assert sizeof(Dummy) == sum(sizeof.(fieldtypes(Dummy))) struct Dummy32 A::Float32 B::SVector{32,UInt8} end @assert sizeof(Dummy32) =…

---

## [Turing Guide documentation: prob"..." examples throws errors](https://discourse.julialang.org/t/turing-guide-documentation-prob-examples-throws-errors/50319)

<div class="topic-metadata">

**Author:** [@Hakan\_Kjellerstrand](https://discourse.julialang.org/u/Hakan_Kjellerstrand)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 7:18pm UTC](https://discourse.julialang.org/t/turing-guide-documentation-prob-examples-throws-errors/50319 "2022-04-21T19:18:00Z")

</div>

I’m new to Turing.jl (and quite new to Julia as well) and reading the Guide documentation ( Guide ), section “Querying Probabilities from Model or Chain”. The probability query examples are of the form prob"x = 1.0, y =…

---

## [Python Implemention in Julia](https://discourse.julialang.org/t/python-implemention-in-julia/79522)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 26\
**Last updated:** [April 21, 2022, 6:53pm UTC](https://discourse.julialang.org/t/python-implemention-in-julia/79522 "2022-04-21T18:53:54Z")

</div>

Hi all :slight\_smile: I know about CPython and IronPython and probably a couple more. These are all implementation of python. Is there also such a project in Julia. Using Julia for a python implemention? Cheers

---

## [Align ylabels in scattermatrix](https://discourse.julialang.org/t/align-ylabels-in-scattermatrix/79787)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 1\
**Last updated:** [April 21, 2022, 5:27pm UTC](https://discourse.julialang.org/t/align-ylabels-in-scattermatrix/79787 "2022-04-21T17:27:42Z")

</div>

I have the following plot: If I change the ylabelpadding, I move all ylabels by the same amount. Is there a way to set the ylabelpadding such that the ylabels are aligned? (I wish to do the same for the xlabels, but…

---

## [Easy plotting of vector valued function in Plots.jl](https://discourse.julialang.org/t/easy-plotting-of-vector-valued-function-in-plots-jl/79788)

<div class="topic-metadata">

**Author:** [@Joseph\_Bradley](https://discourse.julialang.org/u/Joseph_Bradley)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 4:59pm UTC](https://discourse.julialang.org/t/easy-plotting-of-vector-valued-function-in-plots-jl/79788 "2022-04-21T16:59:28Z")

</div>

Hi, I’d like to plot a function from R -\> R^N in Plots.jl. My code is: using Plots N = 9 v₁ = ones(N) v₂ = \[1, -8, ones(N-2)...\] z₀ = 1.0 function z(t; v₁ = v₁, v₂ = v₂, z₀ = z₀) (z₀ / 9.0) .\* (v₁ - exp(-9.0\*t)\*v₂) …

---

## [Arrays of abstract types within a parametric type](https://discourse.julialang.org/t/arrays-of-abstract-types-within-a-parametric-type/79769)

<div class="topic-metadata">

**Author:** [@tverho](https://discourse.julialang.org/u/tverho)\
**Replies:** 17\
**Last updated:** [April 21, 2022, 4:49pm UTC](https://discourse.julialang.org/t/arrays-of-abstract-types-within-a-parametric-type/79769 "2022-04-21T16:49:00Z")

</div>

Hi all, I’m wondering if this behavior is intentional. Let’s look at this example # This works struct A n::Real v::Vector{Real} end # This works struct B{T} n::T v::Real end # This doesn't work struct C{T} n…

---

## [Use of Lazy arrays](https://discourse.julialang.org/t/use-of-lazy-arrays/79779)

<div class="topic-metadata">

**Author:** [@Siempie](https://discourse.julialang.org/u/Siempie)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 4:36pm UTC](https://discourse.julialang.org/t/use-of-lazy-arrays/79779 "2022-04-21T16:36:49Z")

</div>

Hi, I am looking into the use of lazy evaluation and lazy arrays in Julia. For example the package LazyArrays.jl. However i am not quite sure if i understand the benefits of lazy evaluation correctly. In my understandi…

---

## [Efficient serialization across system images](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 2\
**Last updated:** [April 21, 2022, 4:28pm UTC](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781 "2022-04-21T16:28:16Z")

</div>

I’ve got a dictionary containing only String keys mapping to Numbers. This is the result of a computation that runs on a server. Since I make use of PyJulia to initiate the computation from a Python app, I’m using a cust…

---

## [Allow convert(String, :test)](https://discourse.julialang.org/t/allow-convert-string-test/79786)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 4:24pm UTC](https://discourse.julialang.org/t/allow-convert-string-test/79786 "2022-04-21T16:24:08Z")

</div>

I came to miss this during plotting. Is there a reason why Base does not define conversion from Symbol to String with a simple call of string?

---

## [Adding labels to surfaces in the same figure](https://discourse.julialang.org/t/adding-labels-to-surfaces-in-the-same-figure/79708)

<div class="topic-metadata">

**Author:** [@gnicolosi](https://discourse.julialang.org/u/gnicolosi)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 3:53pm UTC](https://discourse.julialang.org/t/adding-labels-to-surfaces-in-the-same-figure/79708 "2022-04-21T15:53:43Z")

</div>

Hi all, how do I add labels to the surfaces below? Using label= as when plotting curves in 2d does not work. There’s very few information on attributes to surface() and I can’t find a solution anywhere else for this simp…

---

## [Group Selection by Condition in DataFramesMeta.jl](https://discourse.julialang.org/t/group-selection-by-condition-in-dataframesmeta-jl/79784)

<div class="topic-metadata">

**Author:** [@Rahul](https://discourse.julialang.org/u/Rahul)\
**Replies:** 1\
**Last updated:** [April 21, 2022, 3:01pm UTC](https://discourse.julialang.org/t/group-selection-by-condition-in-dataframesmeta-jl/79784 "2022-04-21T15:01:46Z")

</div>

I am looking to select groups that follow a condition using DataFramesMeta.jl. Reference example in R that I am looking to reproduce: require(data.table) df = data.table(id = c(rep(1, 10), rep(2, 10), rep(3, 10)), …

---

## [How do I define a custom Action in Javis.jl?](https://discourse.julialang.org/t/how-do-i-define-a-custom-action-in-javis-jl/79791)

<div class="topic-metadata">

**Author:** [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)\
**Replies:** 0\
**Last updated:** [April 21, 2022, 2:36pm UTC](https://discourse.julialang.org/t/how-do-i-define-a-custom-action-in-javis-jl/79791 "2022-04-21T14:36:23Z")

</div>

Hello So I’m trying to define a custom animation in Javis. My code is - using Javis using Animations using Colors function ground(args...) background("black") sethue("white") end rotate\_anim = Animation( …

---

## [Unable to transform a quadratic constraint into a second-order cone constraint because the quadratic constraint is not strongly convex](https://discourse.julialang.org/t/unable-to-transform-a-quadratic-constraint-into-a-second-order-cone-constraint-because-the-quadratic-constraint-is-not-strongly-convex/79767)

<div class="topic-metadata">

**Author:** [@Eric.O](https://discourse.julialang.org/u/Eric.O)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 1:13pm UTC](https://discourse.julialang.org/t/unable-to-transform-a-quadratic-constraint-into-a-second-order-cone-constraint-because-the-quadratic-constraint-is-not-strongly-convex/79767 "2022-04-21T13:13:38Z")

</div>

I am using Mosek solver to solve the model below. I get the model showing but the solver is not able to display the results. Am guessing is an issue with the second order cone formulation. I will appreciate your guidance…

---

## [Open a file and never close it](https://discourse.julialang.org/t/open-a-file-and-never-close-it/19091)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 11:52am UTC](https://discourse.julialang.org/t/open-a-file-and-never-close-it/19091 "2022-04-21T11:52:17Z")

</div>

I know this is considered bad style, but I would like to better understand why. What happens if one opens a file and never closes it? function sloppy() open("some\_file", "w") nothing end sloppy() Will the GC …

---

## [ODE Integrator Function](https://discourse.julialang.org/t/ode-integrator-function/79756)

<div class="topic-metadata">

**Author:** [@BinaryBot](https://discourse.julialang.org/u/BinaryBot)\
**Replies:** 6\
**Last updated:** [April 21, 2022, 10:53am UTC](https://discourse.julialang.org/t/ode-integrator-function/79756 "2022-04-21T10:53:05Z")

</div>

My ODE runs from tspan(1,120). It needs an integrator function that can do the following: Store the solutions at timestep 2,3,4…120 (i.e integral numbers) in a list. Although step size does not have to be 1, it just h…

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

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