# General Usage

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

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

**Page:** 852

---

## [Crashing shared arrays](https://discourse.julialang.org/t/crashing-shared-arrays/26174)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 5\
**Last updated:** [July 9, 2019, 4:36pm UTC](https://discourse.julialang.org/t/crashing-shared-arrays/26174 "2019-07-09T16:36:26Z")

</div>

I tried to fill a SharedArray using the @distributed macro but it keeps crashing. The MCE (Minimum Crashing Example) is shown below. Am I doing something wrong? using Distributed, SharedArrays const s = 10\_000 const …

---

## [Constant type but changing value](https://discourse.julialang.org/t/constant-type-but-changing-value/26125)

<div class="topic-metadata">

**Author:** [@Paul\_McVay](https://discourse.julialang.org/u/Paul_McVay)\
**Replies:** 5\
**Last updated:** [July 9, 2019, 11:42am UTC](https://discourse.julialang.org/t/constant-type-but-changing-value/26125 "2019-07-09T11:42:01Z")

</div>

Is it possible to create a constant type but changing value variable? For example, I would like to create a max variable and a call to a function increments the max value and returns the new max. The max variable needs t…

---

## [JuliaDBMeta/JuliaDB - How to select columns dynamically/programatically](https://discourse.julialang.org/t/juliadbmeta-juliadb-how-to-select-columns-dynamically-programatically/26082)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [July 9, 2019, 11:19am UTC](https://discourse.julialang.org/t/juliadbmeta-juliadb-how-to-select-columns-dynamically-programatically/26082 "2019-07-09T11:19:52Z")

</div>

I’ve been beating my head against the wall for hours on end trying to figure out how to avoid hard-coding column names in the below example (specifically, in the array comprehension wgts = \[sum(cols(Symbol("PWGTP$i"))) f…

---

## [Some unknown functions](https://discourse.julialang.org/t/some-unknown-functions/26153)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 1\
**Last updated:** [July 9, 2019, 2:19am UTC](https://discourse.julialang.org/t/some-unknown-functions/26153 "2019-07-09T02:19:07Z")

</div>

I am trying to understand a function of a code that i have, and there are some functions that i cannot explain , this is the function: Julia function op\_mat(op) op = op\[:as\_poly\](domain="C") op\_a = op.x\[:gens\] …

---

## [Plots.jl / GR: Specify colors for multiple series](https://discourse.julialang.org/t/plots-jl-gr-specify-colors-for-multiple-series/26144)

<div class="topic-metadata">

**Author:** [@srs](https://discourse.julialang.org/u/srs)\
**Replies:** 2\
**Last updated:** [July 8, 2019, 6:09pm UTC](https://discourse.julialang.org/t/plots-jl-gr-specify-colors-for-multiple-series/26144 "2019-07-08T18:09:03Z")

</div>

I want to plot two series and I want to specify a color for each of them. How do I do this? This code: plot(\[1:10, 2:11\], markershape=:circle, color=\[:red, :blue\]) Does not do what I want:

---

## [Surprising deserialization](https://discourse.julialang.org/t/surprising-deserialization/26119)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [July 8, 2019, 1:43pm UTC](https://discourse.julialang.org/t/surprising-deserialization/26119 "2019-07-08T13:43:36Z")

</div>

This is more of a heads up for people using de- and serialize from Serialization than anything else. It’s very clear that serialization isn’t meant to be used this way (see here), but thought it would be worth posting: u…

---

## [\`max\` and \`min\` of single dates](https://discourse.julialang.org/t/max-and-min-of-single-dates/26074)

<div class="topic-metadata">

**Author:** [@pfarndt](https://discourse.julialang.org/u/pfarndt)\
**Replies:** 3\
**Last updated:** [July 8, 2019, 1:18pm UTC](https://discourse.julialang.org/t/max-and-min-of-single-dates/26074 "2019-07-08T13:18:18Z")

</div>

I want aggregate dates and find the most recent date in a bunch of dates. For example I want to know the age of the youngest kid in a family. To do this I have to find the max of several dates. If there are a least two k…

---

## [What is this empty! function in Julia?](https://discourse.julialang.org/t/what-is-this-empty-function-in-julia/26132)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [July 8, 2019, 11:09am UTC](https://discourse.julialang.org/t/what-is-this-empty-function-in-julia/26132 "2019-07-08T11:09:50Z")

</div>

Hi, the following is the code, excepted from OpenStreetMap package. This interesting empty! function confuses me. type OSMattributes oneway::Bool oneway\_override::Bool oneway\_reverse::Bool visible::Bool …

---

## [Expose (document) \`Pkg.generate\` API for programmatic usage](https://discourse.julialang.org/t/expose-document-pkg-generate-api-for-programmatic-usage/26115)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 3\
**Last updated:** [July 8, 2019, 9:46am UTC](https://discourse.julialang.org/t/expose-document-pkg-generate-api-for-programmatic-usage/26115 "2019-07-08T09:46:12Z")

</div>

I don’t know if this is on the roadmap but I’d like to encourage documenting and exposing the Pkg.generate API for programmatic usage. Recently I’ve been working on adding a plugins interface for Genie, and part of it I …

---

## [A reverse! for CuArrays and Nd arrays](https://discourse.julialang.org/t/a-reverse-for-cuarrays-and-nd-arrays/24731)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 6\
**Last updated:** [July 8, 2019, 9:06am UTC](https://discourse.julialang.org/t/a-reverse-for-cuarrays-and-nd-arrays/24731 "2019-07-08T09:06:12Z")

</div>

Dear All, I have a 3d array V = zeros(N,N,N) and I would like to reverse it with respect to the last component. I achieve this by using the following function. This works well using CuArray (on master, see link) for A b…

---

## [Why does this nonbroadcast operation on Day vector give CompoundPeriod?](https://discourse.julialang.org/t/why-does-this-nonbroadcast-operation-on-day-vector-give-compoundperiod/26059)

<div class="topic-metadata">

**Author:** [@gajomi](https://discourse.julialang.org/u/gajomi)\
**Replies:** 1\
**Last updated:** [July 7, 2019, 3:37pm UTC](https://discourse.julialang.org/t/why-does-this-nonbroadcast-operation-on-day-vector-give-compoundperiod/26059 "2019-07-07T15:37:21Z")

</div>

I get different behavior on + and .+ in the following situation: \>foo = Day.(\[1653, 1618, 1505\]) \>baz = Day.(\[7, 7, 7\]) \>bing = foo.-baz \>bong = foo-baz \>typeof.(\[foo,baz,bing,bong\]) 4-element Array{DataType,1}: Array{…

---

## [What is the purpose of the following function?](https://discourse.julialang.org/t/what-is-the-purpose-of-the-following-function/26073)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [July 7, 2019, 3:39pm UTC](https://discourse.julialang.org/t/what-is-the-purpose-of-the-following-function/26073 "2019-07-07T15:39:20Z")

</div>

I’m reading the package OpenStreetMapX, and the following function confused me. ############################################# ### Find the Closest Point Within Bounds ### ############################################# …

---

## [Registered package files have different file permissions than non-registered](https://discourse.julialang.org/t/registered-package-files-have-different-file-permissions-than-non-registered/26111)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 2\
**Last updated:** [July 7, 2019, 12:43pm UTC](https://discourse.julialang.org/t/registered-package-files-have-different-file-permissions-than-non-registered/26111 "2019-07-07T12:43:55Z")

</div>

Genie.jl packs a series of template files for bootstrapping a new user app. These are bundled within the Genie.jl package and then copied and modified as part of generating a new user app. When using pkg\> add https://gi…

---

## [Strange allocations with default positional argument and static arrays](https://discourse.julialang.org/t/strange-allocations-with-default-positional-argument-and-static-arrays/26069)

<div class="topic-metadata">

**Author:** [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Replies:** 6\
**Last updated:** [July 7, 2019, 11:39am UTC](https://discourse.julialang.org/t/strange-allocations-with-default-positional-argument-and-static-arrays/26069 "2019-07-07T11:39:50Z")

</div>

I am wondering why the second and third version allocates. What am I missing here? \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | …

---

## [File chooser GUI?](https://discourse.julialang.org/t/file-chooser-gui/26090)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 2\
**Last updated:** [July 7, 2019, 10:35am UTC](https://discourse.julialang.org/t/file-chooser-gui/26090 "2019-07-07T10:35:04Z")

</div>

Forgive me if I have asked this question already. I commonly work in the REPL and like to test new packages to read various data formats - today DICOM format, as I used to work in medial imaging. You have to form a file…

---

## [\[ANN\] blog post benchmarking julia vs R Gaussian mixture models](https://discourse.julialang.org/t/ann-blog-post-benchmarking-julia-vs-r-gaussian-mixture-models/26071)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 2\
**Last updated:** [July 7, 2019, 6:49am UTC](https://discourse.julialang.org/t/ann-blog-post-benchmarking-julia-vs-r-gaussian-mixture-models/26071 "2019-07-07T06:49:09Z")

</div>

hi all! I wrote up a quick blog post on my first experiences with the GaussianMixtures.jl package by @davidavdav. My main alternative would be an R implementation, hence the benchmark is comparing 2 R with 2 julia imple…

---

## [Mean of array](https://discourse.julialang.org/t/mean-of-array/26081)

<div class="topic-metadata">

**Author:** [@erik\_michtich](https://discourse.julialang.org/u/erik_michtich)\
**Replies:** 3\
**Last updated:** [July 7, 2019, 4:33am UTC](https://discourse.julialang.org/t/mean-of-array/26081 "2019-07-07T04:33:30Z")

</div>

Hello, Unfortunately, i am a complete newbie to julia and need some help. I have an Array with pretty different point and should compute a straighter curve, probably of means. Does anybody know how i can do this, are th…

---

## [Check for element type inside a module (Images)](https://discourse.julialang.org/t/check-for-element-type-inside-a-module-images/26085)

<div class="topic-metadata">

**Author:** [@Amin\_Yahyaabadi](https://discourse.julialang.org/u/Amin_Yahyaabadi)\
**Replies:** 1\
**Last updated:** [July 7, 2019, 3:37am UTC](https://discourse.julialang.org/t/check-for-element-type-inside-a-module-images/26085 "2019-07-07T03:37:55Z")

</div>

I am trying to check the type of the elements of an image that is passed to a function which is inside a module. Consider I define img as follows: using Images img = colorview(Gray, array); Then inside the function in…

---

## [Base.contains?](https://discourse.julialang.org/t/base-contains/26084)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [July 7, 2019, 12:12am UTC](https://discourse.julialang.org/t/base-contains/26084 "2019-07-07T00:12:56Z")

</div>

What happened to Base.contains? What replaced it? I was using it to check whether a substring exists? Thanks

---

## [Reshape a 1-D array into an array of different-size arrays](https://discourse.julialang.org/t/reshape-a-1-d-array-into-an-array-of-different-size-arrays/25999)

<div class="topic-metadata">

**Author:** [@keeler](https://discourse.julialang.org/u/keeler)\
**Replies:** 7\
**Last updated:** [July 6, 2019, 10:48pm UTC](https://discourse.julialang.org/t/reshape-a-1-d-array-into-an-array-of-different-size-arrays/25999 "2019-07-06T22:48:01Z")

</div>

I have two vectors x and n of equal length, and I want to create an array of arrays y from x, where the lengths for the subarrays of y corresponds to the elements of n. For example, x=\[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8\] a…

---

## [Outer constructor method in Julia](https://discourse.julialang.org/t/outer-constructor-method-in-julia/25368)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [July 6, 2019, 9:30pm UTC](https://discourse.julialang.org/t/outer-constructor-method-in-julia/25368 "2019-07-06T21:30:10Z")

</div>

Hi, I’m a bit confused about the following outer constructor method call. mutable struct OSMData nodes::Dict{Int, OpenStreetMapX.LLA} ways::Vector{OpenStreetMapX.Way} relations::Vector{OpenStreet…

---

## [Package for Date/Time Interval boolean operators?](https://discourse.julialang.org/t/package-for-date-time-interval-boolean-operators/26053)

<div class="topic-metadata">

**Author:** [@cce](https://discourse.julialang.org/u/cce)\
**Replies:** 2\
**Last updated:** [July 6, 2019, 4:17pm UTC](https://discourse.julialang.org/t/package-for-date-time-interval-boolean-operators/26053 "2019-07-06T16:17:01Z")

</div>

Hello. I’m curious if anyone is working on interval operators, particularly regarding dates, and especially ones that match interval operators of the Clinical Quality Language. These operators include during (or inclu…

---

## [Get an array of modules that a module is using/importing](https://discourse.julialang.org/t/get-an-array-of-modules-that-a-module-is-using-importing/25946)

<div class="topic-metadata">

**Author:** [@vitreo12](https://discourse.julialang.org/u/vitreo12)\
**Replies:** 3\
**Last updated:** [July 6, 2019, 4:14am UTC](https://discourse.julialang.org/t/get-an-array-of-modules-that-a-module-is-using-importing/25946 "2019-07-06T04:14:42Z")

</div>

Hello everyone, I was wondering if there was a function that could allow me to inspect which modules a module is using. Does anyone know about it? I tried the propertynames and names functions, but they don’t seem to sh…

---

## [Status of SFML library](https://discourse.julialang.org/t/status-of-sfml-library/26060)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 2\
**Last updated:** [July 6, 2019, 1:24am UTC](https://discourse.julialang.org/t/status-of-sfml-library/26060 "2019-07-06T01:24:16Z")

</div>

I recently tried to add it and looks like it’s broken. I checked the issues list, and I couldn’t quite decipher what was going on. Thanks.

---

## [Julia \`make\` Problem](https://discourse.julialang.org/t/julia-make-problem/20741)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 1\
**Last updated:** [July 5, 2019, 9:09pm UTC](https://discourse.julialang.org/t/julia-make-problem/20741 "2019-07-05T21:09:27Z")

</div>

I compiled Julia many times without difficulties, but my latest attempt on a new HPC node failed: I believe this happens at the very end of the make process: LINK usr/lib/libjulia.so.0.6.4 CC ui/repl.o LINK …

---

## [JuliaDB Parallel/Distributed Computing](https://discourse.julialang.org/t/juliadb-parallel-distributed-computing/25991)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 13\
**Last updated:** [July 5, 2019, 6:23pm UTC](https://discourse.julialang.org/t/juliadb-parallel-distributed-computing/25991 "2019-07-05T18:23:42Z")

</div>

I’m trying to learn how to do distributed/parallel computing and I’m using JuliaDB and running into several issues that I don’t understand. First, I loaded 4 CSV files, each of which is 3GB - 4GB in size, like this: us…

---

## [Haskey function in Julia](https://discourse.julialang.org/t/haskey-function-in-julia/26047)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [July 5, 2019, 5:34pm UTC](https://discourse.julialang.org/t/haskey-function-in-julia/26047 "2019-07-05T17:34:08Z")

</div>

I am a bit confused by a small point of the following piece of code. function filter\_walkways(ways::Vector{OpenStreetMapX.Way}, classes::Dict{String, Int}=OpenStreetMapX.PEC\_CLASSES; levels::Set{Int} = Set(1:length(Open…

---

## [Isdefined function in Julia](https://discourse.julialang.org/t/isdefined-function-in-julia/26045)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [July 5, 2019, 4:13pm UTC](https://discourse.julialang.org/t/isdefined-function-in-julia/26045 "2019-07-05T16:13:16Z")

</div>

Hi, the following is the code from OpenStreetMapX GitHub, which confused me. extract\_highways(ways::Vector{OpenStreetMapX.Way}) = \[way for way in ways if isdefined(way, :tags) && haskey(way.tags, "highway")\] After sear…

---

## [Lyapunov exponents using ChaosTools and fortran radau solver](https://discourse.julialang.org/t/lyapunov-exponents-using-chaostools-and-fortran-radau-solver/26007)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 10\
**Last updated:** [July 5, 2019, 3:35pm UTC](https://discourse.julialang.org/t/lyapunov-exponents-using-chaostools-and-fortran-radau-solver/26007 "2019-07-05T15:35:33Z")

</div>

Hi, I am not sure if this is the right place to ask my question but I will try anyways. I want to calculate Lyapunov exponents of a very stiff ODE using the fortran radau solver from ODEInterfaceDiffEq. My setup looks …

---

## [StackOverflowError with locally defined function](https://discourse.julialang.org/t/stackoverflowerror-with-locally-defined-function/26040)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 4\
**Last updated:** [July 5, 2019, 3:07pm UTC](https://discourse.julialang.org/t/stackoverflowerror-with-locally-defined-function/26040 "2019-07-05T15:07:53Z")

</div>

function main() function sub() fun(f) = f return x -\> fun(x) end fun = sub() fun(1) end A call to main() results in a stack overflow. If sub() returned fun instead of x -\> fun(x) or the…

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

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