# General Usage

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

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

**Page:** 437

---

## [Help with Julia tutorials for intermediate and advanced topics](https://discourse.julialang.org/t/help-with-julia-tutorials-for-intermediate-and-advanced-topics/82696)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 0\
**Last updated:** [June 13, 2022, 6:03pm UTC](https://discourse.julialang.org/t/help-with-julia-tutorials-for-intermediate-and-advanced-topics/82696 "2022-06-13T18:03:14Z")

</div>

I have been using Julia for more than a year now and I am now trying to learn some more difficult topics. Note that my background is not in CS. I work mostly in Control Engineering. Let us say we can split content in Ju…

---

## [Efficient xor cursor ... in color?](https://discourse.julialang.org/t/efficient-xor-cursor-in-color/82644)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 1\
**Last updated:** [June 13, 2022, 5:19pm UTC](https://discourse.julialang.org/t/efficient-xor-cursor-in-color/82644 "2022-06-13T17:19:39Z")

</div>

Julia can xor a cursor image with an image when both images are gray, producing the following image with the following code: img = Array{N0f8}(reshape(range(0,stop=1,length=10^4), 100, 100)) imgx = zeros(N0f8, 21, 2…

---

## [Zero at center of Colorbar](https://discourse.julialang.org/t/zero-at-center-of-colorbar/82664)

<div class="topic-metadata">

**Author:** [@markub3327](https://discourse.julialang.org/u/markub3327)\
**Replies:** 4\
**Last updated:** [June 13, 2022, 12:25pm UTC](https://discourse.julialang.org/t/zero-at-center-of-colorbar/82664 "2022-06-13T12:25:50Z")

</div>

Hello, I use the :balance colorscheme with the ideally zero as white at the centre of Colorbar. The highest value is red and the lowest value is blue. If I have a range (-4.725205, 28.010359), I get around 10 at the cen…

---

## [Free dev-ed path…?](https://discourse.julialang.org/t/free-dev-ed-path/29065)

<div class="topic-metadata">

**Author:** [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Replies:** 9\
**Last updated:** [June 13, 2022, 1:14pm UTC](https://discourse.julialang.org/t/free-dev-ed-path/29065 "2022-06-13T13:14:15Z")

</div>

According to the docs, free is the command to undo develop – but if a package is developed by supplying a path, free balks at that path, as it can’t be parsed as a package; and it won’t accept the package, as it’s not in…

---

## ["Optional" in-place output arguments](https://discourse.julialang.org/t/optional-in-place-output-arguments/82492)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 31\
**Last updated:** [June 13, 2022, 1:11pm UTC](https://discourse.julialang.org/t/optional-in-place-output-arguments/82492 "2022-06-13T13:11:22Z")

</div>

I am considering writing a function foo!(i1,i2,o1,o2,o3) where i1 etc. are inputs and o1 etc. are outputs. Importantly: all the outputs are preallocated (mutable) vectors, and the results are to written in place into…

---

## [Can't get SSH auth working for private Github repos (using ssh-agent on Windows)](https://discourse.julialang.org/t/cant-get-ssh-auth-working-for-private-github-repos-using-ssh-agent-on-windows/63192)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 13\
**Last updated:** [June 13, 2022, 12:12pm UTC](https://discourse.julialang.org/t/cant-get-ssh-auth-working-for-private-github-repos-using-ssh-agent-on-windows/63192 "2022-06-13T12:12:54Z")

</div>

After months of nagging from Github I’m finally switching to SSH authentication. It’s working now for command line git operations (after I set the GIT\_SSH environment variable to point to ssh.exe), but I can’t get it wor…

---

## [\`unsqueeze\` or \`insertdims\` not part of Base](https://discourse.julialang.org/t/unsqueeze-or-insertdims-not-part-of-base/82508)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 1\
**Last updated:** [June 13, 2022, 10:59am UTC](https://discourse.julialang.org/t/unsqueeze-or-insertdims-not-part-of-base/82508 "2022-06-13T10:59:02Z")

</div>

Hi! in Base we have dropdims which effectively calls reshape. Today, I was confused that we don’t have insertdims being the inverse to the former. There is already one implementation in MLUtils.jl for a single dim. Ho…

---

## [Weird things in docs (markdown & Documenter)](https://discourse.julialang.org/t/weird-things-in-docs-markdown-documenter/25349)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 6\
**Last updated:** [June 13, 2022, 10:34am UTC](https://discourse.julialang.org/t/weird-things-in-docs-markdown-documenter/25349 "2022-06-13T10:34:45Z")

</div>

Hi, I’m seeing strange things in the html created by Documenter as compared with the original markdown and which involve the use of \_. See the bellow examples. This is from (nevermind link address, it’s an alias from Gi…

---

## [How to Create Unit Circle and Right Sided Triangle / Pythagorean with Plots pyplot](https://discourse.julialang.org/t/how-to-create-unit-circle-and-right-sided-triangle-pythagorean-with-plots-pyplot/82541)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [June 13, 2022, 9:09am UTC](https://discourse.julialang.org/t/how-to-create-unit-circle-and-right-sided-triangle-pythagorean-with-plots-pyplot/82541 "2022-06-13T09:09:15Z")

</div>

Hi all, I want to create a right-sided triangle that also has label for the angle and the side name. The question is how? I have found this that can plot a triangle : But still a bit advanced for me to edit and creat…

---

## [Does \`==(::Missing, ::Any)=missing\` violate type stability?](https://discourse.julialang.org/t/does-missing-any-missing-violate-type-stability/82649)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 4\
**Last updated:** [June 13, 2022, 1:17am UTC](https://discourse.julialang.org/t/does-missing-any-missing-violate-type-stability/82649 "2022-06-13T01:17:53Z")

</div>

(The intent of this question is to improve my understanding of type stability, not criticize the language design.) Most comparisons, like 0==0 and false==1 and so on return a Bool, but comparisons with missing return mi…

---

## [Simple Table Operation Has Very Large Compilation Time with MLJ](https://discourse.julialang.org/t/simple-table-operation-has-very-large-compilation-time-with-mlj/82503)

<div class="topic-metadata">

**Author:** [@Jack\_N](https://discourse.julialang.org/u/Jack_N)\
**Replies:** 20\
**Last updated:** [June 12, 2022, 10:12pm UTC](https://discourse.julialang.org/t/simple-table-operation-has-very-large-compilation-time-with-mlj/82503 "2022-06-12T22:12:44Z")

</div>

I am trying to use MLJ on a DataFrame (30,000 rows x 8,000 columns) but every table operation seems to take a huge amount of time to compile but is fast to run. I have given an example with code below in which a 5 x 500…

---

## [How to convert fmpq to Int](https://discourse.julialang.org/t/how-to-convert-fmpq-to-int/82634)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 5\
**Last updated:** [June 12, 2022, 9:01pm UTC](https://discourse.julialang.org/t/how-to-convert-fmpq-to-int/82634 "2022-06-12T21:01:54Z")

</div>

v = fmpq\[1,0,0\] vector, how to convert this to just \[1,0,0\]

---

## [How can I check out a pull request?](https://discourse.julialang.org/t/how-can-i-check-out-a-pull-request/82635)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [June 12, 2022, 1:54pm UTC](https://discourse.julialang.org/t/how-can-i-check-out-a-pull-request/82635 "2022-06-12T13:54:40Z")

</div>

I would like to try: https://github.com/JuliaEcosystem/PkgDeps.jl/pull/39 How can I install it in Julia on Linux?

---

## [Axis linewidth in CairoMakie](https://discourse.julialang.org/t/axis-linewidth-in-cairomakie/82624)

<div class="topic-metadata">

**Author:** [@devanshu](https://discourse.julialang.org/u/devanshu)\
**Replies:** 2\
**Last updated:** [June 12, 2022, 9:23am UTC](https://discourse.julialang.org/t/axis-linewidth-in-cairomakie/82624 "2022-06-12T09:23:39Z")

</div>

Hi, I am using CairoMakie for plotting in Julia. I am wondering if there is any way to get thick borders in my figure? Something like this: Thank you!

---

## [Global environment affecting local environment](https://discourse.julialang.org/t/global-environment-affecting-local-environment/82611)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 6\
**Last updated:** [June 12, 2022, 9:03am UTC](https://discourse.julialang.org/t/global-environment-affecting-local-environment/82611 "2022-06-12T09:03:22Z")

</div>

I just ran julia --project in my locally developed package with only a few dependencies, and then ran Pkg.test(). However, for some reason, the package manager spends a bunch of time precompiling packages like Plots, and…

---

## [Why boolean is 4 bytes instead of 1 byte in struct](https://discourse.julialang.org/t/why-boolean-is-4-bytes-instead-of-1-byte-in-struct/82613)

<div class="topic-metadata">

**Author:** [@jk091](https://discourse.julialang.org/u/jk091)\
**Replies:** 3\
**Last updated:** [June 12, 2022, 7:21am UTC](https://discourse.julialang.org/t/why-boolean-is-4-bytes-instead-of-1-byte-in-struct/82613 "2022-06-12T07:21:05Z")

</div>

Hi all, I’m having trouble understanding why boolean is taking 4 bytes instead of 1 byte in structs. Here is an example: struct F8 p::Float32 t::Float32 end get\_F8() = F8(0.0f0, 0.0f0) println(sizeof(get\_F8())…

---

## [Element-wise sincosd](https://discourse.julialang.org/t/element-wise-sincosd/82619)

<div class="topic-metadata">

**Author:** [@markub3327](https://discourse.julialang.org/u/markub3327)\
**Replies:** 11\
**Last updated:** [June 12, 2022, 6:33am UTC](https://discourse.julialang.org/t/element-wise-sincosd/82619 "2022-06-12T06:33:37Z")

</div>

Hello, I have a non-squared matrix with shape (1, 25). I need to calculate element-wise sincosd, but I get an error: ERROR: LoadError: DimensionMismatch: matrix is not square: dimensions are (1, 25) Stacktrace: \[1\] ch…

---

## [Type stability with if statements on types](https://discourse.julialang.org/t/type-stability-with-if-statements-on-types/82618)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 1\
**Last updated:** [June 12, 2022, 5:44am UTC](https://discourse.julialang.org/t/type-stability-with-if-statements-on-types/82618 "2022-06-12T05:44:46Z")

</div>

I would like to implement something to the following effect: function f(x) gx = g(x) if g(x) isa MyType return gx else return 0. end end If g is type stable, if f always type stable?

---

## [Is there a Julia command line equivalent of \`python -m python\_package\_name\`](https://discourse.julialang.org/t/is-there-a-julia-command-line-equivalent-of-python-m-python-package-name/82604)

<div class="topic-metadata">

**Author:** [@djpasseyjr](https://discourse.julialang.org/u/djpasseyjr)\
**Replies:** 4\
**Last updated:** [June 11, 2022, 7:49pm UTC](https://discourse.julialang.org/t/is-there-a-julia-command-line-equivalent-of-python-m-python-package-name/82604 "2022-06-11T19:49:35Z")

</div>

In Python, packages may have a \_\_main\_\_.py file. If they do you can execute the code inside of this file in the command line by using: python -m python\_package\_name. It can also accept arguments: python -m python\_pack…

---

## [Unexpected allocation at each loop iteration](https://discourse.julialang.org/t/unexpected-allocation-at-each-loop-iteration/82600)

<div class="topic-metadata">

**Author:** [@simon79](https://discourse.julialang.org/u/simon79)\
**Replies:** 8\
**Last updated:** [June 11, 2022, 5:19pm UTC](https://discourse.julialang.org/t/unexpected-allocation-at-each-loop-iteration/82600 "2022-06-11T17:19:53Z")

</div>

Hi, The following overly-simplified extraction from my code shows a section of the code which is allocating memory at every loop iteration. I think this should not happen and I’d like to have advise and suggestion on h…

---

## [Replace missing values by a group mean](https://discourse.julialang.org/t/replace-missing-values-by-a-group-mean/82583)

<div class="topic-metadata">

**Author:** [@Brinkhuis](https://discourse.julialang.org/u/Brinkhuis)\
**Replies:** 7\
**Last updated:** [June 11, 2022, 4:45pm UTC](https://discourse.julialang.org/t/replace-missing-values-by-a-group-mean/82583 "2022-06-11T16:45:59Z")

</div>

In an iris dataframe I replaced some values by missing. I would like to replace the missing values in the column petal\_length by the petal\_length mean per species. The code below does work (means before and after replac…

---

## [How do you unfold a nested Julia array?](https://discourse.julialang.org/t/how-do-you-unfold-a-nested-julia-array/2243)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 12\
**Last updated:** [June 11, 2022, 2:02pm UTC](https://discourse.julialang.org/t/how-do-you-unfold-a-nested-julia-array/2243 "2022-06-11T14:02:58Z")

</div>

What is an efficient, elegant, Julian way to unfold a nested array: nested = \[\[1,2,3\],\[4,5\]\] vcat(nested...) # works but not always Is there a function in Base to unfold all sorts of nested data structures into a plain…

---

## [Rendering : avoid re-render pixels that did not change](https://discourse.julialang.org/t/rendering-avoid-re-render-pixels-that-did-not-change/82599)

<div class="topic-metadata">

**Author:** [@Francois](https://discourse.julialang.org/u/Francois)\
**Replies:** 0\
**Last updated:** [June 11, 2022, 12:12pm UTC](https://discourse.julialang.org/t/rendering-avoid-re-render-pixels-that-did-not-change/82599 "2022-06-11T12:12:20Z")

</div>

I’m trying to render a very big cellular automaton. I use image!(ax, Matrix{RGB}, …) to render the first image, then I change the Observable at each step of my simulation with the updated matrix. Few cells change from on…

---

## [Replacement for Pkg.dependents() in 1.0?](https://discourse.julialang.org/t/replacement-for-pkg-dependents-in-1-0/24131)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 17\
**Last updated:** [June 11, 2022, 11:55am UTC](https://discourse.julialang.org/t/replacement-for-pkg-dependents-in-1-0/24131 "2022-06-11T11:55:56Z")

</div>

I was using Pkg.dependents("PkgName") to get data for these force directed graphs of the Julia ecosystem last year. Now I need to actually use them and Pkg.dependents() is gone! any ideas how to build a list of all packa…

---

## [Type instability inside function with function as input argument](https://discourse.julialang.org/t/type-instability-inside-function-with-function-as-input-argument/82585)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 3\
**Last updated:** [June 11, 2022, 12:25am UTC](https://discourse.julialang.org/t/type-instability-inside-function-with-function-as-input-argument/82585 "2022-06-11T00:25:36Z")

</div>

The following is part of the code for some FEM calculations: function assemble\_Ab(x, a\_fun, c\_fun, f\_fun, order::Integer=1) N = length(x) A = zeros(N,N) b = zeros(N) if order == 1 …

---

## [Makie title and xlabel weirdness](https://discourse.julialang.org/t/makie-title-and-xlabel-weirdness/82578)

<div class="topic-metadata">

**Author:** [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)\
**Replies:** 2\
**Last updated:** [June 10, 2022, 10:06pm UTC](https://discourse.julialang.org/t/makie-title-and-xlabel-weirdness/82578 "2022-06-10T22:06:22Z")

</div>

I have a question about why the approach to making a supertitle and updating it works in the first instance with the volume plots, but not in the second instance with the heatmaps? In both cases, I create the new fig\[0,…

---

## [Is there something like skimage's view\_as\_windows in Julia?](https://discourse.julialang.org/t/is-there-something-like-skimages-view-as-windows-in-julia/82532)

<div class="topic-metadata">

**Author:** [@Shirakumo](https://discourse.julialang.org/u/Shirakumo)\
**Replies:** 3\
**Last updated:** [June 10, 2022, 5:42pm UTC](https://discourse.julialang.org/t/is-there-something-like-skimages-view-as-windows-in-julia/82532 "2022-06-10T17:42:31Z")

</div>

Hello everyone, in Python there is a library, to be specific skimage.util.shape and there is view\_as windows which allow for something like this: A array(\[\[ 0, 1, 2, 3\], \[ 4, 5, 6, 7\], \[ 8, 9, 10, …

---

## [Spurious parentheses in generated expression](https://discourse.julialang.org/t/spurious-parentheses-in-generated-expression/82572)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 3\
**Last updated:** [June 10, 2022, 4:51pm UTC](https://discourse.julialang.org/t/spurious-parentheses-in-generated-expression/82572 "2022-06-10T16:51:58Z")

</div>

I have a regression test that’s failing. It’s testing a helper function to a macro that adds a source slot to a struct definition and modifies the constructor methods appropriately. That helper function returns this ex…

---

## [Mechanism type in RigidBodyDynamics.jl defaulting to Mechanism type in ConstrainedDynamics.jl](https://discourse.julialang.org/t/mechanism-type-in-rigidbodydynamics-jl-defaulting-to-mechanism-type-in-constraineddynamics-jl/82525)

<div class="topic-metadata">

**Author:** [@jpro](https://discourse.julialang.org/u/jpro)\
**Replies:** 1\
**Last updated:** [June 10, 2022, 3:40pm UTC](https://discourse.julialang.org/t/mechanism-type-in-rigidbodydynamics-jl-defaulting-to-mechanism-type-in-constraineddynamics-jl/82525 "2022-06-10T15:40:04Z")

</div>

I’m new to the RigidBodyDynamics package and wanted to follow this tutorial. Quickstart - double pendulum When I call the Mechanism type I get errors. Here is my code along with the errors. It appears based on the erro…

---

## [Boolean Indexing](https://discourse.julialang.org/t/boolean-indexing/82556)

<div class="topic-metadata">

**Author:** [@lazycoder](https://discourse.julialang.org/u/lazycoder)\
**Replies:** 2\
**Last updated:** [June 10, 2022, 1:30pm UTC](https://discourse.julialang.org/t/boolean-indexing/82556 "2022-06-10T13:30:24Z")

</div>

I’m a little confused on boolean indexing, I’m trying to do something like this: test=5.4 res=fill(0,size(test)) res\[test .\> 5\] .=5 The size of test could be one or more, but when test is a size of one I get an error w…

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

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