# General Usage

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

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

**Page:** 714

---

## [Is it possible to run a cleanup code after a jldoctest block has been evaluated?](https://discourse.julialang.org/t/is-it-possible-to-run-a-cleanup-code-after-a-jldoctest-block-has-been-evaluated/44999)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [August 15, 2020, 4:31pm UTC](https://discourse.julialang.org/t/is-it-possible-to-run-a-cleanup-code-after-a-jldoctest-block-has-been-evaluated/44999 "2020-08-15T16:31:33Z")

</div>

Documenter allows the inclusion of setup codes for a jldoctest section. Is there something analogous that may be run once a block has finished running, sort of a clean-up code? For example, I’m looking for something lik…

---

## [BenchmarkTools Puzzles](https://discourse.julialang.org/t/benchmarktools-puzzles/44993)

<div class="topic-metadata">

**Author:** [@Hawk](https://discourse.julialang.org/u/Hawk)\
**Replies:** 0\
**Last updated:** [August 15, 2020, 1:52pm UTC](https://discourse.julialang.org/t/benchmarktools-puzzles/44993 "2020-08-15T13:52:56Z")

</div>

I am following Chris’s tutorial of mit18337 course, in his lecture note(Optimizing Serial Code), there is an example about evaluating cost of heap allocation. using LinearAlgebra, BenchmarkTools function alloc\_timer(n) …

---

## [Is it possible for Julia to print numeric output in the REPL with underscores as digit separators?](https://discourse.julialang.org/t/is-it-possible-for-julia-to-print-numeric-output-in-the-repl-with-underscores-as-digit-separators/44962)

<div class="topic-metadata">

**Author:** [@philip](https://discourse.julialang.org/u/philip)\
**Replies:** 15\
**Last updated:** [August 15, 2020, 12:38pm UTC](https://discourse.julialang.org/t/is-it-possible-for-julia-to-print-numeric-output-in-the-repl-with-underscores-as-digit-separators/44962 "2020-08-15T12:38:59Z")

</div>

Say I need to compute the size of a cross join before attempting it. My eyes aren’t great. julia\> 1\_000\*144\*30\*20\*15\*18 23328000000 Wait, how many 0s are there? julia\> ans==2\_332\_800\_000 false Urgh. Can I just see …

---

## [How to fiil gaps in the multiple Satellite Images?](https://discourse.julialang.org/t/how-to-fiil-gaps-in-the-multiple-satellite-images/44408)

<div class="topic-metadata">

**Author:** [@hafez\_ahmad](https://discourse.julialang.org/u/hafez_ahmad)\
**Replies:** 2\
**Last updated:** [August 15, 2020, 9:40am UTC](https://discourse.julialang.org/t/how-to-fiil-gaps-in-the-multiple-satellite-images/44408 "2020-08-15T09:40:53Z")

</div>

I have download 200 Landsat7 satellite images. all images have data gaps. I can solve this problem by using ArcGIS commercial software. however, this process is so time consuming and boring. is there any fast way using …

---

## [How to concatenate multiple \`.gz\` files within Julia?](https://discourse.julialang.org/t/how-to-concatenate-multiple-gz-files-within-julia/44975)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 2\
**Last updated:** [August 15, 2020, 8:18am UTC](https://discourse.julialang.org/t/how-to-concatenate-multiple-gz-files-within-julia/44975 "2020-08-15T08:18:26Z")

</div>

I want to combine multiple .gz files into 1 within Julia. The command to do so in the command line is: cat file1.gz file2.gz file3.gz \> allfiles.gz But the following does not work: files = \["file1.gz", "file2.gz", "fi…

---

## [Model Many to Many relationships](https://discourse.julialang.org/t/model-many-to-many-relationships/44967)

<div class="topic-metadata">

**Author:** [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Replies:** 3\
**Last updated:** [August 15, 2020, 3:12am UTC](https://discourse.julialang.org/t/model-many-to-many-relationships/44967 "2020-08-15T03:12:48Z")

</div>

If I have a many-to-many set of relationships that I want to model, what are performant and pleasant ways to do this? E.g. As can have many Bs, and different As have a relationship with the same B: struct A conten…

---

## [Passing a function to an eval in my module](https://discourse.julialang.org/t/passing-a-function-to-an-eval-in-my-module/44955)

<div class="topic-metadata">

**Author:** [@koosp](https://discourse.julialang.org/u/koosp)\
**Replies:** 4\
**Last updated:** [August 14, 2020, 10:11pm UTC](https://discourse.julialang.org/t/passing-a-function-to-an-eval-in-my-module/44955 "2020-08-14T22:11:08Z")

</div>

I made a module which had a function, that calls another function inside of it to compute partial derivatives. I tested it with Base functions like exp, sin and so on and it worked, it still works. I also tested it with …

---

## [Grassmann.jl A\\b 3x faster than Julia's StaticArrays.jl](https://discourse.julialang.org/t/grassmann-jl-a-b-3x-faster-than-julias-staticarrays-jl/41451)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 34\
**Last updated:** [August 14, 2020, 8:13pm UTC](https://discourse.julialang.org/t/grassmann-jl-a-b-3x-faster-than-julias-staticarrays-jl/41451 "2020-08-14T20:13:03Z")

</div>

In this algebra, it’s possible to compute on a mesh of arbitrary 5 dimensional conformal geometric algebra simplices, which can be represented by a bundle of nested dyadic tensors. julia\> using Grassmann, StaticArrays;…

---

## [Multithreading not giving noticeable advantage when running parallel functions](https://discourse.julialang.org/t/multithreading-not-giving-noticeable-advantage-when-running-parallel-functions/44830)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 19\
**Last updated:** [August 14, 2020, 8:11pm UTC](https://discourse.julialang.org/t/multithreading-not-giving-noticeable-advantage-when-running-parallel-functions/44830 "2020-08-14T20:11:55Z")

</div>

Hello, I have a research problem where I try to determine how a system’s behaviour depends on parameter values. Essentially I have a function determine\_behaviour(p) which takes a set of parameter values and determines h…

---

## [User-defined vector input function in JuMP 0.18.6](https://discourse.julialang.org/t/user-defined-vector-input-function-in-jump-0-18-6/44956)

<div class="topic-metadata">

**Author:** [@Ken\_Lin](https://discourse.julialang.org/u/Ken_Lin)\
**Replies:** 0\
**Last updated:** [August 14, 2020, 7:56pm UTC](https://discourse.julialang.org/t/user-defined-vector-input-function-in-jump-0-18-6/44956 "2020-08-14T19:56:51Z")

</div>

Is it possible to have user-defined functions with vector input in JuMP 0.18.6? Or is there a way to do similar things? I would like to use the NLopt solver (GitHub - JuliaOpt/NLopt.jl: Package to call the NLopt nonlinea…

---

## [Update one, and only one package](https://discourse.julialang.org/t/update-one-and-only-one-package/33755)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [August 14, 2020, 6:58pm UTC](https://discourse.julialang.org/t/update-one-and-only-one-package/33755 "2020-08-14T18:58:53Z")

</div>

I’ve got some Julia application that was released, neatly instantiable from its MANIFEST file. Say it has versions v1.0.0, v1.1.0 and v2.0.0. There was a bug in 1.1.0, that was released 5 months ago. It was some issue wi…

---

## [Maintaining custom package forks](https://discourse.julialang.org/t/maintaining-custom-package-forks/44885)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 4\
**Last updated:** [August 14, 2020, 3:30pm UTC](https://discourse.julialang.org/t/maintaining-custom-package-forks/44885 "2020-08-14T15:30:32Z")

</div>

There have been multiple times now where I have considered maintaining my own fork of a registered package. But, I’m wondering if there are any tools that might make it easier to do so, and if anybody else is doing anyth…

---

## [The logarithm of a tensor](https://discourse.julialang.org/t/the-logarithm-of-a-tensor/44849)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 10\
**Last updated:** [August 14, 2020, 1:25pm UTC](https://discourse.julialang.org/t/the-logarithm-of-a-tensor/44849 "2020-08-14T13:25:49Z")

</div>

I want to take the logarithm of a tensor, what do I do

---

## [How to define a formula with a vector of string names for GLM.jl?](https://discourse.julialang.org/t/how-to-define-a-formula-with-a-vector-of-string-names-for-glm-jl/44930)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [August 14, 2020, 1:20pm UTC](https://discourse.julialang.org/t/how-to-define-a-formula-with-a-vector-of-string-names-for-glm-jl/44930 "2020-08-14T13:20:11Z")

</div>

I got a DataFrame that I wanted to fit a GLM model with but I would like to be able to build a formula (with hundreds of variables) programmatically without having to write it out by hand. So the best I can think of is v…

---

## [Question about Variable declarations](https://discourse.julialang.org/t/question-about-variable-declarations/44845)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 9\
**Last updated:** [August 14, 2020, 12:08pm UTC](https://discourse.julialang.org/t/question-about-variable-declarations/44845 "2020-08-14T12:08:20Z")

</div>

In the writing process of Julia function, we need to input n as the parameter,that is function abc(data,f,n,...).I have a data matrix, and I’m going to divide the data matrix into n parts according to index f,How do I d…

---

## [Base.Statistics -- I'm confused by the differences in arguments](https://discourse.julialang.org/t/base-statistics-im-confused-by-the-differences-in-arguments/44870)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 13\
**Last updated:** [August 14, 2020, 9:35am UTC](https://discourse.julialang.org/t/base-statistics-im-confused-by-the-differences-in-arguments/44870 "2020-08-14T09:35:48Z")

</div>

Suppose I have a number of experiments, say 5, each of which consist of a 2x3 matrix of data. I can either organize these in a 2x3x5 array A, C, or in a vector of 5 elements of 2x3 matrices (B). For illustration: # Orga…

---

## [Got \`Unreachable reached\` error while using IRTools](https://discourse.julialang.org/t/got-unreachable-reached-error-while-using-irtools/44860)

<div class="topic-metadata">

**Author:** [@KDr2](https://discourse.julialang.org/u/KDr2)\
**Replies:** 1\
**Last updated:** [August 14, 2020, 9:33am UTC](https://discourse.julialang.org/t/got-unreachable-reached-error-while-using-irtools/44860 "2020-08-14T09:33:33Z")

</div>

I am trying to run an example from the document of IRTools.jl, but when I run the modified IR, I got an Unreachable reached at 0x7ffad63e616d error: julia\> using IRTools julia\> f(x) = 3x + 2 f (generic function with 1 …

---

## [Macro scoping issue](https://discourse.julialang.org/t/macro-scoping-issue/44919)

<div class="topic-metadata">

**Author:** [@jagot](https://discourse.julialang.org/u/jagot)\
**Replies:** 2\
**Last updated:** [August 14, 2020, 8:25am UTC](https://discourse.julialang.org/t/macro-scoping-issue/44919 "2020-08-14T08:25:24Z")

</div>

I have a macro that provides a small DSL and then introduces a variable in the calling scope. I noticed under some circumstances it fails, here is a MWE: macro my\_macro(var, val) :($(esc(var)) = $(val)) end functio…

---

## [Computed parametric field types using assertions in \`getproperty\`](https://discourse.julialang.org/t/computed-parametric-field-types-using-assertions-in-getproperty/43865)

<div class="topic-metadata">

**Author:** [@mhauru](https://discourse.julialang.org/u/mhauru)\
**Replies:** 12\
**Last updated:** [August 14, 2020, 8:14am UTC](https://discourse.julialang.org/t/computed-parametric-field-types-using-assertions-in-getproperty/43865 "2020-08-14T08:14:51Z")

</div>

Quite often I have parametric types where the field types depend in some simple but non-trivial way on the type parameters. Something like struct Dada{N} a::Array{Float64, N} b::Array{Float64, N+1} end The abov…

---

## [Failed to precompile atom](https://discourse.julialang.org/t/failed-to-precompile-atom/44746)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 1\
**Last updated:** [August 14, 2020, 3:55am UTC](https://discourse.julialang.org/t/failed-to-precompile-atom/44746 "2020-08-14T03:55:53Z")

</div>

I was working with Julia on atom and suddenly I go this error message: LoadError: Failed to precompile Atom \[c52e3926-4ff0-5f6e-af25-54175e0327b1\] to C:\\Users\\mayar.madboly\\.julia\\compiled\\v1.4\\Atom\\w9XOh\_U5N9T.ji. W…

---

## [Equivalent of MATLAB's unwrap](https://discourse.julialang.org/t/equivalent-of-matlabs-unwrap/44882)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 6\
**Last updated:** [August 13, 2020, 7:22pm UTC](https://discourse.julialang.org/t/equivalent-of-matlabs-unwrap/44882 "2020-08-13T19:22:22Z")

</div>

Is there a Julia function that is equivalent to MATLAB’s unwrap? It is the function that shift angles by multiples of 2π to make them look distributed continuously.

---

## [More upgrade, more slow down?](https://discourse.julialang.org/t/more-upgrade-more-slow-down/44458)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 10\
**Last updated:** [August 13, 2020, 10:48pm UTC](https://discourse.julialang.org/t/more-upgrade-more-slow-down/44458 "2020-08-13T22:48:27Z")

</div>

Here is small benchmark code: using BenchmarkTools powersign(i) = ifelse(i % 2 == 0, 1, -1) function leibniz(n) s = 0 for i = 0:n s += powersign(i) / (2i + 1) end 4s end n = 10^5 @benchmark le…

---

## [Install IJulia for JupyterHub (multiple-user Jupyter)](https://discourse.julialang.org/t/install-ijulia-for-jupyterhub-multiple-user-jupyter/7432)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 10\
**Last updated:** [August 13, 2020, 8:30pm UTC](https://discourse.julialang.org/t/install-ijulia-for-jupyterhub-multiple-user-jupyter/7432 "2020-08-13T20:30:31Z")

</div>

Hello, I am trying to install a Julia (0.6) kernel for JupyterHub, the multi-user version of Jupyter. I already have JupyterHub working with Python3 and R kernels, I just need to add Julia. I did try (from Julia run as…

---

## [The birthday paradox: help to be faster than Fortran](https://discourse.julialang.org/t/the-birthday-paradox-help-to-be-faster-than-fortran/44809)

<div class="topic-metadata">

**Author:** [@profesor\_s](https://discourse.julialang.org/u/profesor_s)\
**Replies:** 16\
**Last updated:** [August 13, 2020, 7:06pm UTC](https://discourse.julialang.org/t/the-birthday-paradox-help-to-be-faster-than-fortran/44809 "2020-08-13T19:06:24Z")

</div>

Introduction I am not able to beat Fortran using Julia. This is the time spent by the algorithm using these two languages: Fortran 0m 42s Julia 4m 33s As you can see, Julia takes 6.5 times the time Fortran takes to s…

---

## [Is there a way to find out free disk space equivalent to psutil.disk\_usage('/') in python](https://discourse.julialang.org/t/is-there-a-way-to-find-out-free-disk-space-equivalent-to-psutil-disk-usage-in-python/16918)

<div class="topic-metadata">

**Author:** [@Ron\_Zaidman](https://discourse.julialang.org/u/Ron_Zaidman)\
**Replies:** 7\
**Last updated:** [August 13, 2020, 6:49pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-find-out-free-disk-space-equivalent-to-psutil-disk-usage-in-python/16918 "2020-08-13T18:49:44Z")

</div>

Is there a way to find out free disk space in drive C: both on windows and linux ? On python I would that by calling psutil.disk\_usage(‘C:’).free

---

## [How to add input type to boxplot but remain its plot attribute](https://discourse.julialang.org/t/how-to-add-input-type-to-boxplot-but-remain-its-plot-attribute/44883)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 0\
**Last updated:** [August 13, 2020, 3:50pm UTC](https://discourse.julialang.org/t/how-to-add-input-type-to-boxplot-but-remain-its-plot-attribute/44883 "2020-08-13T15:50:43Z")

</div>

Based on Oheil’s codes (StackOverflowError with boxplot!() due to deprecation - #6 by oheil), I wish to add other optional plot attributes like label, dpi etc. I’ve tried to include them in the input in a primitive way a…

---

## [StackOverflowError with boxplot!() due to deprecation](https://discourse.julialang.org/t/stackoverflowerror-with-boxplot-due-to-deprecation/44871)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 8\
**Last updated:** [August 13, 2020, 2:28pm UTC](https://discourse.julialang.org/t/stackoverflowerror-with-boxplot-due-to-deprecation/44871 "2020-08-13T14:28:29Z")

</div>

I’d like to have boxplot only considering non-missing data ignoring row informations. using StatsPlots a=\[ 0.000163187 0.000121895 0.000229244 6.98374e-6 missing missing missing missing …

---

## [Mmap access denied with SharedArrays](https://discourse.julialang.org/t/mmap-access-denied-with-sharedarrays/44881)

<div class="topic-metadata">

**Author:** [@mfariacastro](https://discourse.julialang.org/u/mfariacastro)\
**Replies:** 0\
**Last updated:** [August 13, 2020, 3:34pm UTC](https://discourse.julialang.org/t/mmap-access-denied-with-sharedarrays/44881 "2020-08-13T15:34:27Z")

</div>

I am running 1.5.0 on Windows. I keep running into an issue when creating a SharedArray. I am able to replicate the problem about 30% of the time. This is very annoying as it essentially means my code keeps crashing. Thi…

---

## [Can't install numpy using Pycall in Ubuntu](https://discourse.julialang.org/t/cant-install-numpy-using-pycall-in-ubuntu/44878)

<div class="topic-metadata">

**Author:** [@Riya\_Singh](https://discourse.julialang.org/u/Riya_Singh)\
**Replies:** 4\
**Last updated:** [August 13, 2020, 3:14pm UTC](https://discourse.julialang.org/t/cant-install-numpy-using-pycall-in-ubuntu/44878 "2020-08-13T15:14:23Z")

</div>

I can’t seem to understand the problem here can someone please help

---

## [Should I use Val(N) or Val{N}()?](https://discourse.julialang.org/t/should-i-use-val-n-or-val-n/44862)

<div class="topic-metadata">

**Author:** [@santiagobadia](https://discourse.julialang.org/u/santiagobadia)\
**Replies:** 3\
**Last updated:** [August 13, 2020, 2:28pm UTC](https://discourse.julialang.org/t/should-i-use-val-n-or-val-n/44862 "2020-08-13T14:28:16Z")

</div>

I wanted to ask whether I can safely use Val(N) instead of Val{N}(). In this example @code\_warntype Val(1) @code\_warntype Val{1}() in the REPL I get completely different outputs. The result is inferrable in the seco…

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

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