# General Usage

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

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

**Page:** 711

---

## [CSV file reading Arrays as String in CSVFiles.jl and CSV.jl](https://discourse.julialang.org/t/csv-file-reading-arrays-as-string-in-csvfiles-jl-and-csv-jl/45331)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 4\
**Last updated:** [August 21, 2020, 11:01pm UTC](https://discourse.julialang.org/t/csv-file-reading-arrays-as-string-in-csvfiles-jl-and-csv-jl/45331 "2020-08-21T23:01:53Z")

</div>

I am trying to read a CSV file that has a column of Arrays. While reading it via CSVFiles.jl and CSV.jl the column of arrays are loaded as String. This is how that specific column values look like in the CSV File

---

## [Dictionary-like data structure representing a bijective map?](https://discourse.julialang.org/t/dictionary-like-data-structure-representing-a-bijective-map/45341)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 1\
**Last updated:** [August 21, 2020, 10:17pm UTC](https://discourse.julialang.org/t/dictionary-like-data-structure-representing-a-bijective-map/45341 "2020-08-21T22:17:10Z")

</div>

Does anyone know of a dictionary-like data structure that represents a bijective (one-to-one and onto) map? And if so, is there a Julia implementation of such a data structure? Ideally this data structure would have a m…

---

## [Was the path to Julia 1.5.0 eventually fixed?](https://discourse.julialang.org/t/was-the-path-to-julia-1-5-0-eventually-fixed/45338)

<div class="topic-metadata">

**Author:** [@reb](https://discourse.julialang.org/u/reb)\
**Replies:** 0\
**Last updated:** [August 21, 2020, 9:24pm UTC](https://discourse.julialang.org/t/was-the-path-to-julia-1-5-0-eventually-fixed/45338 "2020-08-21T21:24:57Z")

</div>

With the release of Julia 1.5.1 apparently imminent, I’d like to be sure that the path mistake made with 1.5.0 won’t be repeated in 1.5.1. When Julia 1.5.0 was first released, the path to Julia.exe included ‘Julia 1.5.0…

---

## [Can I alias an array element to a simple name like \`x\`?](https://discourse.julialang.org/t/can-i-alias-an-array-element-to-a-simple-name-like-x/45337)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 2\
**Last updated:** [August 21, 2020, 8:53pm UTC](https://discourse.julialang.org/t/can-i-alias-an-array-element-to-a-simple-name-like-x/45337 "2020-08-21T20:53:58Z")

</div>

I want to alias some array elements to simple variable names for readability: a = collect(700:710) alias b = a\[10\] # pseudocode alias c = a\[20\] b = 6 @assert a\[10\] == 6 How can I do this? The aliases can be only in the…

---

## [Adding external force RigidBodyDynamics mechansms](https://discourse.julialang.org/t/adding-external-force-rigidbodydynamics-mechansms/45233)

<div class="topic-metadata">

**Author:** [@\_dominic](https://discourse.julialang.org/u/_dominic)\
**Replies:** 5\
**Last updated:** [August 21, 2020, 8:44pm UTC](https://discourse.julialang.org/t/adding-external-force-rigidbodydynamics-mechansms/45233 "2020-08-21T20:44:19Z")

</div>

I am trying to figure out how to add an external force to a specific location on a rigid body. For example, From the pendulum example, I can add a point to the tip of the second link body = findbody(mechanism, "lower…

---

## [Non-negative ODE solution](https://discourse.julialang.org/t/non-negative-ode-solution/23449)

<div class="topic-metadata">

**Author:** [@dg.aragones](https://discourse.julialang.org/u/dg.aragones)\
**Replies:** 5\
**Last updated:** [August 21, 2020, 7:53pm UTC](https://discourse.julialang.org/t/non-negative-ode-solution/23449 "2020-08-21T19:53:36Z")

</div>

Is there any Julia option equivalent to “Nonnegative” in “odeset” in Matlab? Here is the documentation about the function I’m talking about: I think it’s a very useful function and it’d be nice to have something simi…

---

## [Usage of \`@eval\` in Base code when defining a NamedTuple constructor](https://discourse.julialang.org/t/usage-of-eval-in-base-code-when-defining-a-namedtuple-constructor/45328)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 5\
**Last updated:** [August 21, 2020, 6:52pm UTC](https://discourse.julialang.org/t/usage-of-eval-in-base-code-when-defining-a-namedtuple-constructor/45328 "2020-08-21T18:52:46Z")

</div>

Can anyone explain to me what is going on in this chunk of code from Base? @eval function NamedTuple{names,T}(args::Tuple) where {names, T \<: Tuple} if length(args) != length(names::Tuple) throw(ArgumentErro…

---

## [Plots colorbar doesn't scale with pgfplots backend](https://discourse.julialang.org/t/plots-colorbar-doesnt-scale-with-pgfplots-backend/45283)

<div class="topic-metadata">

**Author:** [@scone](https://discourse.julialang.org/u/scone)\
**Replies:** 2\
**Last updated:** [August 21, 2020, 6:06pm UTC](https://discourse.julialang.org/t/plots-colorbar-doesnt-scale-with-pgfplots-backend/45283 "2020-08-21T18:06:13Z")

</div>

Hello everyone, I just developed a new issue I wasn’t having before. I updated my packages a few days ago, and now when I scatterplot, the color bar is locked to the interval \[0,1\] for some reason. For example: usi…

---

## [Deep-equal](https://discourse.julialang.org/t/deep-equal/45315)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 7\
**Last updated:** [August 21, 2020, 3:37pm UTC](https://discourse.julialang.org/t/deep-equal/45315 "2020-08-21T15:37:25Z")

</div>

We have deepcopy, which recursively copies the object down to its “atoms”. Has anyone written the corresponding deepequal, such that deepequal(deepcopy(x), deepcopy(x)) == true?

---

## [Ordered arrays](https://discourse.julialang.org/t/ordered-arrays/45258)

<div class="topic-metadata">

**Author:** [@mamo](https://discourse.julialang.org/u/mamo)\
**Replies:** 4\
**Last updated:** [August 21, 2020, 11:55am UTC](https://discourse.julialang.org/t/ordered-arrays/45258 "2020-08-21T11:55:49Z")

</div>

If I have a Dict: P=Dict(“F1”=\>(“a30”, “a37”), “F2”=\>(“a10”, “a11”, “a12”), “F3”=\>(“a15”, “a22”, “a31”)) how to make it ordered - when it is used to be used by order - F1,F2,F3…? Thank you! Marco

---

## [ERROR: UndefVarError: Compiler not defined](https://discourse.julialang.org/t/error-undefvarerror-compiler-not-defined/45142)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 7\
**Last updated:** [August 21, 2020, 4:52am UTC](https://discourse.julialang.org/t/error-undefvarerror-compiler-not-defined/45142 "2020-08-21T04:52:49Z")

</div>

Hi all, I’m getting the following error: ERROR: UndefVarError: Compiler not defined Stacktrace: \[1\] collect\_to\_with\_first! at ./array.jl:689 \[inlined\] \[2\] collect(::Base.Generator{UnitRange{Int64},IGGen.var"#126#127"…

---

## [One trick to get to background-only threads](https://discourse.julialang.org/t/one-trick-to-get-to-background-only-threads/33175)

<div class="topic-metadata">

**Author:** [@tro3](https://discourse.julialang.org/u/tro3)\
**Replies:** 3\
**Last updated:** [August 21, 2020, 3:22am UTC](https://discourse.julialang.org/t/one-trick-to-get-to-background-only-threads/33175 "2020-08-21T03:22:19Z")

</div>

Currently in the v1.3(.1) threading implementation, tasks are assigned to a random thread, and that thread might be the primary thread. This can be problematic in a couple of use cases, for example a GUI that suddenly s…

---

## [RigidBodyDynamics visualization not working](https://discourse.julialang.org/t/rigidbodydynamics-visualization-not-working/45232)

<div class="topic-metadata">

**Author:** [@\_dominic](https://discourse.julialang.org/u/_dominic)\
**Replies:** 6\
**Last updated:** [August 21, 2020, 3:06am UTC](https://discourse.julialang.org/t/rigidbodydynamics-visualization-not-working/45232 "2020-08-21T03:06:45Z")

</div>

I am playing with the example from the RigidBodyDynamic.jl documentation with the MeshCatMechanisms.jl. No major changes. How do I get the last link to show? using RigidBodyDynamics using LinearAlgebra using StaticArra…

---

## [Importing SharedArray module](https://discourse.julialang.org/t/importing-sharedarray-module/44953)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 1\
**Last updated:** [August 21, 2020, 2:43am UTC](https://discourse.julialang.org/t/importing-sharedarray-module/44953 "2020-08-21T02:43:31Z")

</div>

I understand that we need @everywhere before any functions or modules that we want to make available to all the processes. My question is if need to have @everywhere before importing the SharedArrays module as well, i.e…

---

## [Blog Post: Ray Tracing Algebraic Surfaces](https://discourse.julialang.org/t/blog-post-ray-tracing-algebraic-surfaces/45298)

<div class="topic-metadata">

**Author:** [@philzook58](https://discourse.julialang.org/u/philzook58)\
**Replies:** 0\
**Last updated:** [August 21, 2020, 2:38am UTC](https://discourse.julialang.org/t/blog-post-ray-tracing-algebraic-surfaces/45298 "2020-08-21T02:38:58Z")

</div>

I had a fun idea for a blog post using the Julia polynomials ecosystem that I thought I’d share. Came out pretty cute I thought.

---

## [How to properly define a function with changeable parameters within a struct?](https://discourse.julialang.org/t/how-to-properly-define-a-function-with-changeable-parameters-within-a-struct/45292)

<div class="topic-metadata">

**Author:** [@RuckerC](https://discourse.julialang.org/u/RuckerC)\
**Replies:** 4\
**Last updated:** [August 21, 2020, 1:12am UTC](https://discourse.julialang.org/t/how-to-properly-define-a-function-with-changeable-parameters-within-a-struct/45292 "2020-08-21T01:12:51Z")

</div>

Is there a way to define a function within a struct such that the function depends on some of the other fields in the struct? For example, I currently have mutable struct Net a::Float64 b::Float64 f::Function end f…

---

## [Why sum of the measured times of each function is not equal to the total run time?](https://discourse.julialang.org/t/why-sum-of-the-measured-times-of-each-function-is-not-equal-to-the-total-run-time/45261)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 20\
**Last updated:** [August 21, 2020, 12:47am UTC](https://discourse.julialang.org/t/why-sum-of-the-measured-times-of-each-function-is-not-equal-to-the-total-run-time/45261 "2020-08-21T00:47:03Z")

</div>

Here is the code. I’m just providing the code to executed and observe the issue that I am talking about. A= sparse(\[0 1 0 1;1 0 1 0;0 1 0 0;1 0 0 0\]) sm\_vec = rand(4, 5) k = 3 function Filter(sm\_vec, k, A) @time …

---

## [Passing a pointer to struct of arrays and bitfields to ccall](https://discourse.julialang.org/t/passing-a-pointer-to-struct-of-arrays-and-bitfields-to-ccall/45254)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 11\
**Last updated:** [August 20, 2020, 2:10pm UTC](https://discourse.julialang.org/t/passing-a-pointer-to-struct-of-arrays-and-bitfields-to-ccall/45254 "2020-08-20T14:10:11Z")

</div>

I still can’t figure out memory layout of Julia data structures. I have: mutable struct Stimuli rgb::Array{UInt8, 1} depth::Array{Float32, 1} batteryLevel::Float32 end const N = 10^6 stimuli = Stimuli(zeros(UInt…

---

## [Unexpected behaviour for custom histogram limits in Gadfly](https://discourse.julialang.org/t/unexpected-behaviour-for-custom-histogram-limits-in-gadfly/45125)

<div class="topic-metadata">

**Author:** [@IMoronPirate](https://discourse.julialang.org/u/IMoronPirate)\
**Replies:** 2\
**Last updated:** [August 20, 2020, 7:40pm UTC](https://discourse.julialang.org/t/unexpected-behaviour-for-custom-histogram-limits-in-gadfly/45125 "2020-08-20T19:40:49Z")

</div>

If one plots the histogram of some data in Gadfly everything works fine. d = randn(250); plot(x=d, Geom.histogram(bincount=35)) However, providing the limits to plot the histogram of data between -5 and 0 plot(x=d,…

---

## [Processing Rows with multiple threads](https://discourse.julialang.org/t/processing-rows-with-multiple-threads/45253)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 6\
**Last updated:** [August 20, 2020, 2:36pm UTC](https://discourse.julialang.org/t/processing-rows-with-multiple-threads/45253 "2020-08-20T14:36:09Z")

</div>

I find myself having to process a lot of data recently where a) the processing of two different rows is independent and b) processing each row is expensive. I find myself coding a version of the following every time: us…

---

## [Orthotope grid type (generalization of AbstractRange)](https://discourse.julialang.org/t/orthotope-grid-type-generalization-of-abstractrange/45072)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 8\
**Last updated:** [August 20, 2020, 1:47pm UTC](https://discourse.julialang.org/t/orthotope-grid-type-generalization-of-abstractrange/45072 "2020-08-20T13:47:36Z")

</div>

So, I’ve found that in several separate packages I need something like an Orthotope type struct Orthotope{N,T} min::SVector{N,T} max::SVector{N,T} end Or in other words, a hyper-rectangle, specified by minimum …

---

## [Help needed fixing stack overflow](https://discourse.julialang.org/t/help-needed-fixing-stack-overflow/45134)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 14\
**Last updated:** [August 20, 2020, 12:21pm UTC](https://discourse.julialang.org/t/help-needed-fixing-stack-overflow/45134 "2020-08-20T12:21:17Z")

</div>

I have a composite type that I use to simplify xy and xyz vector operations. I use it instead of an array or a static array because it doesn’t rely on external packages and is fairly quick and allows me to easily overlo…

---

## [Solving Boundary Value Problems with Shooting() and DifferentialEquations.jl](https://discourse.julialang.org/t/solving-boundary-value-problems-with-shooting-and-differentialequations-jl/45265)

<div class="topic-metadata">

**Author:** [@Gregers](https://discourse.julialang.org/u/Gregers)\
**Replies:** 0\
**Last updated:** [August 20, 2020, 11:37am UTC](https://discourse.julialang.org/t/solving-boundary-value-problems-with-shooting-and-differentialequations-jl/45265 "2020-08-20T11:37:20Z")

</div>

Hey, Im trying to solve a Boundary Value Problems with Shooting() and DifferentialEquations.jl. My problem is formulated as this: This problem is an IVP with known initial values and has also a known analytical solu…

---

## [Distributed loading packages](https://discourse.julialang.org/t/distributed-loading-packages/45224)

<div class="topic-metadata">

**Author:** [@Joao\_Barata](https://discourse.julialang.org/u/Joao_Barata)\
**Replies:** 2\
**Last updated:** [August 20, 2020, 10:42am UTC](https://discourse.julialang.org/t/distributed-loading-packages/45224 "2020-08-20T10:42:57Z")

</div>

Hi, I’m trying to use distributed computing, but am running into some trouble with loading packages. Here is the MWE: module bogus\_module using Parameters, Distributed @with\_kw mutable struct cenas # …

---

## [Using Gradient Function from ForwardDiff with Structures](https://discourse.julialang.org/t/using-gradient-function-from-forwarddiff-with-structures/45188)

<div class="topic-metadata">

**Author:** [@smickus](https://discourse.julialang.org/u/smickus)\
**Replies:** 3\
**Last updated:** [August 20, 2020, 9:39am UTC](https://discourse.julialang.org/t/using-gradient-function-from-forwarddiff-with-structures/45188 "2020-08-20T09:39:01Z")

</div>

I am trying to use the gradient function from the ForwardDiff package with a function that has an input that is a structure. The issue that I am having is that I am unable to figure out how to have my function handle th…

---

## [Measuring and storing execution time in a variable](https://discourse.julialang.org/t/measuring-and-storing-execution-time-in-a-variable/45236)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 2\
**Last updated:** [August 20, 2020, 4:50am UTC](https://discourse.julialang.org/t/measuring-and-storing-execution-time-in-a-variable/45236 "2020-08-20T04:50:03Z")

</div>

I want to measure the time from the moment the code enters pmap and exit it. Also, I want to store it in a variable. So is there a way I can store the output of @time or is there a julia package that does it more efficie…

---

## [Make entire function constant fold](https://discourse.julialang.org/t/make-entire-function-constant-fold/45229)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 4\
**Last updated:** [August 19, 2020, 10:03pm UTC](https://discourse.julialang.org/t/make-entire-function-constant-fold/45229 "2020-08-19T22:03:27Z")

</div>

Right now, in BetterExp, I have code that looks like MAX\_EXP(::Val{2}, ::Type{Float64}) = 1024.0 # log2 2^1023\*(2-2^-52) MIN\_EXP(::Val{2}, ::Type{Float64}) = -1075.0 # log2 2^-1075…

---

## [Calling Reader from Various Directories](https://discourse.julialang.org/t/calling-reader-from-various-directories/45196)

<div class="topic-metadata">

**Author:** [@Holdmycoffee](https://discourse.julialang.org/u/Holdmycoffee)\
**Replies:** 3\
**Last updated:** [August 19, 2020, 9:06pm UTC](https://discourse.julialang.org/t/calling-reader-from-various-directories/45196 "2020-08-19T21:06:01Z")

</div>

Hi all, I have a function living in a local module, which reads some locally saved files in my package using an path: “src/folder1/…/myfile.txt”. Its purpose is solely to read and return the contents of the file. The pr…

---

## [Type stability when a branch can throw an exception](https://discourse.julialang.org/t/type-stability-when-a-branch-can-throw-an-exception/45223)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 1\
**Last updated:** [August 19, 2020, 9:04pm UTC](https://discourse.julialang.org/t/type-stability-when-a-branch-can-throw-an-exception/45223 "2020-08-19T21:04:26Z")

</div>

Is a function considered type stable if it has a branch that can throw an exception? Here’s an example: function foo(x::Int) if x \< 0 error("Oops.") else 2x end end @code\_warntype doesn’t se…

---

## [Multithreading with dynamic scheduler](https://discourse.julialang.org/t/multithreading-with-dynamic-scheduler/45187)

<div class="topic-metadata">

**Author:** [@lucas711642](https://discourse.julialang.org/u/lucas711642)\
**Replies:** 10\
**Last updated:** [August 19, 2020, 8:35pm UTC](https://discourse.julialang.org/t/multithreading-with-dynamic-scheduler/45187 "2020-08-19T20:35:31Z")

</div>

I have an expensive function that I need to evaluate for several inputs. To use multithreading, I usually use the following workflow: inputs = collect(deepcopy(input) for \_ = 1 : Threads.nthreads()) Threads.@threads for…

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

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