# General Usage

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

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

**Page:** 778

---

## [Plot.jl throws "broken pipe" after closing window with gr() backend](https://discourse.julialang.org/t/plot-jl-throws-broken-pipe-after-closing-window-with-gr-backend/35873)

<div class="topic-metadata">

**Author:** [@zierenberg](https://discourse.julialang.org/u/zierenberg)\
**Replies:** 6\
**Last updated:** [March 12, 2020, 7:07pm UTC](https://discourse.julialang.org/t/plot-jl-throws-broken-pipe-after-closing-window-with-gr-backend/35873 "2020-03-12T19:07:16Z")

</div>

Hi, I am wondering whether the following is a bug or an error in my installation. I use Plots.jl with the gr() backend and do the following MWE julia\> using Plots julia\> plot(rand(4,4)) then I close the QT window with…

---

## [How can I clear (i.e., not overlay) my plot in Atom?](https://discourse.julialang.org/t/how-can-i-clear-i-e-not-overlay-my-plot-in-atom/35861)

<div class="topic-metadata">

**Author:** [@Farhan\_Samir](https://discourse.julialang.org/u/Farhan_Samir)\
**Replies:** 2\
**Last updated:** [March 12, 2020, 2:59pm UTC](https://discourse.julialang.org/t/how-can-i-clear-i-e-not-overlay-my-plot-in-atom/35861 "2020-03-12T14:59:35Z")

</div>

If I understand correctly, using plot(...) as opposed to plot!(...) should replace the contents of the old plot with the new. I’m using the former to create plots but they seem to be overlayed for some reason, and I can’…

---

## [Help with type inference](https://discourse.julialang.org/t/help-with-type-inference/35753)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 17\
**Last updated:** [March 12, 2020, 2:25pm UTC](https://discourse.julialang.org/t/help-with-type-inference/35753 "2020-03-12T14:25:19Z")

</div>

I have an odd problem with type inference. I am writing an iterator which wraps a vector. The following is NOT an MWE as I cannot reproduce the error in a small example. However hopefully it can still lead to a solution. …

---

## [PackageCompiler for a beginner?](https://discourse.julialang.org/t/packagecompiler-for-a-beginner/35876)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 0\
**Last updated:** [March 12, 2020, 10:12am UTC](https://discourse.julialang.org/t/packagecompiler-for-a-beginner/35876 "2020-03-12T10:12:15Z")

</div>

Is it possible to have a simpler example of using PackageCompiler, addressed to the beginner? Let’s put ourselves in the shoes of him, for a moment. He is trying to use Julia, and we suppose he is very happy with it. H…

---

## [Performance of power as function input](https://discourse.julialang.org/t/performance-of-power-as-function-input/35852)

<div class="topic-metadata">

**Author:** [@MrUrq](https://discourse.julialang.org/u/MrUrq)\
**Replies:** 3\
**Last updated:** [March 12, 2020, 7:54am UTC](https://discourse.julialang.org/t/performance-of-power-as-function-input/35852 "2020-03-12T07:54:01Z")

</div>

Hi, I have a performance regression when including the power of a function as an input argument. I have boiled it down to something like this: function f1(X) n,d = size(X) dist = 0.0 for i = 2:n fo…

---

## [Unexpected allocations in looped vs broadcasted functions on tuples of arrays](https://discourse.julialang.org/t/unexpected-allocations-in-looped-vs-broadcasted-functions-on-tuples-of-arrays/35855)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 4\
**Last updated:** [March 12, 2020, 7:09am UTC](https://discourse.julialang.org/t/unexpected-allocations-in-looped-vs-broadcasted-functions-on-tuples-of-arrays/35855 "2020-03-12T07:09:53Z")

</div>

I have a function which operates on tuples of arrays using broadcasting, but I’m rewriting it because it doesn’t play well with ForwardDiff.jl. However, I’ve noticed that version which loops through array entries is slo…

---

## [Way to hide code in Weaved documents?](https://discourse.julialang.org/t/way-to-hide-code-in-weaved-documents/35380)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 6\
**Last updated:** [March 12, 2020, 5:38am UTC](https://discourse.julialang.org/t/way-to-hide-code-in-weaved-documents/35380 "2020-03-12T05:38:28Z")

</div>

In R, if I have a code that is only for technical stuff, like: library("zoo", lib.loc="C:/software/Rpackages") I can represent the same code as \` library("zoo", lib.loc="C:/software/Rpackages") \` and it won’t show up…

---

## [Bug in \`reverse!\`?](https://discourse.julialang.org/t/bug-in-reverse/35857)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 11\
**Last updated:** [March 12, 2020, 12:10am UTC](https://discourse.julialang.org/t/bug-in-reverse/35857 "2020-03-12T00:10:24Z")

</div>

we have julia\> reverse(1:1:2) 2:-1:1 but julia\> a=1:1:2 1:1:2 julia\> reverse!(a) ERROR: setindex! not defined for StepRange{Int64,Int64} Stacktrace: \[1\] error(::String, ::Type) at ./error.jl:42 \[2\] error\_if\_canonic…

---

## [Struct field alignment](https://discourse.julialang.org/t/struct-field-alignment/35856)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 0\
**Last updated:** [March 11, 2020, 10:45pm UTC](https://discourse.julialang.org/t/struct-field-alignment/35856 "2020-03-11T22:45:17Z")

</div>

I am creating a struct which is intended to be passed to C library function using ccall. The C definition uses an alignment attribute. I can use the @calign macro from the CBinding package, but this involves some unwan…

---

## [Create external command from string](https://discourse.julialang.org/t/create-external-command-from-string/17568)

<div class="topic-metadata">

**Author:** [@armstrtw](https://discourse.julialang.org/u/armstrtw)\
**Replies:** 9\
**Last updated:** [March 11, 2020, 10:15pm UTC](https://discourse.julialang.org/t/create-external-command-from-string/17568 "2020-03-11T22:15:21Z")

</div>

are backticks the only way to construct a command for the ‘run’ function: for example: julia\> cmd = “pwd”::String “pwd” julia\> run($cmd) /home/warmstrong Process(pwd, ProcessExited(0)) julia\> what is the \` func…

---

## [Adding HDF5: Tree Hash Mismatch! (A Docker-on-Windows problem; solved)](https://discourse.julialang.org/t/adding-hdf5-tree-hash-mismatch-a-docker-on-windows-problem-solved/35817)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 8\
**Last updated:** [March 11, 2020, 9:32pm UTC](https://discourse.julialang.org/t/adding-hdf5-tree-hash-mismatch-a-docker-on-windows-problem-solved/35817 "2020-03-11T21:32:08Z")

</div>

I’m running Julia v1.3.1 in Ubuntu and trying to \] add HDF5. I’m getting the following error: (sim) pkg\> add HDF5 Resolving package versions... ┌ Error: Tree Hash Mismatch! │ Expected git-tree-sha1: 7d43efbb6eaa156…

---

## [Best practice to unstack a dataframe with a lot of columnes?](https://discourse.julialang.org/t/best-practice-to-unstack-a-dataframe-with-a-lot-of-columnes/35851)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 5\
**Last updated:** [March 11, 2020, 9:01pm UTC](https://discourse.julialang.org/t/best-practice-to-unstack-a-dataframe-with-a-lot-of-columnes/35851 "2020-03-11T21:01:54Z")

</div>

so, unlike normal ordering (like what Italy CDC did, JHU people decided to put dates in column names. #first(df\_us, 3) State Country Lat Long 1/22/20 1/23/20 1/24/20 1/25/20 1/26/20 1/27/20 1/28/20 1/29/20 1/30/20 1/3…

---

## [Type stability using reduce](https://discourse.julialang.org/t/type-stability-using-reduce/35816)

<div class="topic-metadata">

**Author:** [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Replies:** 3\
**Last updated:** [March 11, 2020, 7:26pm UTC](https://discourse.julialang.org/t/type-stability-using-reduce/35816 "2020-03-11T19:26:25Z")

</div>

I’d like to better understand how to ensure type stability when applying a reduce operation on a collection. In the example below, the CrossProd type maintains a collection of objects that represent a “cross product”, wh…

---

## [Eval code in sandbox. Is it possible?](https://discourse.julialang.org/t/eval-code-in-sandbox-is-it-possible/35848)

<div class="topic-metadata">

**Author:** [@waralex](https://discourse.julialang.org/u/waralex)\
**Replies:** 0\
**Last updated:** [March 11, 2020, 6:33pm UTC](https://discourse.julialang.org/t/eval-code-in-sandbox-is-it-possible/35848 "2020-03-11T18:33:07Z")

</div>

Hi. Is there any way to eval third-party code with custom environment? For example, if I allow a user of a web interface to write custom Julia’s code to perform data conversion, and then execute this code on the serve…

---

## [MATLAB.jl connecting to named engine](https://discourse.julialang.org/t/matlab-jl-connecting-to-named-engine/35847)

<div class="topic-metadata">

**Author:** [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Replies:** 0\
**Last updated:** [March 11, 2020, 5:03pm UTC](https://discourse.julialang.org/t/matlab-jl-connecting-to-named-engine/35847 "2020-03-11T17:03:47Z")

</div>

The matlab.engine API for Python has a method connect\_matlab for connecting to an open, named MATLAB session, which is nice for passing variables back and forth between Python and MATLAB workspaces. I was wondering if an…

---

## [Converting an array of matrices into a gif](https://discourse.julialang.org/t/converting-an-array-of-matrices-into-a-gif/35741)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 5\
**Last updated:** [March 11, 2020, 2:38pm UTC](https://discourse.julialang.org/t/converting-an-array-of-matrices-into-a-gif/35741 "2020-03-11T14:38:07Z")

</div>

I have an array of 2d matrices and I would like to turn these into a gif. Each of the matrix has an entry from 1 to 8, denoting fixed states. I would like to specify a color for each state, so for example 1 is red, 2 is …

---

## [Zygote.jl and PackageCompiler.jl](https://discourse.julialang.org/t/zygote-jl-and-packagecompiler-jl/35839)

<div class="topic-metadata">

**Author:** [@Peter\_Adelman](https://discourse.julialang.org/u/Peter_Adelman)\
**Replies:** 4\
**Last updated:** [March 11, 2020, 2:17pm UTC](https://discourse.julialang.org/t/zygote-jl-and-packagecompiler-jl/35839 "2020-03-11T14:17:24Z")

</div>

I have been compiling my package for deployment using PackageCompilerX and now PackageCompiler, but recently I added some dependencies (including Zygote) and now it seems to dislike execution after compilation. Ubuntu …

---

## [Division isn't auto-vectorized when function inlined](https://discourse.julialang.org/t/division-isnt-auto-vectorized-when-function-inlined/35818)

<div class="topic-metadata">

**Author:** [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Replies:** 12\
**Last updated:** [March 11, 2020, 1:54pm UTC](https://discourse.julialang.org/t/division-isnt-auto-vectorized-when-function-inlined/35818 "2020-03-11T13:54:34Z")

</div>

I’m attempting to rewrite the benchmarks game spectralnorm implementation without relying on llvmcall for vectorization. I got close to the performance, but it requires awkwardly doing division in a helper function annot…

---

## [Installing personal packages that depend on other personal packages on Linux](https://discourse.julialang.org/t/installing-personal-packages-that-depend-on-other-personal-packages-on-linux/35832)

<div class="topic-metadata">

**Author:** [@cndesantana](https://discourse.julialang.org/u/cndesantana)\
**Replies:** 4\
**Last updated:** [March 11, 2020, 9:59am UTC](https://discourse.julialang.org/t/installing-personal-packages-that-depend-on-other-personal-packages-on-linux/35832 "2020-03-11T09:59:41Z")

</div>

Hi people, I have created 2 packages that are at my personal git repository. Package A depends on package B. However, when I try to install package A I get the following error message: Cloning git-repo \`https://cns…

---

## [Can I make this function even faster?](https://discourse.julialang.org/t/can-i-make-this-function-even-faster/35813)

<div class="topic-metadata">

**Author:** [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Replies:** 5\
**Last updated:** [March 10, 2020, 10:43pm UTC](https://discourse.julialang.org/t/can-i-make-this-function-even-faster/35813 "2020-03-10T22:43:38Z")

</div>

I have the following function which will be evaluated thousands of times in a for loop. This function will generate a vector. Each element in this vector is computed by some algebra of some elements in two different matr…

---

## [How to best tackle "Unsatisfiable requirements" type errors while adding packages?](https://discourse.julialang.org/t/how-to-best-tackle-unsatisfiable-requirements-type-errors-while-adding-packages/35803)

<div class="topic-metadata">

**Author:** [@bashonubuntu](https://discourse.julialang.org/u/bashonubuntu)\
**Replies:** 1\
**Last updated:** [March 10, 2020, 10:38pm UTC](https://discourse.julialang.org/t/how-to-best-tackle-unsatisfiable-requirements-type-errors-while-adding-packages/35803 "2020-03-10T22:38:28Z")

</div>

Hello all, This may be a simple issue for some but this is the first time I encountered something like this while adding packages on a fresh julia install. I tried upgrading to 1.3.1 yesterday from 1.2.0 and was getting…

---

## [BUG REPORT - Left Margin not working with Plots using PlotlyJS backend](https://discourse.julialang.org/t/bug-report-left-margin-not-working-with-plots-using-plotlyjs-backend/35808)

<div class="topic-metadata">

**Author:** [@jman87](https://discourse.julialang.org/u/jman87)\
**Replies:** 6\
**Last updated:** [March 10, 2020, 9:02pm UTC](https://discourse.julialang.org/t/bug-report-left-margin-not-working-with-plots-using-plotlyjs-backend/35808 "2020-03-10T21:02:56Z")

</div>

It appears that when using the Plots package with the PlotlyJS backend, the left margin does not operate correctly. Since the left and the bottom are where the Y and X axex reside, one would assume the margins should be…

---

## [Diff missing vs nothing](https://discourse.julialang.org/t/diff-missing-vs-nothing/35806)

<div class="topic-metadata">

**Author:** [@kimran](https://discourse.julialang.org/u/kimran)\
**Replies:** 1\
**Last updated:** [March 10, 2020, 6:22pm UTC](https://discourse.julialang.org/t/diff-missing-vs-nothing/35806 "2020-03-10T18:22:45Z")

</div>

What is the difference and the idea behind the difference? I saw somewhere that missing is for data and nothing for everything else. But why do we not just use either missing xor nothing for all null/missing values

---

## [I am very happy of Julia/Genie](https://discourse.julialang.org/t/i-am-very-happy-of-julia-genie/35804)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 0\
**Last updated:** [March 10, 2020, 5:39pm UTC](https://discourse.julialang.org/t/i-am-very-happy-of-julia-genie/35804 "2020-03-10T17:39:17Z")

</div>

I am very happy today. I bought a small 4 euro VPS per month: linux ubuntu 64, 1G of RAM, 20G of HD, 1 core. I installed Julia and Genie/JLD2 there (fastly and without problems). I copied my web app on this minimal se…

---

## [How can I improve the speed of large matrix multiplication](https://discourse.julialang.org/t/how-can-i-improve-the-speed-of-large-matrix-multiplication/35616)

<div class="topic-metadata">

**Author:** [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Replies:** 6\
**Last updated:** [March 10, 2020, 5:17pm UTC](https://discourse.julialang.org/t/how-can-i-improve-the-speed-of-large-matrix-multiplication/35616 "2020-03-10T17:17:28Z")

</div>

I have some functions involving large matrix multiplication in my code. A sample code is as follows. function foo1() temp = Array\[\] for i = 1:1000 push!(temp, randn(400,400)\*randn(400,1000)) end end …

---

## [Is there a newest TF.jl to support TensorFlow 2.0 and cuda 10.2?](https://discourse.julialang.org/t/is-there-a-newest-tf-jl-to-support-tensorflow-2-0-and-cuda-10-2/35787)

<div class="topic-metadata">

**Author:** [@Yan](https://discourse.julialang.org/u/Yan)\
**Replies:** 0\
**Last updated:** [March 10, 2020, 6:33am UTC](https://discourse.julialang.org/t/is-there-a-newest-tf-jl-to-support-tensorflow-2-0-and-cuda-10-2/35787 "2020-03-10T06:33:21Z")

</div>

Is there a newest TF.jl to support TensorFlow 2.0 and cuda 10.2 ? or any other Julia API solution targeting to tensorflow 2 like keras ? Oh, TF2 has already included tf.keras.

---

## [How to read in Julia a "pickled" numpy multiarray?](https://discourse.julialang.org/t/how-to-read-in-julia-a-pickled-numpy-multiarray/35791)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [March 10, 2020, 9:34am UTC](https://discourse.julialang.org/t/how-to-read-in-julia-a-pickled-numpy-multiarray/35791 "2020-03-10T09:34:53Z")

</div>

I am trying to port to Julia a Python exercise where however the first step is in reading some “pickled” data. If I open the file with a text file I notice it is a binary file with stamped “numpy.core.multiarray” on th…

---

## [Is there any replacement in Julia for ImageDataGenerator](https://discourse.julialang.org/t/is-there-any-replacement-in-julia-for-imagedatagenerator/35785)

<div class="topic-metadata">

**Author:** [@Eldho.Ashna](https://discourse.julialang.org/u/Eldho.Ashna)\
**Replies:** 8\
**Last updated:** [March 10, 2020, 8:45am UTC](https://discourse.julialang.org/t/is-there-any-replacement-in-julia-for-imagedatagenerator/35785 "2020-03-10T08:45:23Z")

</div>

Hi, I was trying to rewrite a python code of cat vs dog classification into julia. In the python code, I have the following: from keras.preprocessing.image import ImageDataGenerator # All images will be rescaled by 1.…

---

## [Matrix square root of known positive semi-definite matrix does not exist?](https://discourse.julialang.org/t/matrix-square-root-of-known-positive-semi-definite-matrix-does-not-exist/35766)

<div class="topic-metadata">

**Author:** [@torgo](https://discourse.julialang.org/u/torgo)\
**Replies:** 9\
**Last updated:** [March 9, 2020, 10:24pm UTC](https://discourse.julialang.org/t/matrix-square-root-of-known-positive-semi-definite-matrix-does-not-exist/35766 "2020-03-09T22:24:14Z")

</div>

In the following example, I believe that the matrix C should be positive semi-definite by construction. (Note that the matrix B is positive semi-definite.) As a consequence, it should have a unique positive semi-definit…

---

## [Strange codegen for type with small union fields](https://discourse.julialang.org/t/strange-codegen-for-type-with-small-union-fields/35773)

<div class="topic-metadata">

**Author:** [@Christian\_Rorvik](https://discourse.julialang.org/u/Christian_Rorvik)\
**Replies:** 0\
**Last updated:** [March 9, 2020, 9:43pm UTC](https://discourse.julialang.org/t/strange-codegen-for-type-with-small-union-fields/35773 "2020-03-09T21:43:00Z")

</div>

Context Working on an intrusive containers package, for users (like me) who need allocation free datastructures. Putting together the very beginnings of some expertiments I spotted some strange codegen behavior. Julia V…

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

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