# Latest

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

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

**Page:** 1370

---

## [Operate only on a few components of a static vector](https://discourse.julialang.org/t/operate-only-on-a-few-components-of-a-static-vector/62409)

<div class="topic-metadata">

**Author:** [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Replies:** 14\
**Last updated:** [June 6, 2021, 5:09pm UTC](https://discourse.julialang.org/t/operate-only-on-a-few-components-of-a-static-vector/62409 "2021-06-06T17:09:39Z")

</div>

Suppose I want to extract and operate on only a few components from an SVector, e.g. using StaticArrays f( (x, y, z) ) = (3x, 4y, 5z) v = SVector( (2i for i in 1:10)...) indices = (1, 3, 5) v2 = getindex.(Ref(v), indi…

---

## [Reduced performance for parallel loops in larger code?](https://discourse.julialang.org/t/reduced-performance-for-parallel-loops-in-larger-code/62450)

<div class="topic-metadata">

**Author:** [@swishmas](https://discourse.julialang.org/u/swishmas)\
**Replies:** 10\
**Last updated:** [June 6, 2021, 3:42pm UTC](https://discourse.julialang.org/t/reduced-performance-for-parallel-loops-in-larger-code/62450 "2021-06-06T15:42:30Z")

</div>

I’ve prepared a code that works pretty well in isolation. A minimal working example is below, but I’m basically taking values from a set of input arrays to another set of output arrays. Edit: I’m going to simplify thi…

---

## [Jupyter Kernel Dies (Julia exe deleted) with using Plots](https://discourse.julialang.org/t/jupyter-kernel-dies-julia-exe-deleted-with-using-plots/50566)

<div class="topic-metadata">

**Author:** [@KeithWoj](https://discourse.julialang.org/u/KeithWoj)\
**Replies:** 11\
**Last updated:** [June 6, 2021, 3:42pm UTC](https://discourse.julialang.org/t/jupyter-kernel-dies-julia-exe-deleted-with-using-plots/50566 "2021-06-06T15:42:15Z")

</div>

I installed Julia 1.5.3 and added IJulia using Pkg.add(“IJulia”) so that I can use a Jupyter notebook. I went through a Julia Academy tutorial with no issue until I got to the Packages lesson. In the terminal I entered: …

---

## [Julia types](https://discourse.julialang.org/t/julia-types/62352)

<div class="topic-metadata">

**Author:** [@jinml](https://discourse.julialang.org/u/jinml)\
**Replies:** 23\
**Last updated:** [June 6, 2021, 3:19pm UTC](https://discourse.julialang.org/t/julia-types/62352 "2021-06-06T15:19:04Z")

</div>

Hi I am studying Julia’s type system and was confused about parametric types. In the juliadocs there is the following example struct Point{T} x::T y::T end and if I would like to restrict T to \<:Real I do the followin…

---

## [Solving optimization problems with bilinear matrix inequalities (BMI) in Julia](https://discourse.julialang.org/t/solving-optimization-problems-with-bilinear-matrix-inequalities-bmi-in-julia/62407)

<div class="topic-metadata">

**Author:** [@Shuvomoy\_Das\_Gupta](https://discourse.julialang.org/u/Shuvomoy_Das_Gupta)\
**Replies:** 3\
**Last updated:** [June 6, 2021, 1:25pm UTC](https://discourse.julialang.org/t/solving-optimization-problems-with-bilinear-matrix-inequalities-bmi-in-julia/62407 "2021-06-06T13:25:24Z")

</div>

Dear All, Is there a way one can formulate and solve optimization problems with bilinear matrix inequalities in Julia/JuMP? For example, \\begin{array}{ll} \\textrm{minimize} & c^{T}x\\\\ \\textrm{subject to} & A\_{0}+\\s…

---

## [Possible to combine a PyObject plot and Plots plot for customed layout?](https://discourse.julialang.org/t/possible-to-combine-a-pyobject-plot-and-plots-plot-for-customed-layout/62463)

<div class="topic-metadata">

**Author:** [@EuRoXy](https://discourse.julialang.org/u/EuRoXy)\
**Replies:** 1\
**Last updated:** [June 6, 2021, 12:08pm UTC](https://discourse.julialang.org/t/possible-to-combine-a-pyobject-plot-and-plots-plot-for-customed-layout/62463 "2021-06-06T12:08:17Z")

</div>

I have a PyObject plot (geo-map involving projections and features from Cartopy via PyCall), and intend to combine it with violin plots from StatsPlots for a specific layout. Trying and searching around find no success. …

---

## [ERROR: KeyError: key "git-tree-sha1" not found when doing \`Pkg.instantiate()\`](https://discourse.julialang.org/t/error-keyerror-key-git-tree-sha1-not-found-when-doing-pkg-instantiate/62458)

<div class="topic-metadata">

**Author:** [@gxyd](https://discourse.julialang.org/u/gxyd)\
**Replies:** 2\
**Last updated:** [June 6, 2021, 10:16am UTC](https://discourse.julialang.org/t/error-keyerror-key-git-tree-sha1-not-found-when-doing-pkg-instantiate/62458 "2021-06-06T10:16:17Z")

</div>

Hi everyone, I’m using Julia 1.0. First when I do: julia\> using Flux \[ Info: Precompiling Flux \[587475ba-b771-5e3f-ad9e-33799f191a9c\] ERROR: LoadError: ArgumentError: Package Zygote \[e88e6eb3-aa80-5325-afca-941959d7151…

---

## [Why fewer memory allocations does not necessarily suggest higher speed](https://discourse.julialang.org/t/why-fewer-memory-allocations-does-not-necessarily-suggest-higher-speed/62448)

<div class="topic-metadata">

**Author:** [@yingqiuz](https://discourse.julialang.org/u/yingqiuz)\
**Replies:** 5\
**Last updated:** [June 6, 2021, 4:51am UTC](https://discourse.julialang.org/t/why-fewer-memory-allocations-does-not-necessarily-suggest-higher-speed/62448 "2021-06-06T04:51:21Z")

</div>

Hi all I’ve always been told to reduce redundant memory allocations, especially when the given operation is to be executed for many times; and loops are fast, so vectorised code is not always necessary. However, in pra…

---

## [Extending AD to JuliaImages](https://discourse.julialang.org/t/extending-ad-to-juliaimages/62460)

<div class="topic-metadata">

**Author:** [@SomTambe](https://discourse.julialang.org/u/SomTambe)\
**Replies:** 0\
**Last updated:** [June 6, 2021, 4:31am UTC](https://discourse.julialang.org/t/extending-ad-to-juliaimages/62460 "2021-06-06T04:31:51Z")

</div>

Hi I’m Som! I’m working on extending AD support to the Images.jl ecosystem this summer as a part of SoC. I am building the code here at DiffImages.jl. We have our discussions public at the #discussions tab of the repo. …

---

## [2D plot flush with 3D axis?](https://discourse.julialang.org/t/2d-plot-flush-with-3d-axis/62289)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 6\
**Last updated:** [June 6, 2021, 3:43am UTC](https://discourse.julialang.org/t/2d-plot-flush-with-3d-axis/62289 "2021-06-06T03:43:07Z")

</div>

I’m trying to plot a 2D graph underneath a 3D plot. The following is my hacky approach, using GLMakie fig = Figure() menu = Menu(fig, options = \[1,2\]) fig\[1, 1\] = vgrid!( Label(fig, "Index a", width = nothing),menu…

---

## [Convert geocentric distance from center of earth to geocentric altitude](https://discourse.julialang.org/t/convert-geocentric-distance-from-center-of-earth-to-geocentric-altitude/62419)

<div class="topic-metadata">

**Author:** [@sxd190026](https://discourse.julialang.org/u/sxd190026)\
**Replies:** 6\
**Last updated:** [June 5, 2021, 11:26pm UTC](https://discourse.julialang.org/t/convert-geocentric-distance-from-center-of-earth-to-geocentric-altitude/62419 "2021-06-05T23:26:07Z")

</div>

I was using Satellite Toolbox for using Jacchia Bowman 2008 atmospheric model. JB2008 model considers latitude, longitude and altitude in geocentric co-ordinate as input , but the satellite data I have is in Geodetic co-…

---

## [One-line function return lambda\_\_anonymous function](https://discourse.julialang.org/t/one-line-function-return-lambda-anonymous-function/40762)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 10\
**Last updated:** [June 5, 2021, 10:10pm UTC](https://discourse.julialang.org/t/one-line-function-return-lambda-anonymous-function/40762 "2021-06-05T22:10:32Z")

</div>

Hi, based on this f = x -\> x^2 f(10) I’d like to develop a function with two inputs f1(a,b) = a,b -\> a^2+b f1(2,1) but this returns (2, λ). What are the meaning of lambda returned here and the right syntax for this? …

---

## [Expanding Named Tuples](https://discourse.julialang.org/t/expanding-named-tuples/62435)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 13\
**Last updated:** [June 5, 2021, 8:13pm UTC](https://discourse.julialang.org/t/expanding-named-tuples/62435 "2021-06-05T20:13:18Z")

</div>

Starting from this situation (or similar), julia\> hcat(DataFrame(a=\[1,2\]), \[(b=1,c=2), (b=3,c=4)\]) 2×2 DataFrame Row │ a x1 │ Int64 NamedTup… ─────┼─────────────────────── 1 │ 1 (b…

---

## [Plots with many sub-plots](https://discourse.julialang.org/t/plots-with-many-sub-plots/62440)

<div class="topic-metadata">

**Author:** [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Replies:** 3\
**Last updated:** [June 5, 2021, 7:47pm UTC](https://discourse.julialang.org/t/plots-with-many-sub-plots/62440 "2021-06-05T19:47:37Z")

</div>

I’m struggling to fit a lot of subplots into one plot. When I have few plots, it looks fine with nicely separated sub-plots: gr(;size = (300,200), thickness\_scaling = .5) plot(\[plot(curveset\[x\]) for x in 1:6\]..., layo…

---

## [Ternary axis with PGFplotsX?](https://discourse.julialang.org/t/ternary-axis-with-pgfplotsx/62442)

<div class="topic-metadata">

**Author:** [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Replies:** 2\
**Last updated:** [June 5, 2021, 6:14pm UTC](https://discourse.julialang.org/t/ternary-axis-with-pgfplotsx/62442 "2021-06-05T18:14:23Z")

</div>

Is there any way to use ternary axes in PGFplotsX.i had a stab at passing in raw latex arguments. But I guess it probably won’t be possible, since the choice of axis type is specified by choice of function eg Axis(args) …

---

## [Synthetic control in julia](https://discourse.julialang.org/t/synthetic-control-in-julia/61615)

<div class="topic-metadata">

**Author:** [@Evan](https://discourse.julialang.org/u/Evan)\
**Replies:** 13\
**Last updated:** [June 5, 2021, 6:55pm UTC](https://discourse.julialang.org/t/synthetic-control-in-julia/61615 "2021-06-05T18:55:36Z")

</div>

Im currently trying to work through a question using synthetic control in r. link for context here: https://economics.mit.edu/files/17847 Ive found that the documentation is lacking and I have a syntax error. Has anyone…

---

## [Announcing two extensions to ModelingToolkit.jl](https://discourse.julialang.org/t/announcing-two-extensions-to-modelingtoolkit-jl/62445)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 0\
**Last updated:** [June 5, 2021, 5:08pm UTC](https://discourse.julialang.org/t/announcing-two-extensions-to-modelingtoolkit-jl/62445 "2021-06-05T17:08:45Z")

</div>

I’ve been rewriting all of my hard-coded dynamics with ModelingToolkit.jl. Here are two new extensions! They are set to automerge into the General registry in 3 days. Astrodynamics See AstrodynamicalModels.jl for restri…

---

## [When will Julia compete with Spark?](https://discourse.julialang.org/t/when-will-julia-compete-with-spark/25218)

<div class="topic-metadata">

**Author:** [@merlin](https://discourse.julialang.org/u/merlin)\
**Replies:** 16\
**Last updated:** [June 5, 2021, 5:09pm UTC](https://discourse.julialang.org/t/when-will-julia-compete-with-spark/25218 "2021-06-05T17:09:45Z")

</div>

My org uses Spark + EMR to query and transform static files on S3 and output to files that either get loaded to a DB or used as input for analysis. It seems like Julia could also do this and do it well, of course Spark …

---

## [Checking for various Matrix types](https://discourse.julialang.org/t/checking-for-various-matrix-types/62425)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 4\
**Last updated:** [June 5, 2021, 3:36pm UTC](https://discourse.julialang.org/t/checking-for-various-matrix-types/62425 "2021-06-05T15:36:53Z")

</div>

I have a few related questions about checking for various matrix types to get Boolean values. Any help would be appreciated. Q1) Suppose I have a function function f( ..., A ,...) where the type of A is unspecified. Ins…

---

## [Tufte/Offset/Despine Axes in Makie or other plot libraries](https://discourse.julialang.org/t/tufte-offset-despine-axes-in-makie-or-other-plot-libraries/62364)

<div class="topic-metadata">

**Author:** [@nero57](https://discourse.julialang.org/u/nero57)\
**Replies:** 2\
**Last updated:** [June 5, 2021, 3:26pm UTC](https://discourse.julialang.org/t/tufte-offset-despine-axes-in-makie-or-other-plot-libraries/62364 "2021-06-05T15:26:07Z")

</div>

Hello, I’m wondering if it is possible to make Tufted/Offset/Despined axes in pure Julia. This is a basic example (this was generated in python using seaborn.despine. You can do the same in R and pgfplots): I looked…

---

## [Positioning axis labels in Plots](https://discourse.julialang.org/t/positioning-axis-labels-in-plots/62437)

<div class="topic-metadata">

**Author:** [@Dan.phi](https://discourse.julialang.org/u/Dan.phi)\
**Replies:** 1\
**Last updated:** [June 5, 2021, 2:11pm UTC](https://discourse.julialang.org/t/positioning-axis-labels-in-plots/62437 "2021-06-05T14:11:11Z")

</div>

This might be a very basic question, but how do you right-align the axis labels in a histogram plot? It seems the default is to have them centered, both for the y-axis and the x-axis. In this simple MWE I would want "f…

---

## [Using SDE for the first time](https://discourse.julialang.org/t/using-sde-for-the-first-time/62414)

<div class="topic-metadata">

**Author:** [@Caique\_Rodrigues](https://discourse.julialang.org/u/Caique_Rodrigues)\
**Replies:** 4\
**Last updated:** [June 5, 2021, 1:35pm UTC](https://discourse.julialang.org/t/using-sde-for-the-first-time/62414 "2021-06-05T13:35:21Z")

</div>

When I solve problems that stochastic effects are presents, I usually discretize the domain and then I create an interpolation vector with random numbers as my stochastic source for the dynamics. But now that I am learni…

---

## [Simple infinite loops not looping?](https://discourse.julialang.org/t/simple-infinite-loops-not-looping/62424)

<div class="topic-metadata">

**Author:** [@MarcMush](https://discourse.julialang.org/u/MarcMush)\
**Replies:** 3\
**Last updated:** [June 5, 2021, 12:20pm UTC](https://discourse.julialang.org/t/simple-infinite-loops-not-looping/62424 "2021-06-05T12:20:24Z")

</div>

In some cases, a very simple infinite while loop doesn’t loop inifinitly, I guess when the compiler (?) detects the loop is doing nothing and can never escape. Sure, I don’t see any scenario where this could be a problem…

---

## [Considering switch to Julia -- modelling examples linked to R / comparison to Stan / production environment](https://discourse.julialang.org/t/considering-switch-to-julia-modelling-examples-linked-to-r-comparison-to-stan-production-environment/62428)

<div class="topic-metadata">

**Author:** [@CharlesDriver](https://discourse.julialang.org/u/CharlesDriver)\
**Replies:** 1\
**Last updated:** [June 5, 2021, 11:42am UTC](https://discourse.julialang.org/t/considering-switch-to-julia-modelling-examples-linked-to-r-comparison-to-stan-production-environment/62428 "2021-06-05T11:42:18Z")

</div>

I maintain R software for hierarchical sde / state space modelling, oriented to social science contexts, and am also in the process of constructing something for large scale item response models. At present I have models…

---

## [LoadError: syntax: "\\" is not a unary operator](https://discourse.julialang.org/t/loaderror-syntax-is-not-a-unary-operator/62389)

<div class="topic-metadata">

**Author:** [@localpara](https://discourse.julialang.org/u/localpara)\
**Replies:** 8\
**Last updated:** [June 5, 2021, 8:40am UTC](https://discourse.julialang.org/t/loaderror-syntax-is-not-a-unary-operator/62389 "2021-06-05T08:40:48Z")

</div>

I get the error LoadError: syntax: "" is not a unary operator every time I try to run Julia from the terminal by typing ‘julia’. The file that doesn’t load is a startup file that says hello every time I run Julia. ERROR…

---

## [Export Interactive Standalone HTML from WGLMakie](https://discourse.julialang.org/t/export-interactive-standalone-html-from-wglmakie/62412)

<div class="topic-metadata">

**Author:** [@src\_20](https://discourse.julialang.org/u/src_20)\
**Replies:** 4\
**Last updated:** [June 5, 2021, 8:40am UTC](https://discourse.julialang.org/t/export-interactive-standalone-html-from-wglmakie/62412 "2021-06-05T08:40:34Z")

</div>

Hi :slight\_smile: I want to use WGLMakie to extract static HTML, but my code does not work with the method described here. I think I wrote a bad code. Is there anyone who can suggest how to do this? The following work…

---

## [What is the difference between "rand(150) .\<= 0.1" and "rand(150) .= rand(150) .\<= 0.1"?](https://discourse.julialang.org/t/what-is-the-difference-between-rand-150-0-1-and-rand-150-rand-150-0-1/62418)

<div class="topic-metadata">

**Author:** [@achitsaz73](https://discourse.julialang.org/u/achitsaz73)\
**Replies:** 2\
**Last updated:** [June 5, 2021, 8:16am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-rand-150-0-1-and-rand-150-rand-150-0-1/62418 "2021-06-05T08:16:50Z")

</div>

It was my fault and I asked the wrong question. I apologize and delete the question.

---

## [When to use layoutable.attr = vs layoutable.attr\[\] =](https://discourse.julialang.org/t/when-to-use-layoutable-attr-vs-layoutable-attr/62405)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [June 5, 2021, 6:26am UTC](https://discourse.julialang.org/t/when-to-use-layoutable-attr-vs-layoutable-attr/62405 "2021-06-05T06:26:36Z")

</div>

using CairoMakie f = Figure() ax = Axis(f\[1, 1\]) markersizes = \[5, 10, 15, \] colors = \[:red, :green, :blue, :orange\] for ms in markersizes, color in colors scatter!(randn(5, 2), markersize = ms, color = color) e…

---

## [@turbo speeds routine, slows down everything else](https://discourse.julialang.org/t/turbo-speeds-routine-slows-down-everything-else/62163)

<div class="topic-metadata">

**Author:** [@rpmuller](https://discourse.julialang.org/u/rpmuller)\
**Replies:** 16\
**Last updated:** [June 5, 2021, 6:25am UTC](https://discourse.julialang.org/t/turbo-speeds-routine-slows-down-everything-else/62163 "2021-06-05T06:25:14Z")

</div>

I’ve been playing with LoopVectorization.jl to speed up the bottleneck in my code. I’ve included @turbo several times in the innermost loops in this routine, and nowhere else in the code. It currently speeds up that rout…

---

## [Zygote - parametrize matrix such that gradient is only performed on selected coefficients](https://discourse.julialang.org/t/zygote-parametrize-matrix-such-that-gradient-is-only-performed-on-selected-coefficients/62393)

<div class="topic-metadata">

**Author:** [@jgbrasier](https://discourse.julialang.org/u/jgbrasier)\
**Replies:** 1\
**Last updated:** [June 5, 2021, 5:34am UTC](https://discourse.julialang.org/t/zygote-parametrize-matrix-such-that-gradient-is-only-performed-on-selected-coefficients/62393 "2021-06-05T05:34:14Z")

</div>

I was wondering if it was possible to parametrize matrices such that zygote’s gradient would only be performed on the selected coefficients of the matrix. Some dummy code would look like: theta = randn(2) W = \[theta\[1\]…

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

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