# General Usage

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

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

**Page:** 654

---

## [How to collaborate with others over branches in separate packages?](https://discourse.julialang.org/t/how-to-collaborate-with-others-over-branches-in-separate-packages/53909)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 0\
**Last updated:** [January 25, 2021, 1:51pm UTC](https://discourse.julialang.org/t/how-to-collaborate-with-others-over-branches-in-separate-packages/53909 "2021-01-25T13:51:08Z")

</div>

When adding new features that require changes amongst different packages I tend to work in separate branches in each package which are cloned and \] deved locally. But how do I share the branches with other collaborators? …

---

## [Type stability problem (Vcat, Tuple and function)](https://discourse.julialang.org/t/type-stability-problem-vcat-tuple-and-function/53862)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 8\
**Last updated:** [January 25, 2021, 1:24pm UTC](https://discourse.julialang.org/t/type-stability-problem-vcat-tuple-and-function/53862 "2021-01-25T13:24:43Z")

</div>

Hey Julianners, I am working on type stability and I just can’t understand what is going on here. Finally I could minimalise my example to 3 line. @code\_warntype (vcat(\[randn(1,1,3) for i in 1:3\]...)) baz() = (vcat(\[ra…

---

## [How to avoid ForwardDiff.jl generating a second-order derivative that wastes flops by eventually multiplying by zero](https://discourse.julialang.org/t/how-to-avoid-forwarddiff-jl-generating-a-second-order-derivative-that-wastes-flops-by-eventually-multiplying-by-zero/53845)

<div class="topic-metadata">

**Author:** [@schneiderfelipe](https://discourse.julialang.org/u/schneiderfelipe)\
**Replies:** 10\
**Last updated:** [January 25, 2021, 2:28am UTC](https://discourse.julialang.org/t/how-to-avoid-forwarddiff-jl-generating-a-second-order-derivative-that-wastes-flops-by-eventually-multiplying-by-zero/53845 "2021-01-25T02:28:23Z")

</div>

I played around with second derivatives and ForwardDiff.jl and found something unexpected, so I would like to ask about it. Basically, the generated LLVM representation is multiplying a whole code branch by zero before r…

---

## [Workflow to develop standalone scripts that depend on both standard and custom Packages](https://discourse.julialang.org/t/workflow-to-develop-standalone-scripts-that-depend-on-both-standard-and-custom-packages/53873)

<div class="topic-metadata">

**Author:** [@anglyan](https://discourse.julialang.org/u/anglyan)\
**Replies:** 8\
**Last updated:** [January 25, 2021, 1:50am UTC](https://discourse.julialang.org/t/workflow-to-develop-standalone-scripts-that-depend-on-both-standard-and-custom-packages/53873 "2021-01-25T01:50:51Z")

</div>

Hi, I have been using Julia on and off for the past four years, and one of the things that I am still struggling with is the lack of a consistent workflow to develop and run standalone scripts that depend on a common se…

---

## [Can't Run Interact](https://discourse.julialang.org/t/cant-run-interact/53884)

<div class="topic-metadata">

**Author:** [@bobmccrory](https://discourse.julialang.org/u/bobmccrory)\
**Replies:** 0\
**Last updated:** [January 25, 2021, 1:25am UTC](https://discourse.julialang.org/t/cant-run-interact/53884 "2021-01-25T01:25:24Z")

</div>

I’m running a pretty standard Windows 10 laptop with the latest Anaconda and JuliaPro installed. When I try to install and run Interact with one of the sample Interact workbooks (the Introduction), it complains that it c…

---

## [How to enforce minimum dimensions for arrays that might be scalars?](https://discourse.julialang.org/t/how-to-enforce-minimum-dimensions-for-arrays-that-might-be-scalars/53860)

<div class="topic-metadata">

**Author:** [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Replies:** 3\
**Last updated:** [January 24, 2021, 7:27pm UTC](https://discourse.julialang.org/t/how-to-enforce-minimum-dimensions-for-arrays-that-might-be-scalars/53860 "2021-01-24T19:27:58Z")

</div>

I have a function expecting a Matrix and a Vector argument: function f(m::Matrix, v::Vector) ... end Inside f performs some linear algebra. My problem: I need f to work when its arguments are scalars as well. How shou…

---

## [Very slow loop](https://discourse.julialang.org/t/very-slow-loop/53608)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 33\
**Last updated:** [January 24, 2021, 7:26pm UTC](https://discourse.julialang.org/t/very-slow-loop/53608 "2021-01-24T19:26:26Z")

</div>

Hi all, I am trying to speed up this loop. I am providing a MWE and I wanted to know if any of you could spot any obvious performance improvementes. using LinearAlgebra, Statistics, Random C=rand(\[0,1\],120,13,8000) D…

---

## [Generate random positive definite symmetric matrix](https://discourse.julialang.org/t/generate-random-positive-definite-symmetric-matrix/53816)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 10\
**Last updated:** [January 24, 2021, 10:19am UTC](https://discourse.julialang.org/t/generate-random-positive-definite-symmetric-matrix/53816 "2021-01-24T10:19:38Z")

</div>

Can Julia or some existing package simulate random covariance (symmetric + positive definite) matrices? I could do using LinearAlgebra function random\_covariance\_matrix(n::Int) x = rand(n, n) xsym = 0.5(x + x')…

---

## [Writing CSV or TXT files to be read by VBA script (not just opened by excel)](https://discourse.julialang.org/t/writing-csv-or-txt-files-to-be-read-by-vba-script-not-just-opened-by-excel/53857)

<div class="topic-metadata">

**Author:** [@Peter-Jolly](https://discourse.julialang.org/u/Peter-Jolly)\
**Replies:** 2\
**Last updated:** [January 24, 2021, 9:10am UTC](https://discourse.julialang.org/t/writing-csv-or-txt-files-to-be-read-by-vba-script-not-just-opened-by-excel/53857 "2021-01-24T09:10:23Z")

</div>

I have been trying to prepare either \*.txt or \*.csv files from Julia to be read by a VBA script. It appears that the files prepared by Julia NOT PUT a carriage return(CR) line feed(LF) at the end of each line. It seems V…

---

## [How to understand the keyword \`where\` in the array type signature](https://discourse.julialang.org/t/how-to-understand-the-keyword-where-in-the-array-type-signature/53856)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 2\
**Last updated:** [January 24, 2021, 5:08am UTC](https://discourse.julialang.org/t/how-to-understand-the-keyword-where-in-the-array-type-signature/53856 "2021-01-24T05:08:01Z")

</div>

a = Array{Int}\[\] push!(a, \[1 2; 3 4\]) @show typeof(a) Array{Array{Int64,N} where N,1} In the above, how should I read where N,1? Especially, what does 1 represent here? How may I create a variable of type Array{Array{…

---

## [How can I load a polygonal 2D mesh (VTK format) into JuAFEM?](https://discourse.julialang.org/t/how-can-i-load-a-polygonal-2d-mesh-vtk-format-into-juafem/53831)

<div class="topic-metadata">

**Author:** [@gedankenexperiment](https://discourse.julialang.org/u/gedankenexperiment)\
**Replies:** 1\
**Last updated:** [January 23, 2021, 10:39pm UTC](https://discourse.julialang.org/t/how-can-i-load-a-polygonal-2d-mesh-vtk-format-into-juafem/53831 "2021-01-23T22:39:11Z")

</div>

Hi, I want to solve a reaction-diffusion equation on a 2D polygonal mesh, where each cell has a different parameter value for the reaction-diffusion equation. I have the mesh in the VTK format. Now I wonder whether I sho…

---

## [How to enforce shared behavior for subtype constructors of abstract type](https://discourse.julialang.org/t/how-to-enforce-shared-behavior-for-subtype-constructors-of-abstract-type/52875)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 4\
**Last updated:** [January 23, 2021, 9:50pm UTC](https://discourse.julialang.org/t/how-to-enforce-shared-behavior-for-subtype-constructors-of-abstract-type/52875 "2021-01-23T21:50:07Z")

</div>

In Makie I have an abstract type Layoutable. Whenever a Layoutable is created with a Figure passed as the parent, I want the layoutable added to the figure’s children. The problem is that this behavior needs to happen in…

---

## [Using @benchmark in a for loop with a dictionary](https://discourse.julialang.org/t/using-benchmark-in-a-for-loop-with-a-dictionary/53780)

<div class="topic-metadata">

**Author:** [@Aje12](https://discourse.julialang.org/u/Aje12)\
**Replies:** 2\
**Last updated:** [January 23, 2021, 9:05pm UTC](https://discourse.julialang.org/t/using-benchmark-in-a-for-loop-with-a-dictionary/53780 "2021-01-23T21:05:01Z")

</div>

Hi all, I am pretty new to Julia and I am trying to use the @benchmark macro to benchmark the PageRank algorithm on multiple graphs which are stored in a dictionary. The aim is to store the graphs in the dictionary then…

---

## [Best way to call a function from another function with dispatch on first arg + various arguments](https://discourse.julialang.org/t/best-way-to-call-a-function-from-another-function-with-dispatch-on-first-arg-various-arguments/53795)

<div class="topic-metadata">

**Author:** [@rvezy](https://discourse.julialang.org/u/rvezy)\
**Replies:** 4\
**Last updated:** [January 23, 2021, 5:01pm UTC](https://discourse.julialang.org/t/best-way-to-call-a-function-from-another-function-with-dispatch-on-first-arg-various-arguments/53795 "2021-01-23T17:01:29Z")

</div>

OK I know my title doesn’t help but I don’t know how to explain my problem in a better way. Here is the thing, I have a function fn1 that is called by another function fn2, and the dispatch is made on the type of the fi…

---

## [Why is broadcast faster than the dot syntax? (Performance differences between @., ., broadcast and broadcast!)](https://discourse.julialang.org/t/why-is-broadcast-faster-than-the-dot-syntax-performance-differences-between-broadcast-and-broadcast/53814)

<div class="topic-metadata">

**Author:** [@schneiderfelipe](https://discourse.julialang.org/u/schneiderfelipe)\
**Replies:** 5\
**Last updated:** [January 23, 2021, 11:08am UTC](https://discourse.julialang.org/t/why-is-broadcast-faster-than-the-dot-syntax-performance-differences-between-broadcast-and-broadcast/53814 "2021-01-23T11:08:14Z")

</div>

From the manual, I expected both cases below to perform equally well, but that seems not to be the case: julia\> using BenchmarkTools julia\> a = \[2, 3, 4, 5\]; julia\> b = \[6 7 8 9\]; julia\> @benchmark a .+ b BenchmarkTo…

---

## [Basic pivoting/widening of a table](https://discourse.julialang.org/t/basic-pivoting-widening-of-a-table/53812)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [January 23, 2021, 12:10am UTC](https://discourse.julialang.org/t/basic-pivoting-widening-of-a-table/53812 "2021-01-23T00:10:40Z")

</div>

Consider the following MWE: using DataFrames df\_str = """ mdate type yesno workerid 1/1/2020 pcr no 1 1/1/2020 molecular yes 1 1/1/2020 pcr yes 2 1/1/2020 molecular yes 2 1/1/2020 antigen yes 2 1/1/2020 molecular no 3…

---

## [Multiple dispatch and type conversion for cousins of a type hierarchy](https://discourse.julialang.org/t/multiple-dispatch-and-type-conversion-for-cousins-of-a-type-hierarchy/53787)

<div class="topic-metadata">

**Author:** [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 5:47pm UTC](https://discourse.julialang.org/t/multiple-dispatch-and-type-conversion-for-cousins-of-a-type-hierarchy/53787 "2021-01-22T17:47:56Z")

</div>

I have the following type hierarchy: abstract type U end struct A \<: U ... end struct B \<: U ... end (I’ve omitted the details, but A and B both have identical field-names and types, but the semantic meaning of thei…

---

## [Is varinfo() designed to not report size of an array of sparse matrices?](https://discourse.julialang.org/t/is-varinfo-designed-to-not-report-size-of-an-array-of-sparse-matrices/53786)

<div class="topic-metadata">

**Author:** [@brownlight](https://discourse.julialang.org/u/brownlight)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 4:05pm UTC](https://discourse.julialang.org/t/is-varinfo-designed-to-not-report-size-of-an-array-of-sparse-matrices/53786 "2021-01-22T16:05:13Z")

</div>

Memory usage shoots up after computing two variable/references, D & Rj\_mats. For these two, varinfo() reports: D 6.000 MiB 262144×262144 SparseMatrixCSC{Int64,Int64} Rj\_mats 10.039 KiB 256-element Array{SparseMatrixCSC{…

---

## [Julia and C or just standalone C++](https://discourse.julialang.org/t/julia-and-c-or-just-standalone-c/53774)

<div class="topic-metadata">

**Author:** [@anbtta](https://discourse.julialang.org/u/anbtta)\
**Replies:** 6\
**Last updated:** [January 22, 2021, 3:07pm UTC](https://discourse.julialang.org/t/julia-and-c-or-just-standalone-c/53774 "2021-01-22T15:07:44Z")

</div>

Hello, I was wondering if in production the pair Julia and C was a better option to C++ only. In terms of performance, and for code management in a large scale project. Thank you.

---

## [Help with disabling latexification in Plots.jl's ticks (pyplot)](https://discourse.julialang.org/t/help-with-disabling-latexification-in-plots-jls-ticks-pyplot/53738)

<div class="topic-metadata">

**Author:** [@claudio20497](https://discourse.julialang.org/u/claudio20497)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 2:22pm UTC](https://discourse.julialang.org/t/help-with-disabling-latexification-in-plots-jls-ticks-pyplot/53738 "2021-01-22T14:22:28Z")

</div>

Hello, I don’t know how to disable latexification of strings in Plots.jl xticks argument. The point is that if I run the script: using Plots pyplot() strs = \["a\_1", "a\_3", "a\_3", "a\_4"\] heatmap(rand(Uniform(), 5,5), xt…

---

## [Implement the material point method (MPM) in julia, idea, collaborate, recommendation](https://discourse.julialang.org/t/implement-the-material-point-method-mpm-in-julia-idea-collaborate-recommendation/13444)

<div class="topic-metadata">

**Author:** [@WangWei90](https://discourse.julialang.org/u/WangWei90)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 1:48pm UTC](https://discourse.julialang.org/t/implement-the-material-point-method-mpm-in-julia-idea-collaborate-recommendation/13444 "2021-01-22T13:48:20Z")

</div>

Hello, everyone! I’m a Ph.D. student studying underground engineering in China. Currently, I want to implement a THMC simulation model for an underground repository. I want to implement it using MPM, and I want some he…

---

## [Reverse multidimensional array](https://discourse.julialang.org/t/reverse-multidimensional-array/53777)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 6\
**Last updated:** [January 22, 2021, 1:32pm UTC](https://discourse.julialang.org/t/reverse-multidimensional-array/53777 "2021-01-22T13:32:33Z")

</div>

Hey, recently I wanted to reverse a multidimensional array. I didn’t find a built-in solution but only this post on StackOverflow. I was wondering what’s a proper implementation. I came up with the following. reverse\_2 …

---

## [Error building GLMakie no \`/etc/drirc\`](https://discourse.julialang.org/t/error-building-glmakie-no-etc-drirc/53778)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 0\
**Last updated:** [January 22, 2021, 11:36am UTC](https://discourse.julialang.org/t/error-building-glmakie-no-etc-drirc/53778 "2021-01-22T11:36:16Z")

</div>

I am trying to build GLMakie.jl on Manjaro an a Renoir notebook and am getting the following error if I run LIBGL\_DEBUG=verbose julia. Without the debug it just fails without any hint. (@v1.5) pkg\> build GLMakie Buil…

---

## [Check a Future object for remote errors](https://discourse.julialang.org/t/check-a-future-object-for-remote-errors/53768)

<div class="topic-metadata">

**Author:** [@matthiasbe](https://discourse.julialang.org/u/matthiasbe)\
**Replies:** 1\
**Last updated:** [January 22, 2021, 8:51am UTC](https://discourse.julialang.org/t/check-a-future-object-for-remote-errors/53768 "2021-01-22T08:51:23Z")

</div>

Is it possible to check a Future object for any remote error without actually retrieving the remotely computed data ? Sometimes the data is very large and using a fetch() result in undesired large data mouvement. Consid…

---

## [MLJ: selecting rows and columns for training in evaluate! for kernel regression](https://discourse.julialang.org/t/mlj-selecting-rows-and-columns-for-training-in-evaluate-for-kernel-regression/52832)

<div class="topic-metadata">

**Author:** [@Pere](https://discourse.julialang.org/u/Pere)\
**Replies:** 8\
**Last updated:** [January 22, 2021, 8:33am UTC](https://discourse.julialang.org/t/mlj-selecting-rows-and-columns-for-training-in-evaluate-for-kernel-regression/52832 "2021-01-22T08:33:19Z")

</div>

Hi everyone. This is my first post here, I’ve asked this on stackoverflow but have had no luck. Perhaps someone can point me in the right direction. I want to implement a kernel ridge regression that also works within M…

---

## [HPC cluster SSH security issue? (password vs passwordless ssh keypair)](https://discourse.julialang.org/t/hpc-cluster-ssh-security-issue-password-vs-passwordless-ssh-keypair/53664)

<div class="topic-metadata">

**Author:** [@henrikjaerleblad](https://discourse.julialang.org/u/henrikjaerleblad)\
**Replies:** 7\
**Last updated:** [January 22, 2021, 7:21am UTC](https://discourse.julialang.org/t/hpc-cluster-ssh-security-issue-password-vs-passwordless-ssh-keypair/53664 "2021-01-22T07:21:16Z")

</div>

Hello, Previously, I used to be able to run multi-core jobs on my university’s HPC SLURM cluster like this: #!/bin/bash #SBATCH --mail-type=ALL #SBATCH --mail-user=mymail@mailymail.country #SBATCH --export=ALL #SBA…

---

## [Move github repository of a registered julia package](https://discourse.julialang.org/t/move-github-repository-of-a-registered-julia-package/3495)

<div class="topic-metadata">

**Author:** [@bastikr](https://discourse.julialang.org/u/bastikr)\
**Replies:** 7\
**Last updated:** [January 22, 2021, 6:29am UTC](https://discourse.julialang.org/t/move-github-repository-of-a-registered-julia-package/3495 "2021-01-22T06:29:48Z")

</div>

I would like to move a registered package from my github account to a github organization. Can I just submit a pull request where I change the url file in METADATA.jl accordingly or are there additional steps that have t…

---

## [Problems with prompt variable](https://discourse.julialang.org/t/problems-with-prompt-variable/53757)

<div class="topic-metadata">

**Author:** [@emmanuelncb](https://discourse.julialang.org/u/emmanuelncb)\
**Replies:** 2\
**Last updated:** [January 22, 2021, 4:51am UTC](https://discourse.julialang.org/t/problems-with-prompt-variable/53757 "2021-01-22T04:51:09Z")

</div>

Hi, i am studing julia lang and i want customize my prompt, but, the code stay some spaces after mark instead one space only and all times that i press one key the first line of prompt be duplicate. How can i fix this? v…

---

## [I cannot get close to full speed up in parallel](https://discourse.julialang.org/t/i-cannot-get-close-to-full-speed-up-in-parallel/53751)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 4\
**Last updated:** [January 22, 2021, 3:37am UTC](https://discourse.julialang.org/t/i-cannot-get-close-to-full-speed-up-in-parallel/53751 "2021-01-22T03:37:29Z")

</div>

I have a code that is embarrassingly parallel, but I cannot get full its speed up. The dummy code is here: function points\_on\_sphere\_surface(num\_pts=100, R=2) indices = 1:num\_pts .+ 0.5 ϕ = acos.(1 .- 2\*indic…

---

## [Dynamically schedule work onto pmap worker pool?](https://discourse.julialang.org/t/dynamically-schedule-work-onto-pmap-worker-pool/53701)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 6\
**Last updated:** [January 22, 2021, 1:13am UTC](https://discourse.julialang.org/t/dynamically-schedule-work-onto-pmap-worker-pool/53701 "2021-01-22T01:13:24Z")

</div>

I’ve got N chunks of equally long-running work I want to compute across \<N processes, but one chunk is very different code / results than the others. So code-wise, I’d like to schedule that chunk alone, then pmap over th…

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

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