# General Usage

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

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

**Page:** 608

---

## [Locking in multithreading](https://discourse.julialang.org/t/locking-in-multithreading/60023)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 4\
**Last updated:** [April 27, 2021, 6:00am UTC](https://discourse.julialang.org/t/locking-in-multithreading/60023 "2021-04-27T06:00:00Z")

</div>

Hi, Here is a piece of code (not a MWE…) function parallelkernel!(elca,idof,R,...) # fast typestable kernel @threads for iel ∈ eachindex(elca) r = incremental(elca\[iel\],...) #lock(lk) do R…

---

## [Issue with Plots.scalefontsizes()](https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050)

<div class="topic-metadata">

**Author:** [@gregory](https://discourse.julialang.org/u/gregory)\
**Replies:** 3\
**Last updated:** [April 26, 2021, 11:59pm UTC](https://discourse.julialang.org/t/issue-with-plots-scalefontsizes/60050 "2021-04-26T23:59:28Z")

</div>

A MWE of my issue: function testPlot(α::Real=1.0) Plots.scalefontsizes(α) p1=plot(rand(10),title="mytitle") Plots.scalefontsizes() return p1 end The title is scaled appropriately, but the ticks are not changed. …

---

## [Why is this type inference failed](https://discourse.julialang.org/t/why-is-this-type-inference-failed/60077)

<div class="topic-metadata">

**Author:** [@N5N3](https://discourse.julialang.org/u/N5N3)\
**Replies:** 1\
**Last updated:** [April 27, 2021, 2:44am UTC](https://discourse.julialang.org/t/why-is-this-type-inference-failed/60077 "2021-04-27T02:44:23Z")

</div>

function interfer\_test( obj::T, Ls::NTuple{2,\<:Integer}, ) where {T} CT = complex(T) mem\_init = ntuple(\_ -\> zeros(CT, Ls), Val(4)) end @code\_warntype interfer\_test(1,(100,100)) The above code returns Va…

---

## [How do I add \[1.5.3\] to VS code in Ubuntu?](https://discourse.julialang.org/t/how-do-i-add-1-5-3-to-vs-code-in-ubuntu/53127)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 45\
**Last updated:** [April 27, 2021, 1:26am UTC](https://discourse.julialang.org/t/how-do-i-add-1-5-3-to-vs-code-in-ubuntu/53127 "2021-04-27T01:26:28Z")

</div>

I downloaded 1.6.0 into a file called Julia in my home directory. I tried to enter export PATH="$PATH:/path/to/~/Julia/julia-1.6.0-beta1-linux-x86\_64/julia-1.6.0-beta1/bin" into VS Code, so it would find this file, bu…

---

## [How to make type-stable: passing an element of a vector of functions](https://discourse.julialang.org/t/how-to-make-type-stable-passing-an-element-of-a-vector-of-functions/60068)

<div class="topic-metadata">

**Author:** [@sofiablopez](https://discourse.julialang.org/u/sofiablopez)\
**Replies:** 4\
**Last updated:** [April 26, 2021, 11:31pm UTC](https://discourse.julialang.org/t/how-to-make-type-stable-passing-an-element-of-a-vector-of-functions/60068 "2021-04-26T23:31:44Z")

</div>

I have an array of functions, and I need to iterate it and pass each element of the array to another function. How can I make it type-stable? This code illustrates my problem: function f(g::Function, x::Int64) ret…

---

## [How to get anonymous function from its type?](https://discourse.julialang.org/t/how-to-get-anonymous-function-from-its-type/53843)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 3\
**Last updated:** [April 26, 2021, 11:16pm UTC](https://discourse.julialang.org/t/how-to-get-anonymous-function-from-its-type/53843 "2021-04-26T23:16:01Z")

</div>

f = x -\> x + 1 T = typeof(f) # ==\> var"#2#4" Given a type T of an anonymous function, can I get that function? I.e. given var#"2#4" get object f? I get the type T from the lowered representation of code (actually, from…

---

## [How to change the column width of a DataFrame](https://discourse.julialang.org/t/how-to-change-the-column-width-of-a-dataframe/60047)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 8\
**Last updated:** [April 26, 2021, 7:35pm UTC](https://discourse.julialang.org/t/how-to-change-the-column-width-of-a-dataframe/60047 "2021-04-26T19:35:13Z")

</div>

I have the following data frame: julia\> df 11729×4 DataFrame Row │ time\_rel X Y Z │ Float64 Array… …

---

## [Reactive Programming with Multiprocessing](https://discourse.julialang.org/t/reactive-programming-with-multiprocessing/60048)

<div class="topic-metadata">

**Author:** [@Jack](https://discourse.julialang.org/u/Jack)\
**Replies:** 0\
**Last updated:** [April 26, 2021, 6:14pm UTC](https://discourse.julialang.org/t/reactive-programming-with-multiprocessing/60048 "2021-04-26T18:14:14Z")

</div>

Greeting, I am trying to combine coding in a reactive framework like Rocket.jl with multiprocessing. The idea is to have different actors working in different cores. It’s natural to write in a reactive framework to lever…

---

## [How to overwrite a Base.macro?](https://discourse.julialang.org/t/how-to-overwrite-a-base-macro/60043)

<div class="topic-metadata">

**Author:** [@qsong](https://discourse.julialang.org/u/qsong)\
**Replies:** 2\
**Last updated:** [April 26, 2021, 5:59pm UTC](https://discourse.julialang.org/t/how-to-overwrite-a-base-macro/60043 "2021-04-26T17:59:37Z")

</div>

I got a good reason, which I will post later, to overwrite Base.@cmd. Is it possible? Thanks.

---

## [How to unpack an .xz file with Julia](https://discourse.julialang.org/t/how-to-unpack-an-xz-file-with-julia/60028)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [April 26, 2021, 5:14pm UTC](https://discourse.julialang.org/t/how-to-unpack-an-xz-file-with-julia/60028 "2021-04-26T17:14:37Z")

</div>

Is there a package that can decompress .xz files? I need to do this in a cross-platform way.

---

## [What are Opaque Closures?](https://discourse.julialang.org/t/what-are-opaque-closures/60006)

<div class="topic-metadata">

**Author:** [@suavesito](https://discourse.julialang.org/u/suavesito)\
**Replies:** 2\
**Last updated:** [April 26, 2021, 3:56pm UTC](https://discourse.julialang.org/t/what-are-opaque-closures/60006 "2021-04-26T15:56:15Z")

</div>

In Slack there was a question about opaque closures. I found that what I was assuming they were is not the real thing, they are not closures that pass variables as value… so here I post the answer (thanks to @oxinabox) a…

---

## [\[Julia usage / metaprogramming\] How to evaluate a module's function with function's name as a string?](https://discourse.julialang.org/t/julia-usage-metaprogramming-how-to-evaluate-a-modules-function-with-functions-name-as-a-string/60031)

<div class="topic-metadata">

**Author:** [@erwanlecarpentier](https://discourse.julialang.org/u/erwanlecarpentier)\
**Replies:** 10\
**Last updated:** [April 26, 2021, 2:17pm UTC](https://discourse.julialang.org/t/julia-usage-metaprogramming-how-to-evaluate-a-modules-function-with-functions-name-as-a-string/60031 "2021-04-26T14:17:25Z")

</div>

Hi! Inside a function, I would like to evaluate a module’s function based on two inputs: 1) the module itself and 2) the function’s name as a string. Here is the code: module A function foo() println("This is A.foo…

---

## [Pasting long lines into the REPL takes too long in Win10?](https://discourse.julialang.org/t/pasting-long-lines-into-the-repl-takes-too-long-in-win10/59995)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 15\
**Last updated:** [April 26, 2021, 10:27am UTC](https://discourse.julialang.org/t/pasting-long-lines-into-the-repl-takes-too-long-in-win10/59995 "2021-04-26T10:27:58Z")

</div>

When pasting long lines into the REPL, like the variable assignments below taken from this post, it seems to take forever for the REPL to consume the data as there is a lot of scrolling. Using Julia 1.6.1 on Win10. Is t…

---

## [Generate function to build a static array from vector of vector](https://discourse.julialang.org/t/generate-function-to-build-a-static-array-from-vector-of-vector/59862)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 5\
**Last updated:** [April 26, 2021, 9:17am UTC](https://discourse.julialang.org/t/generate-function-to-build-a-static-array-from-vector-of-vector/59862 "2021-04-26T09:17:10Z")

</div>

I have a Vector of Vectors (actually Vector of SVectors, but I do not believe this is relevant to the question.) All vectors, inner and outer, have length N. I wish to generate an SMatrix from it in a typestable mann…

---

## [Huge Performance drop after upgrading to 1.6](https://discourse.julialang.org/t/huge-performance-drop-after-upgrading-to-1-6/59789)

<div class="topic-metadata">

**Author:** [@imLew](https://discourse.julialang.org/u/imLew)\
**Replies:** 13\
**Last updated:** [April 26, 2021, 9:08am UTC](https://discourse.julialang.org/t/huge-performance-drop-after-upgrading-to-1-6/59789 "2021-04-26T09:08:56Z")

</div>

Crossposting this from zulip to reach more people and because it’s a getting a bit long. tl;dr After upgrading to 1.6 my code runs 50 times slower, it seems to be caused by broadcasting with calls to materialize increa…

---

## [Packages for text matching?](https://discourse.julialang.org/t/packages-for-text-matching/60012)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 15\
**Last updated:** [April 26, 2021, 8:49am UTC](https://discourse.julialang.org/t/packages-for-text-matching/60012 "2021-04-26T08:49:14Z")

</div>

I’d like to write: "$(First\_Name).$(Last\_Name),$(Age)" = "John.Smith,20" with result (First\_Name = "John", Last\_Name = "Smith", Age = 20 ) Any package that supports this pattern matching in text?

---

## [Understanding Mahalanobis in Distances.jl](https://discourse.julialang.org/t/understanding-mahalanobis-in-distances-jl/59656)

<div class="topic-metadata">

**Author:** [@Jasper\_Hall](https://discourse.julialang.org/u/Jasper_Hall)\
**Replies:** 4\
**Last updated:** [April 26, 2021, 8:19am UTC](https://discourse.julialang.org/t/understanding-mahalanobis-in-distances-jl/59656 "2021-04-26T08:19:13Z")

</div>

I have a working understanding of principles of distances between datasets at a fairly high level (ie perhaps not all the detailed maths). I want to calculate the Mahalanobis distance between a reference dataset and an …

---

## [Sharing and running Julia notebooks or applications](https://discourse.julialang.org/t/sharing-and-running-julia-notebooks-or-applications/58942)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 3\
**Last updated:** [April 26, 2021, 7:24am UTC](https://discourse.julialang.org/t/sharing-and-running-julia-notebooks-or-applications/58942 "2021-04-26T07:24:08Z")

</div>

Hello I would be interrested to share Julia Jupyter or Pluto notebooks. Ideally the users should not be requied to install anything on their computer. How can I best do that? Thanks Michel

---

## [ArgParse error "too many arguments"](https://discourse.julialang.org/t/argparse-error-too-many-arguments/59764)

<div class="topic-metadata">

**Author:** [@hei06j](https://discourse.julialang.org/u/hei06j)\
**Replies:** 2\
**Last updated:** [April 26, 2021, 3:28am UTC](https://discourse.julialang.org/t/argparse-error-too-many-arguments/59764 "2021-04-26T03:28:23Z")

</div>

Hi, I am trying to use ArgParse to read options from command line. It works when I have three options, but when I add another option it throws “too many argument” error. using ArgParse function parse\_commandline() …

---

## [How often do you use the |\> operator?](https://discourse.julialang.org/t/how-often-do-you-use-the-operator/56189)

<div class="topic-metadata">

**Author:** [@anon74562486](https://discourse.julialang.org/u/anon74562486)\
**Replies:** 56\
**Last updated:** [April 26, 2021, 1:16am UTC](https://discourse.julialang.org/t/how-often-do-you-use-the-operator/56189 "2021-04-26T01:16:33Z")

</div>

I really like pipe operator (|\>) but if I see the source code of libraries I see that it is often used like this: a = function\_2(function\_1(input\_data)) |\> gpu rather than this: a = input\_data |\> function\_1 |\> …

---

## [Eigenvectors of very large (non-sparse) symmetric matrices?](https://discourse.julialang.org/t/eigenvectors-of-very-large-non-sparse-symmetric-matrices/59885)

<div class="topic-metadata">

**Author:** [@JedPhillips](https://discourse.julialang.org/u/JedPhillips)\
**Replies:** 11\
**Last updated:** [April 25, 2021, 7:57pm UTC](https://discourse.julialang.org/t/eigenvectors-of-very-large-non-sparse-symmetric-matrices/59885 "2021-04-25T19:57:29Z")

</div>

I’m trying to get the first 50 dominant eigenvectors of a huge symmetric matrix, of dimension 65000 x 65000. I’m doing this on a computer cluster, so there’s no RAM limitation. But it still takes forever. In fact I don’t…

---

## [Why is this Plots.jl contour plot blank?](https://discourse.julialang.org/t/why-is-this-plots-jl-contour-plot-blank/59990)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 1\
**Last updated:** [April 25, 2021, 2:46pm UTC](https://discourse.julialang.org/t/why-is-this-plots-jl-contour-plot-blank/59990 "2021-04-25T14:46:20Z")

</div>

I’m trying to produce a “pork chop” plot for an aerospace engineering assignment. I’m using Plots.jl, and the GR backend. I want to plot a contour plot, with \\Delta v as the “z” axis. For some reason, I can plot the dat…

---

## [How to sample multiple self defined random variable](https://discourse.julialang.org/t/how-to-sample-multiple-self-defined-random-variable/59847)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 4\
**Last updated:** [April 25, 2021, 7:50am UTC](https://discourse.julialang.org/t/how-to-sample-multiple-self-defined-random-variable/59847 "2021-04-25T07:50:47Z")

</div>

I have defined the following Distribution, using Distributions struct ComplexNormal \<:ContinuousUnivariateDistribution μ::ComplexF64 σ::Float64 function ComplexNormal(μ=0,σ=1) new(μ,σ) end end function B…

---

## [I cannot install Plots in Julia 1.6.1](https://discourse.julialang.org/t/i-cannot-install-plots-in-julia-1-6-1/59971)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 1\
**Last updated:** [April 25, 2021, 7:37am UTC](https://discourse.julialang.org/t/i-cannot-install-plots-in-julia-1-6-1/59971 "2021-04-25T07:37:25Z")

</div>

\_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "\]?" for Pkg help. | | | | | | |/ \_\` | | | | |\_| | | | (\_| |…

---

## [Compatibility with previous versions of Julia: how much makes sense for a new package?](https://discourse.julialang.org/t/compatibility-with-previous-versions-of-julia-how-much-makes-sense-for-a-new-package/59920)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 4\
**Last updated:** [April 25, 2021, 7:29am UTC](https://discourse.julialang.org/t/compatibility-with-previous-versions-of-julia-how-much-makes-sense-for-a-new-package/59920 "2021-04-25T07:29:59Z")

</div>

I am developing several computational packages, mainly oriented towards control system applications. Several times I was confronted with keeping compatibility with earlier versions of Julia, where I set (I don’t remember…

---

## [PowerModels generation and branch result data extraction](https://discourse.julialang.org/t/powermodels-generation-and-branch-result-data-extraction/59973)

<div class="topic-metadata">

**Author:** [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Replies:** 0\
**Last updated:** [April 25, 2021, 6:06am UTC](https://discourse.julialang.org/t/powermodels-generation-and-branch-result-data-extraction/59973 "2021-04-25T06:06:57Z")

</div>

Dears I’m working on the package PowerModels and I’m trying to extract results data for further manipulation. the problem that I have faced is regrading generation results and how to extract them in an accurate way. I h…

---

## [Issue compiling GR\_jll on hpc](https://discourse.julialang.org/t/issue-compiling-gr-jll-on-hpc/59898)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 5\
**Last updated:** [April 25, 2021, 12:03am UTC](https://discourse.julialang.org/t/issue-compiling-gr-jll-on-hpc/59898 "2021-04-25T00:03:35Z")

</div>

I searched available modules on this hpc cluster and nothing like “libqt” showed up so I’m assuming this is always in the path. For some reason I still get this error: julia\> using GR\_jll \[ Info: Precompiling GR\_jll \[d…

---

## [Get ambiguous method candidates](https://discourse.julialang.org/t/get-ambiguous-method-candidates/59953)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [April 24, 2021, 9:17pm UTC](https://discourse.julialang.org/t/get-ambiguous-method-candidates/59953 "2021-04-24T21:17:56Z")

</div>

struct Foo end struct Bar end f(x::Foo, y) = 2 f(x, y::Bar) = 3 f(Foo(), Bar()) # ambiguous This errors because of ambiguity. How can I get the list of candidate functions? I’m not sure why methods(f, (Foo, Bar)) re…

---

## [Error in Pkg.build: " override this by setting \`ignore\_platform\` "](https://discourse.julialang.org/t/error-in-pkg-build-override-this-by-setting-ignore-platform/59948)

<div class="topic-metadata">

**Author:** [@Hannah\_Rocio\_Santa\_C](https://discourse.julialang.org/u/Hannah_Rocio_Santa_C)\
**Replies:** 1\
**Last updated:** [April 24, 2021, 8:26pm UTC](https://discourse.julialang.org/t/error-in-pkg-build-override-this-by-setting-ignore-platform/59948 "2021-04-24T20:26:46Z")

</div>

Hello, I’m hoping someone could help me with an error message I get when trying to build Arpack. I get the following message, which seems quite useful, but I don’t actually know how to follow the suggestion, so I was h…

---

## [LinearAlgebra.BLAS does not accept non-dense Julia Matrix type?](https://discourse.julialang.org/t/linearalgebra-blas-does-not-accept-non-dense-julia-matrix-type/59921)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 3\
**Last updated:** [April 24, 2021, 6:55pm UTC](https://discourse.julialang.org/t/linearalgebra-blas-does-not-accept-non-dense-julia-matrix-type/59921 "2021-04-24T18:55:37Z")

</div>

LinearAlgebra.BLAS.gbmv!('N', 100, 1, 1, 1.0, A\_POC, ones(100), 0.0, ones(100)) throws error julia\> LinearAlgebra.BLAS.gbmv!('N', 100, 1, 1, 1.0, (A\_POC), ones(100), 0.0, on es(100)) ERROR: LoadError: MethodError: no m…

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

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