# General Usage

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

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

**Page:** 484

---

## [Is there a bug in package DataFramesMeta?](https://discourse.julialang.org/t/is-there-a-bug-in-package-dataframesmeta/76395)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 8\
**Last updated:** [February 14, 2022, 8:46am UTC](https://discourse.julialang.org/t/is-there-a-bug-in-package-dataframesmeta/76395 "2022-02-14T08:46:31Z")

</div>

Package DataFramesMeta looks very useful. I gave it a try and some things did not work. The following example, copied from \[Introduction · DataFramesMeta Documentation\], was tried in a new Julia session in an environment…

---

## [Calling Fortran functions that use MPI](https://discourse.julialang.org/t/calling-fortran-functions-that-use-mpi/76394)

<div class="topic-metadata">

**Author:** [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)\
**Replies:** 0\
**Last updated:** [February 14, 2022, 7:36am UTC](https://discourse.julialang.org/t/calling-fortran-functions-that-use-mpi/76394 "2022-02-14T07:36:47Z")

</div>

I have used ccall() a few times, but I wonder what I should do when the callee Fortran function uses MPI itself? Can MPI.jl work in this case?

---

## [Difference between SharedArrays and DistributedArrays](https://discourse.julialang.org/t/difference-between-sharedarrays-and-distributedarrays/60258)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 7\
**Last updated:** [February 14, 2022, 2:42am UTC](https://discourse.julialang.org/t/difference-between-sharedarrays-and-distributedarrays/60258 "2022-02-14T02:42:23Z")

</div>

Hello, I am struggling with understanding the difference between SharedArrays and DistributedArrays. I do not understand (I am pretty new to parallelism) what is meant by (from the documentation) Shared Arrays use sy…

---

## [Questions about directly executing a Pluto notebook](https://discourse.julialang.org/t/questions-about-directly-executing-a-pluto-notebook/76302)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 2\
**Last updated:** [February 13, 2022, 8:11pm UTC](https://discourse.julialang.org/t/questions-about-directly-executing-a-pluto-notebook/76302 "2022-02-13T20:11:47Z")

</div>

I have several Pluto notebooks. Sometimes I want to execute them directly in Julia rather than through the Pluto server. If the notebook uses the Pluto package manager, is there a single function I can call to run the …

---

## [Channel monitoring/statistics](https://discourse.julialang.org/t/channel-monitoring-statistics/53744)

<div class="topic-metadata">

**Author:** [@pmilovanov](https://discourse.julialang.org/u/pmilovanov)\
**Replies:** 3\
**Last updated:** [February 13, 2022, 6:53pm UTC](https://discourse.julialang.org/t/channel-monitoring-statistics/53744 "2022-02-13T18:53:05Z")

</div>

Before I reinvent the wheel, is there any conventional solution to track statistics on the state of channels during execution? E.g what’s the distribution of channel length over time (not size but items in channel) or di…

---

## [Curly brackets under x-axis portions - PyPlot](https://discourse.julialang.org/t/curly-brackets-under-x-axis-portions-pyplot/76361)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 0\
**Last updated:** [February 13, 2022, 5:31pm UTC](https://discourse.julialang.org/t/curly-brackets-under-x-axis-portions-pyplot/76361 "2022-02-13T17:31:23Z")

</div>

I am wondering how to add curly brackets under different portions of the x-axis using PyPlot. I would also like to attach a word to each of the curly brackets.

---

## [Tif operations find, crop and cluster](https://discourse.julialang.org/t/tif-operations-find-crop-and-cluster/76359)

<div class="topic-metadata">

**Author:** [@Hirnfolter1](https://discourse.julialang.org/u/Hirnfolter1)\
**Replies:** 0\
**Last updated:** [February 13, 2022, 5:23pm UTC](https://discourse.julialang.org/t/tif-operations-find-crop-and-cluster/76359 "2022-02-13T17:23:19Z")

</div>

Hello community, i am struggling with finding the right wayto work with tifs and julia. I have a with 1 bit depth and a size of 114701\*72067 pixels. The file is found on my onedrive (Microsoft OneDrive - Access files …

---

## [Data encoding in hdf5.jl](https://discourse.julialang.org/t/data-encoding-in-hdf5-jl/76357)

<div class="topic-metadata">

**Author:** [@RodrigoBruni](https://discourse.julialang.org/u/RodrigoBruni)\
**Replies:** 0\
**Last updated:** [February 13, 2022, 4:42pm UTC](https://discourse.julialang.org/t/data-encoding-in-hdf5-jl/76357 "2022-02-13T16:42:31Z")

</div>

Hi all, I have a tiny question involving hdf5.jl package. To be more specific, consider the following info related to a given .h5 file: DATASET "j" { DATATYPE H5T\_STD\_I64LE DATASPACE SIMPLE { ( 10 )…

---

## [Random number iterator?](https://discourse.julialang.org/t/random-number-iterator/76330)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 5\
**Last updated:** [February 13, 2022, 4:48pm UTC](https://discourse.julialang.org/t/random-number-iterator/76330 "2022-02-13T16:48:34Z")

</div>

Is it possible to get a random number iterator that doesn’t allocate? I was hoping I could do something like this: julia\> using Random julia\> sum(Iterators.take(MersenneTwister(0), 4)) ERROR: MethodError: no method mat…

---

## [CachePath.jl allows using PyCall with two libpythons and no recompilation](https://discourse.julialang.org/t/cachepath-jl-allows-using-pycall-with-two-libpythons-and-no-recompilation/76325)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 2\
**Last updated:** [February 13, 2022, 3:21pm UTC](https://discourse.julialang.org/t/cachepath-jl-allows-using-pycall-with-two-libpythons-and-no-recompilation/76325 "2022-02-13T15:21:10Z")

</div>

This package (unregistered) CachePath.jl allows you to specify a depot for saving and loading a single (or several) precompilation cache files (.ji files). This branch of PyCall.jl allows you to save the metadata on whi…

---

## [Apply function to tuple type parameters in a stable way](https://discourse.julialang.org/t/apply-function-to-tuple-type-parameters-in-a-stable-way/76335)

<div class="topic-metadata">

**Author:** [@lostella](https://discourse.julialang.org/u/lostella)\
**Replies:** 7\
**Last updated:** [February 13, 2022, 3:32pm UTC](https://discourse.julialang.org/t/apply-function-to-tuple-type-parameters-in-a-stable-way/76335 "2022-02-13T15:32:54Z")

</div>

I’d like to apply a function to all type parameters of any given tuple type. I don’t know the size of the tuples, I would just like to accumulate the function over all type parameters. However, I cannot find a way to do …

---

## [Failed to add package by https URL](https://discourse.julialang.org/t/failed-to-add-package-by-https-url/76436)

<div class="topic-metadata">

**Author:** [@likanzhan](https://discourse.julialang.org/u/likanzhan)\
**Replies:** 2\
**Last updated:** [February 13, 2022, 12:46pm UTC](https://discourse.julialang.org/t/failed-to-add-package-by-https-url/76436 "2022-02-13T12:46:54Z")

</div>

I got similar problems, such as (@v1.7) pkg\> add https://github.com/fonsp/Pluto.jl Cloning git-repo \`https://github.com/fonsp/Pluto.jl\` ERROR: failed to clone from https://github.com/fonsp/Pluto.jl, error: GitError…

---

## [Generating Weave documents using a Genie server](https://discourse.julialang.org/t/generating-weave-documents-using-a-genie-server/68617)

<div class="topic-metadata">

**Author:** [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)\
**Replies:** 1\
**Last updated:** [February 13, 2022, 10:30am UTC](https://discourse.julialang.org/t/generating-weave-documents-using-a-genie-server/68617 "2022-02-13T10:30:53Z")

</div>

I’m trying to run this weave example on a Genie.jl server. However, it seems to block for some reason and not progress at all after a point. To be precise, it blocks at this point. └ Web Server starting at http://127.0…

---

## [Converting bitstring to number](https://discourse.julialang.org/t/converting-bitstring-to-number/12199)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 14\
**Last updated:** [February 13, 2022, 8:35am UTC](https://discourse.julialang.org/t/converting-bitstring-to-number/12199 "2022-02-13T08:35:14Z")

</div>

I know that if I have a litteral bitstring, I can convert it to an integer with Int(0b110101) Now, however, I would like to convert a bit string, either given as a tuple of 0 and 1, or as an actual string, to the corre…

---

## [Suggestions for wrapping an Objective C or C++ class hierarchy?](https://discourse.julialang.org/t/suggestions-for-wrapping-an-objective-c-or-c-class-hierarchy/73050)

<div class="topic-metadata">

**Author:** [@RobertN](https://discourse.julialang.org/u/RobertN)\
**Replies:** 1\
**Last updated:** [February 13, 2022, 3:22am UTC](https://discourse.julialang.org/t/suggestions-for-wrapping-an-objective-c-or-c-class-hierarchy/73050 "2022-02-13T03:22:10Z")

</div>

I’m looking to wrap Apple’s Objective-C class hierarchy in AppKit. I’m reading the docs on calling C code, but it’s not obvious yet how to best wrap a class hierarchy. Any suggestions? Example type relations, from the O…

---

## ["Can't differentiate foreigncall expression" error while using Flux.train!](https://discourse.julialang.org/t/cant-differentiate-foreigncall-expression-error-while-using-flux-train/51828)

<div class="topic-metadata">

**Author:** [@amanjalan](https://discourse.julialang.org/u/amanjalan)\
**Replies:** 1\
**Last updated:** [February 13, 2022, 1:09am UTC](https://discourse.julialang.org/t/cant-differentiate-foreigncall-expression-error-while-using-flux-train/51828 "2022-02-13T01:09:49Z")

</div>

Hi, I am trying to implement a deep-learning based differential equation solver in Julia. I have implemented the model using custom layers and @functor. My loss function however uses Flux.pullback to compute first and s…

---

## [Categorical histogram](https://discourse.julialang.org/t/categorical-histogram/76323)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 0\
**Last updated:** [February 13, 2022, 12:32am UTC](https://discourse.julialang.org/t/categorical-histogram/76323 "2022-02-13T00:32:19Z")

</div>

How can I set the order of the groups? Julia tends to reshuffle them randomly. And how can I add a second row with a bracket and its own name to show that G1 and G2 are part of a subgroup called Gprime? ctg = repeat(\["C…

---

## [Find all the roots of a function in an interval](https://discourse.julialang.org/t/find-all-the-roots-of-a-function-in-an-interval/76271)

<div class="topic-metadata">

**Author:** [@Norbert-droid](https://discourse.julialang.org/u/Norbert-droid)\
**Replies:** 3\
**Last updated:** [February 12, 2022, 10:03pm UTC](https://discourse.julialang.org/t/find-all-the-roots-of-a-function-in-an-interval/76271 "2022-02-12T22:03:55Z")

</div>

I have a function of one variable, and I want to find all the roots in an interval. The roots are simple, and their derivative is different than cero. I want a function that accepts alike arguments the function and the i…

---

## [In a pipeline, interrupt only one command](https://discourse.julialang.org/t/in-a-pipeline-interrupt-only-one-command/76301)

<div class="topic-metadata">

**Author:** [@rfourquet](https://discourse.julialang.org/u/rfourquet)\
**Replies:** 2\
**Last updated:** [February 12, 2022, 9:09pm UTC](https://discourse.julialang.org/t/in-a-pipeline-interrupt-only-one-command/76301 "2022-02-12T21:09:33Z")

</div>

I need to pipe two programs, the first one can be interrupted only by sending a kill signal; how to kill it without killing the whole pipeline? For example how to interrupt yes in a moral equivalent of pipeline(\`yes\`, \`w…

---

## [Workflow for Contributing to Base](https://discourse.julialang.org/t/workflow-for-contributing-to-base/76312)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 5\
**Last updated:** [February 12, 2022, 7:26pm UTC](https://discourse.julialang.org/t/workflow-for-contributing-to-base/76312 "2022-02-12T19:26:56Z")

</div>

Hi! I’m trying to contribute to Base by making sort(x) print "Hello World" before returning the correct answer. Is there a good workflow without building Julia locally? (edited for concision)

---

## [Benchmarking function (using \`@benchmark\`) for various input sizes](https://discourse.julialang.org/t/benchmarking-function-using-benchmark-for-various-input-sizes/76306)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [February 12, 2022, 5:43pm UTC](https://discourse.julialang.org/t/benchmarking-function-using-benchmark-for-various-input-sizes/76306 "2022-02-12T17:43:14Z")

</div>

I have a function. I want to benchmark it for various inputs (originally I am solving a differential equations over various timespans). Naturally I would do something like: using BenchmarkTools bs = for l in \[10,100,10…

---

## [Is there a fast way to evaluate the exp() function in Julia?](https://discourse.julialang.org/t/is-there-a-fast-way-to-evaluate-the-exp-function-in-julia/76287)

<div class="topic-metadata">

**Author:** [@maphdze](https://discourse.julialang.org/u/maphdze)\
**Replies:** 8\
**Last updated:** [February 12, 2022, 12:25pm UTC](https://discourse.julialang.org/t/is-there-a-fast-way-to-evaluate-the-exp-function-in-julia/76287 "2022-02-12T12:25:41Z")

</div>

My code are shown in following using BenchmarkTools using StaticArrays const λ = 1.0E-6 @inline @fastmath function damage\_pair!(f,x,y,i,j,d) new\_d = 0.0 for idim = 1:2 new\_d += (x\[idim\] - y\[idim\]) ^ 2 …

---

## [Accelerate pairwise Lennard-Jones force computation](https://discourse.julialang.org/t/accelerate-pairwise-lennard-jones-force-computation/67321)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 87\
**Last updated:** [February 12, 2022, 10:03am UTC](https://discourse.julialang.org/t/accelerate-pairwise-lennard-jones-force-computation/67321 "2022-02-12T10:03:05Z")

</div>

Someone can see a chance of significantly accelerating this function? julia\> using StaticArrays, FastPow, BenchmarkTools julia\> function forces(x,y,d2,ε,σ,f) r = y - x @fastpow dudr = -12\*ε\*(σ^12/…

---

## [Is \`keyword\_argument = Val{true}\` good practice or an antipattern?](https://discourse.julialang.org/t/is-keyword-argument-val-true-good-practice-or-an-antipattern/75543)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 19\
**Last updated:** [February 12, 2022, 7:31am UTC](https://discourse.julialang.org/t/is-keyword-argument-val-true-good-practice-or-an-antipattern/75543 "2022-02-12T07:31:41Z")

</div>

I am seeing more and more library code that is written with keyword arguments of the form kwarg = Val{true} instead of kwarg = true or even kwarg::Bool = true. I know this is done in order to force specialization in prec…

---

## [Julia/Pkg manager and (Linux) OOM behaviour](https://discourse.julialang.org/t/julia-pkg-manager-and-linux-oom-behaviour/76273)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 4\
**Last updated:** [February 11, 2022, 11:10pm UTC](https://discourse.julialang.org/t/julia-pkg-manager-and-linux-oom-behaviour/76273 "2022-02-11T23:10:11Z")

</div>

Logan wrote a good blog post the other day about how Julia’s package manager is great, better than others, at least in the Python world. What I know happened for me, facts in A., Julia seemingly “crashed” as a result of…

---

## [More convenient way to develop dependent package?](https://discourse.julialang.org/t/more-convenient-way-to-develop-dependent-package/76206)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 8\
**Last updated:** [February 11, 2022, 6:53pm UTC](https://discourse.julialang.org/t/more-convenient-way-to-develop-dependent-package/76206 "2022-02-11T18:53:28Z")

</div>

I’ve run into this problem alot over the years, and finally figured I’d ask if there’s not a solution I’m missing. The setup is that I have some base package which I’m developing, call it BasePackage. Then I’m working o…

---

## [Using ArtifactUtils add\_artifact throws IOError](https://discourse.julialang.org/t/using-artifactutils-add-artifact-throws-ioerror/75568)

<div class="topic-metadata">

**Author:** [@wccarleton](https://discourse.julialang.org/u/wccarleton)\
**Replies:** 14\
**Last updated:** [February 11, 2022, 6:42pm UTC](https://discourse.julialang.org/t/using-artifactutils-add-artifact-throws-ioerror/75568 "2022-02-11T18:42:06Z")

</div>

Hi All, I’m trying to build a package that includes data as an Artifact. Following ArtifactUtils · Julia Packages, the following worked as indicated: using ArtifactUtils, Artifacts # Artifacts provides the artifact str…

---

## [Reducing allocations for long expressions](https://discourse.julialang.org/t/reducing-allocations-for-long-expressions/76263)

<div class="topic-metadata">

**Author:** [@xspeng](https://discourse.julialang.org/u/xspeng)\
**Replies:** 12\
**Last updated:** [February 11, 2022, 6:35pm UTC](https://discourse.julialang.org/t/reducing-allocations-for-long-expressions/76263 "2022-02-11T18:35:11Z")

</div>

Hi, I have a question about how to reduce the allocations for long expressions, here is my example function rel(a, b, c, f, delta, ZB, s, t0, y0) term = 0.0 for i = 1:length(s) term += s\[i\] \* (f\[1, 1\] \* …

---

## [UnicodePlots \`barplot\` with different colored bars](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979)

<div class="topic-metadata">

**Author:** [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Replies:** 4\
**Last updated:** [February 11, 2022, 5:51pm UTC](https://discourse.julialang.org/t/unicodeplots-barplot-with-different-colored-bars/75979 "2022-02-11T17:51:14Z")

</div>

Is it possible to stack multiple bar plots with different colored bars in one plot? For example, currently I have a function that returns three separate plots, but I think it would look better if I could combine them (e.…

---

## [Pmapreduce with the keyword argument "dims"](https://discourse.julialang.org/t/pmapreduce-with-the-keyword-argument-dims/76256)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 0\
**Last updated:** [February 11, 2022, 3:19pm UTC](https://discourse.julialang.org/t/pmapreduce-with-the-keyword-argument-dims/76256 "2022-02-11T15:19:29Z")

</div>

The function mapreduce(f, op, X; dims = dim) can be used, but it seems that the parallel analog pmapreduce from the package ParallelUtilities does not support the dims argument. How would one use simple parallel funct…

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

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