# General Usage

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

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

**Page:** 757

---

## [What's the v1.4 equivalent of Pkg.METADATA\_compatible\_uuid?](https://discourse.julialang.org/t/whats-the-v1-4-equivalent-of-pkg-metadata-compatible-uuid/38911)

<div class="topic-metadata">

**Author:** [@chbian](https://discourse.julialang.org/u/chbian)\
**Replies:** 1\
**Last updated:** [May 6, 2020, 8:27pm UTC](https://discourse.julialang.org/t/whats-the-v1-4-equivalent-of-pkg-metadata-compatible-uuid/38911 "2020-05-06T20:27:15Z")

</div>

The function is no longer available under v1.4. Is there an equivalent function? Or what’s the best way to generate a METADATA compatible uuid? Thanks.

---

## [Help me understand constant propagation](https://discourse.julialang.org/t/help-me-understand-constant-propagation/38822)

<div class="topic-metadata">

**Author:** [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Replies:** 4\
**Last updated:** [May 6, 2020, 7:51pm UTC](https://discourse.julialang.org/t/help-me-understand-constant-propagation/38822 "2020-05-06T19:51:42Z")

</div>

Consider the following simple example. I have overloaded getindex and getproperty for MyType in the exact same way, but one allows constant propagation and the other doesn’t. I’m not even using x\[:c\] and x.c; I’m calling…

---

## [What triggers precompiling?](https://discourse.julialang.org/t/what-triggers-precompiling/38878)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 5\
**Last updated:** [May 6, 2020, 6:44pm UTC](https://discourse.julialang.org/t/what-triggers-precompiling/38878 "2020-05-06T18:44:34Z")

</div>

Sometimes I use a package with using ThePackage and it precompiles even if it was not updated since the last use, nor was Julia. Is there something I’m doing wrong such that precompiling is so often needed ?

---

## [Error in opening dataframe](https://discourse.julialang.org/t/error-in-opening-dataframe/38898)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 1\
**Last updated:** [May 6, 2020, 5:25pm UTC](https://discourse.julialang.org/t/error-in-opening-dataframe/38898 "2020-05-06T17:25:39Z")

</div>

Hello, I tried to open a dataframe that was generated in R; the dataframe is opened with libreoffice calc with no errors: julia\> df = CSV.read("/home/gigiux/Downloads/epiCurve/covidDataFrame.tsv", delim='\\t'…

---

## [Package works in regular Julia, but generates error when called using PyJulia -- relative path](https://discourse.julialang.org/t/package-works-in-regular-julia-but-generates-error-when-called-using-pyjulia-relative-path/38854)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 4\
**Last updated:** [May 6, 2020, 4:24pm UTC](https://discourse.julialang.org/t/package-works-in-regular-julia-but-generates-error-when-called-using-pyjulia-relative-path/38854 "2020-05-06T16:24:49Z")

</div>

Hey Folks, I was trying to figure out how to solve this this tricky issue. So I developed a package on my local machine and it works just fine. I have a CSV file saved in the package that I use to store some of the groun…

---

## [When to use a Dictionary versus a Struct in Julia?](https://discourse.julialang.org/t/when-to-use-a-dictionary-versus-a-struct-in-julia/38824)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 3\
**Last updated:** [May 6, 2020, 4:26pm UTC](https://discourse.julialang.org/t/when-to-use-a-dictionary-versus-a-struct-in-julia/38824 "2020-05-06T16:26:29Z")

</div>

I have been doing my best to exorcise some bad habits from the python world, like the common use of Dictionaries. As I understand Julia, Structs and namedtuples seem to perform a lot better because of the julia type syst…

---

## [Trying to make my robust logistic function differentiable as part of AD, getting errors so far](https://discourse.julialang.org/t/trying-to-make-my-robust-logistic-function-differentiable-as-part-of-ad-getting-errors-so-far/38838)

<div class="topic-metadata">

**Author:** [@HarrisonWilde](https://discourse.julialang.org/u/HarrisonWilde)\
**Replies:** 11\
**Last updated:** [May 6, 2020, 4:08pm UTC](https://discourse.julialang.org/t/trying-to-make-my-robust-logistic-function-differentiable-as-part-of-ad-getting-errors-so-far/38838 "2020-05-06T16:08:26Z")

</div>

I found that StatsFuns.logistic occasionally had issues with really extreme values and so have this more robust version of the logistic function defined as below: const LOGISTIC\_64 = log(Float64(1)/eps(Float64) - Float6…

---

## [Help understand inference problem](https://discourse.julialang.org/t/help-understand-inference-problem/38888)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [May 6, 2020, 2:33pm UTC](https://discourse.julialang.org/t/help-understand-inference-problem/38888 "2020-05-06T14:33:02Z")

</div>

in the MWE using StaticArrays flat\_outer\_product(f::F, a, b) where {F} = mapreduce(a -\> map(b -\> f(a, b), b), vcat, a) a = SVector(1, 2) b = SVector(2, 3) @code\_warntype flat\_outer\_product(SVector, a, b) # does not infe…

---

## [Determine if a directory or file is writable](https://discourse.julialang.org/t/determine-if-a-directory-or-file-is-writable/38843)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 6\
**Last updated:** [May 6, 2020, 11:55am UTC](https://discourse.julialang.org/t/determine-if-a-directory-or-file-is-writable/38843 "2020-05-06T11:55:20Z")

</div>

Ultimately what I would like to do is determine if a directory or file is writable by the current user. Looking at the Filesystem commands there is uperm(), gperm(), and operm() which at first blush look like exactly wh…

---

## [Math operation known issue? a^b](https://discourse.julialang.org/t/math-operation-known-issue-a-b/38839)

<div class="topic-metadata">

**Author:** [@Rougem](https://discourse.julialang.org/u/Rougem)\
**Replies:** 11\
**Last updated:** [May 6, 2020, 9:17am UTC](https://discourse.julialang.org/t/math-operation-known-issue-a-b/38839 "2020-05-06T09:17:20Z")

</div>

Today is my first day with Julia. While, working with the command line I realized that some results were negative and wrong. I am new, so if I made a mistake please let me know. What is wrong? Thanks a lot! Issue:

---

## [Collect an iterator into an SVector or Tuple](https://discourse.julialang.org/t/collect-an-iterator-into-an-svector-or-tuple/38812)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [May 6, 2020, 8:41am UTC](https://discourse.julialang.org/t/collect-an-iterator-into-an-svector-or-tuple/38812 "2020-05-06T08:41:42Z")

</div>

Is there a recommended idiom for collecting a number of elements (known at compile time, embedded in some type parameter) from an iterable into a Tuple or SVector? I can write a generated function and unroll, but I was …

---

## [Create a new DataFrame Column that is of Type Array{Int64,2}](https://discourse.julialang.org/t/create-a-new-dataframe-column-that-is-of-type-array-int64-2/38850)

<div class="topic-metadata">

**Author:** [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)\
**Replies:** 2\
**Last updated:** [May 6, 2020, 7:05am UTC](https://discourse.julialang.org/t/create-a-new-dataframe-column-that-is-of-type-array-int64-2/38850 "2020-05-06T07:05:05Z")

</div>

I need to track an Array{Int64.2} for each row in my data frame. The dimensions of the array are not standard across the rows. How do I instantiate that column before running through and filling it in later in my code?

---

## [Trying to read parquet file that is using Zstd codec](https://discourse.julialang.org/t/trying-to-read-parquet-file-that-is-using-zstd-codec/32657)

<div class="topic-metadata">

**Author:** [@ldsands](https://discourse.julialang.org/u/ldsands)\
**Replies:** 6\
**Last updated:** [May 6, 2020, 5:45am UTC](https://discourse.julialang.org/t/trying-to-read-parquet-file-that-is-using-zstd-codec/32657 "2020-05-06T05:45:26Z")

</div>

Hello everyone, I would like to read a parquet file into a Julia DataFrame. Unfortunately for my Julia skills (but fortunately for my hard drive) the codec used to compress the parquet file was zstd. I have played aroun…

---

## [Mutable struct versus Base.RefValue](https://discourse.julialang.org/t/mutable-struct-versus-base-refvalue/38743)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 3\
**Last updated:** [May 6, 2020, 4:49am UTC](https://discourse.julialang.org/t/mutable-struct-versus-base-refvalue/38743 "2020-05-06T04:49:11Z")

</div>

For structures that contain among other things a mutable scalar, I see (at least) two approaches: Make the structure mutable mutable struct S1 vector1::Vector{Float64} vector2::Vector{Float64} matrix::Matr…

---

## [\`varinfo()\` on a large SimpleGraph or DataFrame is prohibitively slow](https://discourse.julialang.org/t/varinfo-on-a-large-simplegraph-or-dataframe-is-prohibitively-slow/38851)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 0\
**Last updated:** [May 6, 2020, 12:53am UTC](https://discourse.julialang.org/t/varinfo-on-a-large-simplegraph-or-dataframe-is-prohibitively-slow/38851 "2020-05-06T00:53:53Z")

</div>

The only time I use varinfo is when I have a large object in memory and I want to know how much space it is taking. Unfortunately, in many scenarios varinfo runtime goes through the roof for large objects, so it’s imposs…

---

## [Help to remove type instability when using getproperty](https://discourse.julialang.org/t/help-to-remove-type-instability-when-using-getproperty/38849)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 6\
**Last updated:** [May 6, 2020, 12:33am UTC](https://discourse.julialang.org/t/help-to-remove-type-instability-when-using-getproperty/38849 "2020-05-06T00:33:39Z")

</div>

Hi! I have this structure: struct Workspace{T} x::Vector{T} s\_i::Vector{T} s\_b::Vector{T} end I would like to overload getproperty and getindex so that s.JD is x\[1\] and s.w is view(x,2:4). Following the sa…

---

## [Subtype of template parameter](https://discourse.julialang.org/t/subtype-of-template-parameter/38830)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 4\
**Last updated:** [May 5, 2020, 11:47pm UTC](https://discourse.julialang.org/t/subtype-of-template-parameter/38830 "2020-05-05T23:47:37Z")

</div>

Is there a way to implement something like the following: abstract type T1{T} \<: T end I’m creating a type which sometimes acts like a Real (and I want to use it in packages that require Real) and sometimes acts like \<:…

---

## [Failed to create file when running make on Cygwin64](https://discourse.julialang.org/t/failed-to-create-file-when-running-make-on-cygwin64/38802)

<div class="topic-metadata">

**Author:** [@Chen](https://discourse.julialang.org/u/Chen)\
**Replies:** 1\
**Last updated:** [May 5, 2020, 11:38pm UTC](https://discourse.julialang.org/t/failed-to-create-file-when-running-make-on-cygwin64/38802 "2020-05-05T23:38:59Z")

</div>

System: Cygwin64 under Windows 10 I cloned the git repository: git clone https://github.com/JuliaLang/julia.git Then I ran make: \`cd julia make\` I got the following error message: \` % Total % Received % Xferd Aver…

---

## [How to nest splicing contexts (i.e. @eval inside quote block)](https://discourse.julialang.org/t/how-to-nest-splicing-contexts-i-e-eval-inside-quote-block/38752)

<div class="topic-metadata">

**Author:** [@zachmatson](https://discourse.julialang.org/u/zachmatson)\
**Replies:** 5\
**Last updated:** [May 5, 2020, 10:33pm UTC](https://discourse.julialang.org/t/how-to-nest-splicing-contexts-i-e-eval-inside-quote-block/38752 "2020-05-05T22:33:59Z")

</div>

I am trying to make a macro that needs to evaluate an arbitrary (not known at parse time) amount of iterations of some code, which will change each time. I am trying to figure out how you would separately splice into the…

---

## [\`select not defined\` error whilst trying to plot a results DataFrame](https://discourse.julialang.org/t/select-not-defined-error-whilst-trying-to-plot-a-results-dataframe/38836)

<div class="topic-metadata">

**Author:** [@HarrisonWilde](https://discourse.julialang.org/u/HarrisonWilde)\
**Replies:** 0\
**Last updated:** [May 5, 2020, 9:36pm UTC](https://discourse.julialang.org/t/select-not-defined-error-whilst-trying-to-plot-a-results-dataframe/38836 "2020-05-05T21:36:27Z")

</div>

Hi, I wrote some code to plot the results of some experiments the other day, and it worked fine, then I must have changed something because I am now getting a rather strange error: ERROR: UndefVarError: select not defin…

---

## [Non standard Hamiltonian dynamics - need high accuracy](https://discourse.julialang.org/t/non-standard-hamiltonian-dynamics-need-high-accuracy/38811)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 10\
**Last updated:** [May 5, 2020, 8:41pm UTC](https://discourse.julialang.org/t/non-standard-hamiltonian-dynamics-need-high-accuracy/38811 "2020-05-05T20:41:22Z")

</div>

I am solving dynamical ODEs that describe a Hamiltonian dynamics. However, I have that \\dot{p}=f\_1(q,p,t), \\dot{q} = f\_2(q,p,t), which does not apply to the requirements of the symplectic solvers available (or maybe am I…

---

## [Copy of missing](https://discourse.julialang.org/t/copy-of-missing/38814)

<div class="topic-metadata">

**Author:** [@maarten\_van\_damme](https://discourse.julialang.org/u/maarten_van_damme)\
**Replies:** 2\
**Last updated:** [May 5, 2020, 4:15pm UTC](https://discourse.julialang.org/t/copy-of-missing/38814 "2020-05-05T16:15:33Z")

</div>

should copy(missing) be defined as missing? I have an array of objects that are either there or missing. I’d like to write copy.(data), but copy(missing) is undefined. Is there a simple reason why this is not defined

---

## [Error: variable inside a loop](https://discourse.julialang.org/t/error-variable-inside-a-loop/21504)

<div class="topic-metadata">

**Author:** [@raff](https://discourse.julialang.org/u/raff)\
**Replies:** 6\
**Last updated:** [May 5, 2020, 4:12pm UTC](https://discourse.julialang.org/t/error-variable-inside-a-loop/21504 "2020-05-05T16:12:08Z")

</div>

I do not understand why it’s an error: x = 0 while x \< 5 x += 1 println(x) end I am using Julia 1.1.0 on Windows. This is the error msg: ERROR: UndefVarError: x not defined Stacktrace: \[1\] top-level scope at …

---

## [How to enforce parametric types parameters in this case?](https://discourse.julialang.org/t/how-to-enforce-parametric-types-parameters-in-this-case/38815)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 1\
**Last updated:** [May 5, 2020, 3:47pm UTC](https://discourse.julialang.org/t/how-to-enforce-parametric-types-parameters-in-this-case/38815 "2020-05-05T15:47:21Z")

</div>

Hello. Since Normal{Float64} \<: UnivariateDistribution I would like to enforce that a Distribution field has a type parameter identical to the type of another field. Let me show you an example that does not work: using…

---

## [Flux, higher order derivatives and forward mode](https://discourse.julialang.org/t/flux-higher-order-derivatives-and-forward-mode/38805)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 4\
**Last updated:** [May 5, 2020, 3:23pm UTC](https://discourse.julialang.org/t/flux-higher-order-derivatives-and-forward-mode/38805 "2020-05-05T15:23:05Z")

</div>

I would like to minimize a functional that involves computing partial derivatives. As a toy problem, I want to find a function u(pt) that minimizes ∫ ∂ₓ(u)^2 So in this toy case any u that is constant along the x dire…

---

## [Difficulty figuring out when to use pmap, @sync, @async, @distributed](https://discourse.julialang.org/t/difficulty-figuring-out-when-to-use-pmap-sync-async-distributed/38794)

<div class="topic-metadata">

**Author:** [@JedPhillips](https://discourse.julialang.org/u/JedPhillips)\
**Replies:** 1\
**Last updated:** [May 5, 2020, 2:54pm UTC](https://discourse.julialang.org/t/difficulty-figuring-out-when-to-use-pmap-sync-async-distributed/38794 "2020-05-05T14:54:26Z")

</div>

I’m trying to optimize some code running in parallel. I’m struggling to figure out the best way to lay out this approach, and where to use pmap(), sync, async, distributed etc. I am applying a null model randomization t…

---

## [PyPlot fails on Mac](https://discourse.julialang.org/t/pyplot-fails-on-mac/38774)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 3\
**Last updated:** [May 5, 2020, 1:57pm UTC](https://discourse.julialang.org/t/pyplot-fails-on-mac/38774 "2020-05-05T13:57:41Z")

</div>

julia\> import PyPlot julia\> PyPlot.plot(rand(4)) 1-element Array{PyCall.PyObject,1}: PyObject \<matplotlib.lines.Line2D object at 0x7ff970b12da0\> julia\> PyPlot.savefig("a.png") ERROR: PyError ($(Expr(:escape, :(ccall(#…

---

## [Nondeterministic results for subset sum using @threads](https://discourse.julialang.org/t/nondeterministic-results-for-subset-sum-using-threads/38808)

<div class="topic-metadata">

**Author:** [@eaubanel](https://discourse.julialang.org/u/eaubanel)\
**Replies:** 3\
**Last updated:** [May 5, 2020, 1:37pm UTC](https://discourse.julialang.org/t/nondeterministic-results-for-subset-sum-using-threads/38808 "2020-05-05T13:37:40Z")

</div>

I’ve encountered nondeterministic results for a naive subset sum implementation using @threads. This algorithm fills the dynamic programming table column by column from left to right. There’s one column for each integer …

---

## [Multithreading cause segmentation error of deprecation warning](https://discourse.julialang.org/t/multithreading-cause-segmentation-error-of-deprecation-warning/38806)

<div class="topic-metadata">

**Author:** [@JiangXL](https://discourse.julialang.org/u/JiangXL)\
**Replies:** 1\
**Last updated:** [May 5, 2020, 1:24pm UTC](https://discourse.julialang.org/t/multithreading-cause-segmentation-error-of-deprecation-warning/38806 "2020-05-05T13:24:29Z")

</div>

Running following codes without --depwarn=no using Images img = rand(512,512); Threads.@threads for i in 1:200 edge,count=imhist(img) end causes Julia crash with different output, most useful should be: ┌ Err…

---

## [How to speed up creating a sparse matrix?](https://discourse.julialang.org/t/how-to-speed-up-creating-a-sparse-matrix/38800)

<div class="topic-metadata">

**Author:** [@lesshaste](https://discourse.julialang.org/u/lesshaste)\
**Replies:** 2\
**Last updated:** [May 5, 2020, 11:43am UTC](https://discourse.julialang.org/t/how-to-speed-up-creating-a-sparse-matrix/38800 "2020-05-05T11:43:23Z")

</div>

I am attempting to create a sparse matrix from an array of arrays called S . My code is this: function make\_matrix(nostates, S) M = spzeros(Int32, nostates, nostates) convert(SparseMatrixCSC{UInt32, UInt32}, M) …

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

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