# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=405

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

**Page:** 406

---

## [Help with updating fortran wrapper](https://discourse.julialang.org/t/help-with-updating-fortran-wrapper/86221)

<div class="topic-metadata">

**Author:** [@JackDunnNZ](https://discourse.julialang.org/u/JackDunnNZ)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 10:16pm UTC](https://discourse.julialang.org/t/help-with-updating-fortran-wrapper/86221 "2022-08-23T22:16:14Z")

</div>

I maintain the GLMNet.jl package, which wraps the fortran internals of the glmnet R package. This fortran dependency is shipped as glmnet\_jll, and currently uses the version built here This version of the fortran code d…

---

## [Set up Julia for a novice](https://discourse.julialang.org/t/set-up-julia-for-a-novice/86214)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 8\
**Last updated:** [August 23, 2022, 8:13pm UTC](https://discourse.julialang.org/t/set-up-julia-for-a-novice/86214 "2022-08-23T20:13:50Z")

</div>

I’d like to write a script that installs a few packages, does using to trigger compilation, and replies yes to all questions. Is there a way to do this? What I’d like to do is something like for pack in \[FFTW, SparseSui…

---

## [Avoiding allocation when accessing fields of a StructArray inside a Struct](https://discourse.julialang.org/t/avoiding-allocation-when-accessing-fields-of-a-structarray-inside-a-struct/86168)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 7:42pm UTC](https://discourse.julialang.org/t/avoiding-allocation-when-accessing-fields-of-a-structarray-inside-a-struct/86168 "2022-08-23T19:42:17Z")

</div>

Let me start with the MWE using StructArrays using BenchmarkTools # the struct to be converted to StructArray struct Foo1 a::Float64 b::Float64 end a = \[1.0, 2.0\] b = \[3.0, 4.0\] foo1 = StructArray{Foo1}(a=a, …

---

## [Sparse syrk() routine using Transducers.jl](https://discourse.julialang.org/t/sparse-syrk-routine-using-transducers-jl/86218)

<div class="topic-metadata">

**Author:** [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Replies:** 0\
**Last updated:** [August 23, 2022, 7:09pm UTC](https://discourse.julialang.org/t/sparse-syrk-routine-using-transducers-jl/86218 "2022-08-23T19:09:07Z")

</div>

Hi, I implemented a sparse syrk routine to see if I could get something faster than the naive implementation: using SparseArrays using LinearAlgebra using Transducers using Combinatorics naive\_spsyrk(s) = Symmetric(s …

---

## [Initializing Array of Arrays with undef gives UndefRefError?](https://discourse.julialang.org/t/initializing-array-of-arrays-with-undef-gives-undefreferror/53266)

<div class="topic-metadata">

**Author:** [@cosmia](https://discourse.julialang.org/u/cosmia)\
**Replies:** 15\
**Last updated:** [August 23, 2022, 5:55pm UTC](https://discourse.julialang.org/t/initializing-array-of-arrays-with-undef-gives-undefreferror/53266 "2022-08-23T17:55:02Z")

</div>

Hi all, I am initializing an Array of Arrays with undef. Why does it give me an UndefRefError when accessing it, whereas an Array with undef does not? Also, did some behavior change? I seem to remember initializing Arra…

---

## [Generating two vector of same sum](https://discourse.julialang.org/t/generating-two-vector-of-same-sum/86147)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 14\
**Last updated:** [August 23, 2022, 5:38pm UTC](https://discourse.julialang.org/t/generating-two-vector-of-same-sum/86147 "2022-08-23T17:38:08Z")

</div>

Dear all, I need to generate two vectors (not the same length) whose sum is the same. I have the first one: a = rand(1000:2000,5) 5-element Array{Int64,1}: 1404 1438 1529 1039 1071 Supose that I want a another ve…

---

## [Quarto from RStudio](https://discourse.julialang.org/t/quarto-from-rstudio/69532)

<div class="topic-metadata">

**Author:** [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 4:29pm UTC](https://discourse.julialang.org/t/quarto-from-rstudio/69532 "2022-08-23T16:29:18Z")

</div>

Check this out from the RStudio people. A language agnostic Markdown based published system using Pandoc: https://quarto.org/ I haven’t tried it yet so I’m not sure how different it is from Weave.jl

---

## [Inline julia.magic kills Jupyter notebook (only on Linux) \[pyjulia\]](https://discourse.julialang.org/t/inline-julia-magic-kills-jupyter-notebook-only-on-linux-pyjulia/86208)

<div class="topic-metadata">

**Author:** [@apigott](https://discourse.julialang.org/u/apigott)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 4:25pm UTC](https://discourse.julialang.org/t/inline-julia-magic-kills-jupyter-notebook-only-on-linux-pyjulia/86208 "2022-08-23T16:25:01Z")

</div>

I’ve noticed that Julia’s performance seems much better on my Linux partition than my Windows one (same GPU, Windows runs on my SSD while Linux is on and HDD). I was hoping to work on a project I have that’s partially wr…

---

## [Unexpected result for \`diff\` over DateTime range](https://discourse.julialang.org/t/unexpected-result-for-diff-over-datetime-range/86203)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [August 23, 2022, 3:07pm UTC](https://discourse.julialang.org/t/unexpected-result-for-diff-over-datetime-range/86203 "2022-08-23T15:07:08Z")

</div>

Consider the following: julia\> range = Dates.DateTime(2019):Dates.Year(1):Dates.DateTime(2020) Dates.DateTime("2019-01-01T00:00:00"):Dates.Year(1):Dates.DateTime("2020-01-01T00:00:00") julia\> diff(range) 1-element Vect…

---

## [\`show\` and \`displaysize\`](https://discourse.julialang.org/t/show-and-displaysize/86126)

<div class="topic-metadata">

**Author:** [@etienne\_dg](https://discourse.julialang.org/u/etienne_dg)\
**Replies:** 8\
**Last updated:** [August 23, 2022, 2:57pm UTC](https://discourse.julialang.org/t/show-and-displaysize/86126 "2022-08-23T14:57:17Z")

</div>

Why do show(stdout, "text/plain", x) respect the displaysize in one case but not the other ? Is there a way to gather the representation respecting displaysize as a string, using sprint for example? julia\> displaysize(s…

---

## [Automatic differentiation of spline functions](https://discourse.julialang.org/t/automatic-differentiation-of-spline-functions/86182)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 4\
**Last updated:** [August 23, 2022, 2:39pm UTC](https://discourse.julialang.org/t/automatic-differentiation-of-spline-functions/86182 "2022-08-23T14:39:56Z")

</div>

Splines are a common fitting tool and there are a number of versions in Julia, but I can’t seem to find any versions which are auto-differentiable (i.e., for use in JuMP, NLopt, ODE’s, Integration, etc.). \[I’m guessing …

---

## [Replicate @tturbo performance](https://discourse.julialang.org/t/replicate-tturbo-performance/86146)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 23\
**Last updated:** [August 23, 2022, 12:53pm UTC](https://discourse.julialang.org/t/replicate-tturbo-performance/86146 "2022-08-23T12:53:40Z")

</div>

Hi, Is there an easy way to replicate the performance of @tturbo but using just base Julia? The following Julia code might be used if needed for this discussion: function myminmax(x) a = b = x\[1\] @tturbo for i in…

---

## [\`map\` vs \`broadcast\`: should one prefer \`map\` if these are equivalent?](https://discourse.julialang.org/t/map-vs-broadcast-should-one-prefer-map-if-these-are-equivalent/86118)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 10:09am UTC](https://discourse.julialang.org/t/map-vs-broadcast-should-one-prefer-map-if-these-are-equivalent/86118 "2022-08-23T10:09:26Z")

</div>

I’m referring to the simplest case where map and broadcast are equivalent, that is – given a vector/tuple, I want to map a function over it to obtain another container. broadcast seems a natural choice here, and map seem…

---

## [Issue with comparing two vectors with different sizes](https://discourse.julialang.org/t/issue-with-comparing-two-vectors-with-different-sizes/86177)

<div class="topic-metadata">

**Author:** [@ashefa](https://discourse.julialang.org/u/ashefa)\
**Replies:** 7\
**Last updated:** [August 23, 2022, 10:01am UTC](https://discourse.julialang.org/t/issue-with-comparing-two-vectors-with-different-sizes/86177 "2022-08-23T10:01:23Z")

</div>

I am wondering how I can get results for R = \[2, 2\] D = \[1, 3\] J = \[1, 1\] P\[2\] = \[1 3; 2 3; 6 3; 1 4; 2 4; 6 4; 1 5; 2 5; 6 5; 1 6; 2 6\] P\[2\]\[:,2\] .== collect(R\[2\]+1:R\[2\]+D\[2\]) similar to R = \[2, 2\] D = \[1, 3\] J = \[1,…

---

## [ForwardDiff.jl : ERROR: LoadError: MethodError: convert(...) is ambiguous](https://discourse.julialang.org/t/forwarddiff-jl-error-loaderror-methoderror-convert-is-ambiguous/86132)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 4\
**Last updated:** [August 23, 2022, 7:10am UTC](https://discourse.julialang.org/t/forwarddiff-jl-error-loaderror-methoderror-convert-is-ambiguous/86132 "2022-08-23T07:10:50Z")

</div>

My original intention was to use Zygote to achieve the gradient of gradients, but there were a lot of problems with twice automatic differentiation in reverse mode. So I used Zygote.hessian to achieve the mixing forward…

---

## [ReverseDiff.jl interference with Distributed.jl (GitHub action mysteriously starts breaking on Windows)](https://discourse.julialang.org/t/reversediff-jl-interference-with-distributed-jl-github-action-mysteriously-starts-breaking-on-windows/86048)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 21\
**Last updated:** [August 22, 2022, 7:29pm UTC](https://discourse.julialang.org/t/reversediff-jl-interference-with-distributed-jl-github-action-mysteriously-starts-breaking-on-windows/86048 "2022-08-22T19:29:48Z")

</div>

Something strange is happening to the Windows GitHub actions for SymbolicRegression.jl - which is either caused by or manifesting in a Distributed.jl error The action was working 9 days ago, for all operating systems: …

---

## [TOML: using to\_toml option may produce incorrect TOML](https://discourse.julialang.org/t/toml-using-to-toml-option-may-produce-incorrect-toml/86157)

<div class="topic-metadata">

**Author:** [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Replies:** 1\
**Last updated:** [August 23, 2022, 3:52am UTC](https://discourse.julialang.org/t/toml-using-to-toml-option-may-produce-incorrect-toml/86157 "2022-08-23T03:52:01Z")

</div>

This is a simplified example to illustrate the issue I’m seeing with using the TOML writer with the to\_toml option for writing a custom type. It seems that when using the to\_toml option, TOML print doesn’t print the co…

---

## [PackageCompiler : target GLIBC version when creating an app?](https://discourse.julialang.org/t/packagecompiler-target-glibc-version-when-creating-an-app/86159)

<div class="topic-metadata">

**Author:** [@Gauf](https://discourse.julialang.org/u/Gauf)\
**Replies:** 0\
**Last updated:** [August 22, 2022, 10:49pm UTC](https://discourse.julialang.org/t/packagecompiler-target-glibc-version-when-creating-an-app/86159 "2022-08-22T22:49:51Z")

</div>

I’ve recently created an Ubuntu VM with the latest LTS release (22.04 – jammy) to build and distribute relocatable apps. After transferring an app to another machine with an older Ubuntu install, I get this error: ./my…

---

## [PyPlot woes in 1.8.0 Intel Mac](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 8\
**Last updated:** [August 22, 2022, 8:30pm UTC](https://discourse.julialang.org/t/pyplot-woes-in-1-8-0-intel-mac/86138 "2022-08-22T20:30:27Z")

</div>

Running lates MAC OS. When I try to use PyPlot I get this \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "\]?" f…

---

## [How to test whether evaluating an expression produces no output at all?](https://discourse.julialang.org/t/how-to-test-whether-evaluating-an-expression-produces-no-output-at-all/86102)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 3\
**Last updated:** [August 22, 2022, 7:58pm UTC](https://discourse.julialang.org/t/how-to-test-whether-evaluating-an-expression-produces-no-output-at-all/86102 "2022-08-22T19:58:08Z")

</div>

@test\_logs tests for log output @test\_nowarn tests that stdout is empty (and, despite the name, isn’t meant strictly for the @warn macro) How to test whether stdout is empty as well? How to test whether an expression…

---

## [Changing default parameters](https://discourse.julialang.org/t/changing-default-parameters/86148)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [August 22, 2022, 5:19pm UTC](https://discourse.julialang.org/t/changing-default-parameters/86148 "2022-08-22T17:19:28Z")

</div>

How can I change the default parameters of a function? I have this code: using Plots x=0:0.01:100 y1=sin.(x) p = plot(x,y1, width=2, xtickfontsize=12, ytickfontsize=12, legendfontsize=12, legend=false) I want to be …

---

## [macOS with ARM](https://discourse.julialang.org/t/macos-with-arm/86129)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [August 22, 2022, 4:26pm UTC](https://discourse.julialang.org/t/macos-with-arm/86129 "2022-08-22T16:26:45Z")

</div>

Are complex packages that use for example NLopt, Makie, PackageCompiler etc expected to work on macOS with the native ARM version of Julia, or is it more likely that they work with Rosetta? Is it possible to add continu…

---

## [Test on skipmissing failing but on collect(skipmissing) passing](https://discourse.julialang.org/t/test-on-skipmissing-failing-but-on-collect-skipmissing-passing/86140)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [August 22, 2022, 4:09pm UTC](https://discourse.julialang.org/t/test-on-skipmissing-failing-but-on-collect-skipmissing-passing/86140 "2022-08-22T16:09:44Z")

</div>

This is odd. Why ? julia\> using Test julia\> y = \[1.1 1.0 0.0 missing 8.0 2.0 0.952381 1.0 1.0 2.0 7.0 0.0 1.0 0.0 1.0\] 3×5 Matrix{Union{Missing, Float64}}: 1…

---

## [RCall and problems installing R-packages](https://discourse.julialang.org/t/rcall-and-problems-installing-r-packages/86135)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 1\
**Last updated:** [August 22, 2022, 1:44pm UTC](https://discourse.julialang.org/t/rcall-and-problems-installing-r-packages/86135 "2022-08-22T13:44:40Z")

</div>

I have installed R to use RCall within Julia. Unfortunately, I am having trouble installing the R-packages that I need to use. I have installed R at the directory C:\\Users\\12345\\AppData\\Local\\Programs\\R\\ But when I try…

---

## [Is this a bug? Nested Functions and NLsolve](https://discourse.julialang.org/t/is-this-a-bug-nested-functions-and-nlsolve/86085)

<div class="topic-metadata">

**Author:** [@alfaromartino](https://discourse.julialang.org/u/alfaromartino)\
**Replies:** 20\
**Last updated:** [August 22, 2022, 10:53am UTC](https://discourse.julialang.org/t/is-this-a-bug-nested-functions-and-nlsolve/86085 "2022-08-22T10:53:55Z")

</div>

I was using NLsolve and couldn’t get type stability in my model no matter how. I’m new to Julia, so I thought I wasn’t fully understanding how type stability works. But I think this is part of a bug that dates from at le…

---

## [Recurrent struct hierarchy](https://discourse.julialang.org/t/recurrent-struct-hierarchy/86094)

<div class="topic-metadata">

**Author:** [@tfinke](https://discourse.julialang.org/u/tfinke)\
**Replies:** 2\
**Last updated:** [August 22, 2022, 11:32am UTC](https://discourse.julialang.org/t/recurrent-struct-hierarchy/86094 "2022-08-22T11:32:54Z")

</div>

Hi all, I am trying to create a struct that contains a substruct at different levels. An instance foo of that struct should have the following layout: foo.a foo.b foo.x.a foo.x.b foo.y.a foo.y.b foo.z So foo.x and fo…

---

## [Vector, Row Column and Array](https://discourse.julialang.org/t/vector-row-column-and-array/86095)

<div class="topic-metadata">

**Author:** [@tfinke](https://discourse.julialang.org/u/tfinke)\
**Replies:** 2\
**Last updated:** [August 22, 2022, 10:44am UTC](https://discourse.julialang.org/t/vector-row-column-and-array/86095 "2022-08-22T10:44:02Z")

</div>

Hi all, suppose the following code: a = \[2, 3, 4\] z = \[5, 7, 9\] b = a .+ 1 c = (a .+ 1)' d = a' .+ 1 s = (a' .+ 1) \* z t = (a .+ 1)' \* z u = b' \* z v = c \* z w = d \* z The last five lines all calculate the dot produ…

---

## [\`deleteat!\` does not support \`BitVector\` in Julia 1.6.7 (LTS)](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 6\
**Last updated:** [August 21, 2022, 10:46pm UTC](https://discourse.julialang.org/t/deleteat-does-not-support-bitvector-in-julia-1-6-7-lts/86107 "2022-08-21T22:46:52Z")

</div>

MWE: julia\> c = iseven.(rand(Int, 4)) 4-element BitVector: 1 1 0 0 julia\> deleteat!(c, \[false, false, false, false\]) ERROR: BoundsError: attempt to access 4-element BitVector at index \[false\] This error does not o…

---

## [Capturing available data written to redirected STDOUT and/or STDERR](https://discourse.julialang.org/t/capturing-available-data-written-to-redirected-stdout-and-or-stderr/6378)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 4\
**Last updated:** [August 21, 2022, 7:26pm UTC](https://discourse.julialang.org/t/capturing-available-data-written-to-redirected-stdout-and-or-stderr/6378 "2022-08-21T19:26:51Z")

</div>

I’ve tried to write a set of functions that redirect both STDOUT and/or STDERR (capture\_stderr, capture\_stdout, capture\_console), and return with the data as a string (we use this for testing purposes). I had originally…

---

## [Difference between allowrankdeficient and dropcollinear in lm function](https://discourse.julialang.org/t/difference-between-allowrankdeficient-and-dropcollinear-in-lm-function/86047)

<div class="topic-metadata">

**Author:** [@valperez](https://discourse.julialang.org/u/valperez)\
**Replies:** 2\
**Last updated:** [August 21, 2022, 6:44pm UTC](https://discourse.julialang.org/t/difference-between-allowrankdeficient-and-dropcollinear-in-lm-function/86047 "2022-08-21T18:44:04Z")

</div>

Hi there! I have a question regarding the documentation of the GLM package. I want to use the function lm(formula, data, allowrankdeficient=false; \[wts::AbstractVector\], dropcollinear::Bool=true) but I have a doubt…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=404)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=406)
