# General Usage

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

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

**Page:** 835

---

## [Efficient way to transform Array{Union{Missing,Float64}} to Array{Float64}?](https://discourse.julialang.org/t/efficient-way-to-transform-array-union-missing-float64-to-array-float64/22475)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 11\
**Last updated:** [September 6, 2019, 3:36am UTC](https://discourse.julialang.org/t/efficient-way-to-transform-array-union-missing-float64-to-array-float64/22475 "2019-09-06T03:36:18Z")

</div>

there is a way to transform an array x1 of Union{Missing,Float64} to an Array x2 of Float64 without allocating a new array? .x1 doesn’t containg missing values. an example: x1 = Array{Union{Missing,Float64}}(undef,3) fo…

---

## [Error when loading Distributions package for parallel computing](https://discourse.julialang.org/t/error-when-loading-distributions-package-for-parallel-computing/28437)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 3\
**Last updated:** [September 6, 2019, 3:03am UTC](https://discourse.julialang.org/t/error-when-loading-distributions-package-for-parallel-computing/28437 "2019-09-06T03:03:22Z")

</div>

I’m using parallel computing for some parts of my Julia code and for that, I need to load 2 packages: LinearAlgebra and Distributions. Concerning LinearAlgebra I run the following code and it works: using Distributed us…

---

## [Pkg: GtkTextUtils in manifest but not in project](https://discourse.julialang.org/t/pkg-gtktextutils-in-manifest-but-not-in-project/28447)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 0\
**Last updated:** [September 5, 2019, 11:19pm UTC](https://discourse.julialang.org/t/pkg-gtktextutils-in-manifest-but-not-in-project/28447 "2019-09-05T23:19:37Z")

</div>

When I try to install any package, I get the following error message: (v1.1) pkg\> add HTTP Updating registry at \`~/.julia/registries/General\` Updating git-repo \`https://github.com/JuliaRegistries/General.git\` Resol…

---

## [Arpack build issues](https://discourse.julialang.org/t/arpack-build-issues/27772)

<div class="topic-metadata">

**Author:** [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)\
**Replies:** 1\
**Last updated:** [September 5, 2019, 9:00pm UTC](https://discourse.julialang.org/t/arpack-build-issues/27772 "2019-09-05T21:00:00Z")

</div>

When building I get the following error message. I’m running 1.0.3 behind a firewall so updates are readily accessible, but if thats the root cause I can figure something out. Error: Error building 'Arpack': ERROR: Load…

---

## [\[Flux\]Trouble running examples from the Flux Differentiable control problems blogpost](https://discourse.julialang.org/t/flux-trouble-running-examples-from-the-flux-differentiable-control-problems-blogpost/28417)

<div class="topic-metadata">

**Author:** [@thvhauwe](https://discourse.julialang.org/u/thvhauwe)\
**Replies:** 2\
**Last updated:** [September 5, 2019, 7:21pm UTC](https://discourse.julialang.org/t/flux-trouble-running-examples-from-the-flux-differentiable-control-problems-blogpost/28417 "2019-09-05T19:21:06Z")

</div>

Hey there, Trying to replicate all the results and examples from the blogpost: https://fluxml.ai/2019/03/05/dp-vs-rl.html These are the steps that I used, as described in the README. Zygote trows an error. Running Juli…

---

## [Use of Memory-mapped I/O](https://discourse.julialang.org/t/use-of-memory-mapped-i-o/28311)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 9\
**Last updated:** [September 5, 2019, 5:55pm UTC](https://discourse.julialang.org/t/use-of-memory-mapped-i-o/28311 "2019-09-05T17:55:10Z")

</div>

I have a Julia code, version 1.2, which performs a lot of operations on a 10000 x 10000 Array . Due to OutOfMemory() error when I run the code, I’m exploring other options to run it, such as CUDA or Memory-mapping. Conce…

---

## [What's the expected behaviour when using vector as dict(hash) key?](https://discourse.julialang.org/t/whats-the-expected-behaviour-when-using-vector-as-dict-hash-key/28431)

<div class="topic-metadata">

**Author:** [@runapp](https://discourse.julialang.org/u/runapp)\
**Replies:** 5\
**Last updated:** [September 5, 2019, 5:15pm UTC](https://discourse.julialang.org/t/whats-the-expected-behaviour-when-using-vector-as-dict-hash-key/28431 "2019-09-05T17:15:08Z")

</div>

a,k=Dict(),\[1\] a\[k\]=1 k\[1\]=2 print(a," ",a\[k\]," ");print(a\[\[1\]\]," ");println(a\[\[2\]\]); a\[k\]=2 print(a," ",a\[k\]," ");print(a\[\[1\]\]," ");println(a\[\[2\]\]); What should we expect? Or should we completely forbids using vectors(…

---

## [How to create more helpful errors in nested interfaces](https://discourse.julialang.org/t/how-to-create-more-helpful-errors-in-nested-interfaces/28380)

<div class="topic-metadata">

**Author:** [@zsunberg](https://discourse.julialang.org/u/zsunberg)\
**Replies:** 6\
**Last updated:** [September 5, 2019, 4:06pm UTC](https://discourse.julialang.org/t/how-to-create-more-helpful-errors-in-nested-interfaces/28380 "2019-09-05T16:06:35Z")

</div>

Hi all, I am trying to throw more helpful errors in POMDPs.jl. This package has two nested interfaces. The explicit interface deals with explicit probability distributions; the generative interface samples from distribut…

---

## [Plot a 3D Grid when solving Partial differential Equations](https://discourse.julialang.org/t/plot-a-3d-grid-when-solving-partial-differential-equations/20636)

<div class="topic-metadata">

**Author:** [@Santiago\_Cuervo](https://discourse.julialang.org/u/Santiago_Cuervo)\
**Replies:** 3\
**Last updated:** [September 5, 2019, 3:06pm UTC](https://discourse.julialang.org/t/plot-a-3d-grid-when-solving-partial-differential-equations/20636 "2019-09-05T15:06:42Z")

</div>

I would like to plot a 3D grid in which each cell has different values of properties. This is to view the results of solving partial differential equations PDE. In octave I plotted with patch function thanks

---

## ["using" keyword in Julia](https://discourse.julialang.org/t/using-keyword-in-julia/28419)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 10\
**Last updated:** [September 5, 2019, 9:30am UTC](https://discourse.julialang.org/t/using-keyword-in-julia/28419 "2019-09-05T09:30:28Z")

</div>

I’m a bit confused about the “using” keyword in Julia. using OpenStreetMapX distance1(a::ECEF, b::ECEF) =.... The above code works. On the other hand, if inside of a module, say module myModule, module myModule using …

---

## [Updated StatsPlots and got error messages. How to fix?](https://discourse.julialang.org/t/updated-statsplots-and-got-error-messages-how-to-fix/28418)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 2\
**Last updated:** [September 5, 2019, 9:11am UTC](https://discourse.julialang.org/t/updated-statsplots-and-got-error-messages-how-to-fix/28418 "2019-09-05T09:11:11Z")

</div>

I just updated some package and got the following error messages. What can I do about it? Updating registry at \`C:\\Users\\Ilja\\.julia\\registries\\General\` Updating git-repo \`https://github.com/JuliaRegistries/General.gi…

---

## [Use of Vector Libraries](https://discourse.julialang.org/t/use-of-vector-libraries/28062)

<div class="topic-metadata">

**Author:** [@Crown421](https://discourse.julialang.org/u/Crown421)\
**Replies:** 5\
**Last updated:** [September 3, 2019, 11:57pm UTC](https://discourse.julialang.org/t/use-of-vector-libraries/28062 "2019-09-03T23:57:43Z")

</div>

Dear all, TLDR: Are bindings to external vector math libraries still a thing? I am still very new to Julia, but rapidly progressing in search of speed. In this quest I found and used AppleAccelerate to great success, …

---

## [Typing special characters in Plot legends and titles](https://discourse.julialang.org/t/typing-special-characters-in-plot-legends-and-titles/24771)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 11\
**Last updated:** [September 4, 2019, 8:48pm UTC](https://discourse.julialang.org/t/typing-special-characters-in-plot-legends-and-titles/24771 "2019-09-04T20:48:02Z")

</div>

I still didn’t find a practical way to type special characters in to a plot legend. In particular, I am trying to type an Angstrom (Å) character in an axis label. The situation is the following: In the REPL I can use t…

---

## [DifferentialEquations.jl FEM example](https://discourse.julialang.org/t/differentialequations-jl-fem-example/28128)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 31\
**Last updated:** [September 4, 2019, 5:28pm UTC](https://discourse.julialang.org/t/differentialequations-jl-fem-example/28128 "2019-09-04T17:28:58Z")

</div>

I want to solve a time-dependent PDE on a somewhat nontrivial geometry. As a step in this direction I am looking for an example how to solve a PDE using DifferentialEquations.jl + some FEM package. For instance, the heat…

---

## [Mark a thread as more important than other threads (with respect to \`sleep\`)?](https://discourse.julialang.org/t/mark-a-thread-as-more-important-than-other-threads-with-respect-to-sleep/28350)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 1\
**Last updated:** [September 4, 2019, 12:09pm UTC](https://discourse.julialang.org/t/mark-a-thread-as-more-important-than-other-threads-with-respect-to-sleep/28350 "2019-09-04T12:09:02Z")

</div>

I started using the following code pattern: my\_tasks = \[\] for i in my\_inputs task = @spawn my\_function(i) push!(my\_tasks, task) end while !all(istaskdone.(my\_tasks)) sleep(1) println("some progress mess…

---

## [Plotting 2 functions](https://discourse.julialang.org/t/plotting-2-functions/28348)

<div class="topic-metadata">

**Author:** [@Thalorn](https://discourse.julialang.org/u/Thalorn)\
**Replies:** 7\
**Last updated:** [September 4, 2019, 11:46am UTC](https://discourse.julialang.org/t/plotting-2-functions/28348 "2019-09-04T11:46:41Z")

</div>

Hi, Im trying to plot my Chebyshev approximation using Printf using Plots pyplot() mutable struct Cheb\_struct c::Vector{Float64} min::Float64 max::Float64 end function cheb\_coeff(min::Float64, max::Float64…

---

## [Clp in Julia version 1.2.0](https://discourse.julialang.org/t/clp-in-julia-version-1-2-0/28333)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 4\
**Last updated:** [September 4, 2019, 7:17am UTC](https://discourse.julialang.org/t/clp-in-julia-version-1-2-0/28333 "2019-09-04T07:17:07Z")

</div>

I got the following error when I have tried to install Clp in the environment Julia in Atom: (v1.2) pkg\> add Clp Updating registry at \`C:\\Users\\joyce.ramos-araujo\\.julia\\registries\\General\` Updating git-repo \`https:…

---

## [Problem to install JuMP 0.9 in Julia 1.2.0 : ERROR: failed to clone from “JuMP”,, error: GitError(Code:ERROR, Class:Net, unsupported URL protocol)](https://discourse.julialang.org/t/problem-to-install-jump-0-9-in-julia-1-2-0-error-failed-to-clone-from-jump-error-giterror-code-error-class-net-unsupported-url-protocol/28365)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 2\
**Last updated:** [September 4, 2019, 10:30am UTC](https://discourse.julialang.org/t/problem-to-install-jump-0-9-in-julia-1-2-0-error-failed-to-clone-from-jump-error-giterror-code-error-class-net-unsupported-url-protocol/28365 "2019-09-04T10:30:43Z")

</div>

I’m trying to migrate to Julia version \>1 but I’m struggling with packages versions. I have installed Julia 1.2.0 in Atom, I have added the pack JuMP but Clp is not working in the latest version of JuMP. So, I have trie…

---

## [Design advice](https://discourse.julialang.org/t/design-advice/28362)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 7\
**Last updated:** [September 4, 2019, 10:09am UTC](https://discourse.julialang.org/t/design-advice/28362 "2019-09-04T10:09:49Z")

</div>

Hi, I would like to hear some design advice. I want the user to pass two parameters to a function where the second parameter depends on the first one. However, for pratical reason, I dont want the user to write a compli…

---

## [Alternative to redefining a @generated function to observe (subsequently static) state](https://discourse.julialang.org/t/alternative-to-redefining-a-generated-function-to-observe-subsequently-static-state/28226)

<div class="topic-metadata">

**Author:** [@zsunberg](https://discourse.julialang.org/u/zsunberg)\
**Replies:** 8\
**Last updated:** [September 4, 2019, 5:50am UTC](https://discourse.julialang.org/t/alternative-to-redefining-a-generated-function-to-observe-subsequently-static-state/28226 "2019-09-04T05:50:30Z")

</div>

Brace yourselves - I am about to commit code to my package that calls eval to redefine a @generated function so that it can observe global state (that will normally not change after the redefinition). I actually think t…

---

## [PyPlot error and it crashes the REPL](https://discourse.julialang.org/t/pyplot-error-and-it-crashes-the-repl/23957)

<div class="topic-metadata">

**Author:** [@XavierG](https://discourse.julialang.org/u/XavierG)\
**Replies:** 3\
**Last updated:** [September 4, 2019, 1:06am UTC](https://discourse.julialang.org/t/pyplot-error-and-it-crashes-the-repl/23957 "2019-09-04T01:06:37Z")

</div>

Hi I installed my Julia ecosystem on a new macbook pro (with mojave 10.14.4 and Julia 1.1.0), and a crash occurs when any PyPlot (version installed: 2.8.1) command is executed. Hereafter an example when I execute the co…

---

## [Is \`rand()\` threadsafe?](https://discourse.julialang.org/t/is-rand-threadsafe/4683)

<div class="topic-metadata">

**Author:** [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Replies:** 13\
**Last updated:** [September 4, 2019, 12:02am UTC](https://discourse.julialang.org/t/is-rand-threadsafe/4683 "2019-09-04T00:02:42Z")

</div>

While it seems to work and the output looks sensible, I have this lingering suspicion that rand() is not threadsafe and that using it in a Thread.@threads loop is volatile. Browsing through base/random.jl and base/dSFMT…

---

## [Calling Julia compiled library from Python](https://discourse.julialang.org/t/calling-julia-compiled-library-from-python/18157)

<div class="topic-metadata">

**Author:** [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Replies:** 6\
**Last updated:** [September 3, 2019, 6:56pm UTC](https://discourse.julialang.org/t/calling-julia-compiled-library-from-python/18157 "2019-09-03T18:56:35Z")

</div>

As described in the blog post “” and implemented in PackageCompiler.jl, it is possible to compile Julia programs statically into a shared library. However, are there any examples of then calling this compiled library (.s…

---

## [!cat julia](https://discourse.julialang.org/t/cat-julia/28338)

<div class="topic-metadata">

**Author:** [@romeritomorais](https://discourse.julialang.org/u/romeritomorais)\
**Replies:** 1\
**Last updated:** [September 3, 2019, 5:54pm UTC](https://discourse.julialang.org/t/cat-julia/28338 "2019-09-03T17:54:00Z")

</div>

pandas we have the! cat where we can see the .csv before loading … julia has something similar

---

## [Puzzling reshape and push!](https://discourse.julialang.org/t/puzzling-reshape-and-push/28326)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 5\
**Last updated:** [September 3, 2019, 3:41pm UTC](https://discourse.julialang.org/t/puzzling-reshape-and-push/28326 "2019-09-03T15:41:27Z")

</div>

I find the following behavior puzzling. Start with: A = randn(5,5) x = reshape(A, 25) At this point, A and x point to the same memory block. Indeed: x\[1\] = 1.0 A\[1\] # returns 1.0 But now, since x is one-dimensional,…

---

## [How to inspect Type](https://discourse.julialang.org/t/how-to-inspect-type/28320)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 1\
**Last updated:** [September 3, 2019, 3:05pm UTC](https://discourse.julialang.org/t/how-to-inspect-type/28320 "2019-09-03T15:05:49Z")

</div>

Is there a simple way to find out where a type is defined and if it is only an alias for something more generic? Something like how @which works for methods. I’m now trying to understand the mesh, Face, Poin3f0, … from …

---

## [Does julia has a Package designed to / for sparse matrix](https://discourse.julialang.org/t/does-julia-has-a-package-designed-to-for-sparse-matrix/28315)

<div class="topic-metadata">

**Author:** [@Lyupinpin](https://discourse.julialang.org/u/Lyupinpin)\
**Replies:** 8\
**Last updated:** [September 3, 2019, 12:57pm UTC](https://discourse.julialang.org/t/does-julia-has-a-package-designed-to-for-sparse-matrix/28315 "2019-09-03T12:57:30Z")

</div>

I mean in solving Numerical PDE the matrix is usually quiet big but sparse. the normal “/” seems to use LU decomposition which makes a saprse matrix become two dense and will outofmemory qiuckly.

---

## [Updating environments](https://discourse.julialang.org/t/updating-environments/28274)

<div class="topic-metadata">

**Author:** [@bernardofpc](https://discourse.julialang.org/u/bernardofpc)\
**Replies:** 3\
**Last updated:** [September 3, 2019, 2:08pm UTC](https://discourse.julialang.org/t/updating-environments/28274 "2019-09-03T14:08:36Z")

</div>

I have written some Julia packages that depend on each other. To make it simple, suppose A.jl depends on B.jl. I have added B to my Project.toml and Manifest.toml files, and both packages (must) live on a private Git r…

---

## [Problem to use julia v0.7 in VS Code](https://discourse.julialang.org/t/problem-to-use-julia-v0-7-in-vs-code/28295)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 6\
**Last updated:** [September 3, 2019, 1:59pm UTC](https://discourse.julialang.org/t/problem-to-use-julia-v0-7-in-vs-code/28295 "2019-09-03T13:59:26Z")

</div>

I have installed julia v0.7 plug-in in VS Code but I got the following error when I tried to use it: Could not start the julia language server. Make sure the configuration setting julia.executablePath points to the juli…

---

## [Metaprogramming - Unpack/pack struct-fields based on symbols](https://discourse.julialang.org/t/metaprogramming-unpack-pack-struct-fields-based-on-symbols/28322)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 5\
**Last updated:** [September 3, 2019, 1:28pm UTC](https://discourse.julialang.org/t/metaprogramming-unpack-pack-struct-fields-based-on-symbols/28322 "2019-09-03T13:28:30Z")

</div>

Hi everyone, I would like pack/unpack (I am using the excellent Parameters package macros for this) specific fields of a struct within a function. I created example code here: using Parameters using Distributions #con…

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

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