# General Usage

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

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

**Page:** 849

---

## [PyObjects as keys](https://discourse.julialang.org/t/pyobjects-as-keys/26521)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 2\
**Last updated:** [July 18, 2019, 10:07pm UTC](https://discourse.julialang.org/t/pyobjects-as-keys/26521 "2019-07-18T22:07:29Z")

</div>

As part of some work toward code generation from SymPy.jl, I need to map sympy functions to Julia functions. My current approach is a Dict: symfuncs = Dict( sympy.log =\> log , sympy.Pow =\> :^ , sympy.Abs =\>…

---

## [Indexing multidimensional arrays of arbitrary dimension](https://discourse.julialang.org/t/indexing-multidimensional-arrays-of-arbitrary-dimension/25728)

<div class="topic-metadata">

**Author:** [@hrchen](https://discourse.julialang.org/u/hrchen)\
**Replies:** 11\
**Last updated:** [June 26, 2019, 9:00pm UTC](https://discourse.julialang.org/t/indexing-multidimensional-arrays-of-arbitrary-dimension/25728 "2019-06-26T21:00:57Z")

</div>

I am writing a simulation that outputs a multidimensional array A that changes over time, and whose ndims depends on the input dimension (1 or 2 for now). I would like to save A over time in a larger array A\_t in my for-…

---

## [\`deepcopy(::Module)\` and mocking for tests](https://discourse.julialang.org/t/deepcopy-module-and-mocking-for-tests/24214)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 6\
**Last updated:** [July 18, 2019, 9:36pm UTC](https://discourse.julialang.org/t/deepcopy-module-and-mocking-for-tests/24214 "2019-07-18T21:36:42Z")

</div>

I have a crazy question/proposal. Currently, deepcopy isn’t defined for Modules: julia\> deepcopy(MyModule) ERROR: deepcopy of Modules not supported I think it might not be too hard to implement this. I wrote a somewha…

---

## [Bad performance using DistributedArray SPMD for 1D diffusion problem](https://discourse.julialang.org/t/bad-performance-using-distributedarray-spmd-for-1d-diffusion-problem/26443)

<div class="topic-metadata">

**Author:** [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Replies:** 2\
**Last updated:** [July 18, 2019, 9:12pm UTC](https://discourse.julialang.org/t/bad-performance-using-distributedarray-spmd-for-1d-diffusion-problem/26443 "2019-07-18T21:12:50Z")

</div>

Hi all, I am writing my first parallel program in Julia 1.1 using the SPMD feature in the DistributedArray package. However, I am nowhere closer to the serial performance, and the parallel scaling is not good neither. …

---

## [Y-tick placement on log scale](https://discourse.julialang.org/t/y-tick-placement-on-log-scale/26515)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 0\
**Last updated:** [July 18, 2019, 7:29pm UTC](https://discourse.julialang.org/t/y-tick-placement-on-log-scale/26515 "2019-07-18T19:29:36Z")

</div>

Hello, I’m hoping to get some advice on controlling y-tick placement on a log-log plot. I’m try to make the axis ticks on a plot bigger, and I’m running into this issue: Considering that I need to make the font that…

---

## [Saving an array of complex numbers](https://discourse.julialang.org/t/saving-an-array-of-complex-numbers/23653)

<div class="topic-metadata">

**Author:** [@M.Zahirul\_ALAM](https://discourse.julialang.org/u/M.Zahirul_ALAM)\
**Replies:** 15\
**Last updated:** [July 18, 2019, 7:09pm UTC](https://discourse.julialang.org/t/saving-an-array-of-complex-numbers/23653 "2019-07-18T19:09:00Z")

</div>

I haven’t been using Julia for a year now. And this morning I am struggling to save a two-dimensional array of complex numbers in a file in Julia so that I can open it up in Mathematica. What is the easiest way of doing …

---

## [Dependency on an un-registered fork](https://discourse.julialang.org/t/dependency-on-an-un-registered-fork/23132)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 3\
**Last updated:** [July 18, 2019, 6:59pm UTC](https://discourse.julialang.org/t/dependency-on-an-un-registered-fork/23132 "2019-07-18T18:59:06Z")

</div>

Hello, (short) I’m contributing to a package (say B) that depends upon a unregistered patched fork (fork/A) of a registered package (A). I’d like to make sure that if a user uses B, it uses fork/A and not A if by any c…

---

## [Segmentation fault trying to Fezzik.brute\_build\_julia() on: using Blink; w = Window()](https://discourse.julialang.org/t/segmentation-fault-trying-to-fezzik-brute-build-julia-on-using-blink-w-window/26491)

<div class="topic-metadata">

**Author:** [@KestutisMa](https://discourse.julialang.org/u/KestutisMa)\
**Replies:** 1\
**Last updated:** [July 18, 2019, 11:47am UTC](https://discourse.julialang.org/t/segmentation-fault-trying-to-fezzik-brute-build-julia-on-using-blink-w-window/26491 "2019-07-18T11:47:04Z")

</div>

Hi, I am trying to speed-up compilation of packages, PackageCompiler works nice, but current version uses all statements from package’s runtests.jl for creating precompiles. I think compiling only functions that I freque…

---

## [Printing user defined unsigned primitive typed](https://discourse.julialang.org/t/printing-user-defined-unsigned-primitive-typed/26467)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 3\
**Last updated:** [July 18, 2019, 11:28am UTC](https://discourse.julialang.org/t/printing-user-defined-unsigned-primitive-typed/26467 "2019-07-18T11:28:01Z")

</div>

Following the advice in this post I declared a user defined primitive type of 32 bits. This works when declared as a signed 32 bit integer: abstract type MyType \<: Signed end primitive type MyType32 \<: MyType 32 end My…

---

## [Modules VS Passing arguments to functions](https://discourse.julialang.org/t/modules-vs-passing-arguments-to-functions/26477)

<div class="topic-metadata">

**Author:** [@tiago](https://discourse.julialang.org/u/tiago)\
**Replies:** 5\
**Last updated:** [July 18, 2019, 11:03am UTC](https://discourse.julialang.org/t/modules-vs-passing-arguments-to-functions/26477 "2019-07-18T11:03:39Z")

</div>

Hello, I developed a numerical solver for a certain PDE. In these situations it’s quite normal to test the algorithm with several different examples and have many parameters, arrays and anonymous functions that I must …

---

## [Interactive plot, acting as a range slider tool for another plot?](https://discourse.julialang.org/t/interactive-plot-acting-as-a-range-slider-tool-for-another-plot/20392)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 18\
**Last updated:** [July 18, 2019, 7:34am UTC](https://discourse.julialang.org/t/interactive-plot-acting-as-a-range-slider-tool-for-another-plot/20392 "2019-07-18T07:34:27Z")

</div>

How can I get in Julia an interactive plot with range slider for another plot? Something like this (but not necessary with the same data on both plots): https://bokeh.pydata.org/en/latest/docs/gallery/range\_tool.html …

---

## [Fast Robust Predicates for Computational Geometry: Something in Julia?](https://discourse.julialang.org/t/fast-robust-predicates-for-computational-geometry-something-in-julia/5807)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 6\
**Last updated:** [July 18, 2019, 1:25am UTC](https://discourse.julialang.org/t/fast-robust-predicates-for-computational-geometry-something-in-julia/5807 "2019-07-18T01:25:49Z")

</div>

Hello all, I am doing a lot of computations for a package (DynamicalBilliards.jl) where I very often compute dot products, differences, multiplications and sums of floating point numbers that are very small (order of 1e…

---

## [Problems with Diagonal from LinearAlgebra](https://discourse.julialang.org/t/problems-with-diagonal-from-linearalgebra/26429)

<div class="topic-metadata">

**Author:** [@cholt](https://discourse.julialang.org/u/cholt)\
**Replies:** 11\
**Last updated:** [July 17, 2019, 7:55pm UTC](https://discourse.julialang.org/t/problems-with-diagonal-from-linearalgebra/26429 "2019-07-17T19:55:06Z")

</div>

I have been using the Diagonal function to take a vector array and produce a matrix with entries of the vector along the diagonal. It used to work fine but now instead of producing a matrix with entries along the diagona…

---

## [Bumping \`Project.toml\` version number after tag](https://discourse.julialang.org/t/bumping-project-toml-version-number-after-tag/26471)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 8\
**Last updated:** [July 17, 2019, 7:27pm UTC](https://discourse.julialang.org/t/bumping-project-toml-version-number-after-tag/26471 "2019-07-17T19:27:55Z")

</div>

This is a really trivial thing, but I’ve yet to find a really good workflow for it. I always forget to go into my Project.toml and bump the version number of my package after I make a tag. Worse, sometimes I make a tag…

---

## [Pre-allocating output array for ArrayFire.jl function](https://discourse.julialang.org/t/pre-allocating-output-array-for-arrayfire-jl-function/26472)

<div class="topic-metadata">

**Author:** [@Josiah\_Slack](https://discourse.julialang.org/u/Josiah_Slack)\
**Replies:** 2\
**Last updated:** [July 17, 2019, 7:04pm UTC](https://discourse.julialang.org/t/pre-allocating-output-array-for-arrayfire-jl-function/26472 "2019-07-17T19:04:30Z")

</div>

I have a use case where it would helpful if I could allocate a cuda array prior to calling, say cholesky(), which would then be filled by the called function. Is there a straightforward way of doing this?

---

## [ForwardDiff - Multiple gradient evaluations at once?](https://discourse.julialang.org/t/forwarddiff-multiple-gradient-evaluations-at-once/26473)

<div class="topic-metadata">

**Author:** [@LudiWin](https://discourse.julialang.org/u/LudiWin)\
**Replies:** 8\
**Last updated:** [July 17, 2019, 6:59pm UTC](https://discourse.julialang.org/t/forwarddiff-multiple-gradient-evaluations-at-once/26473 "2019-07-17T18:59:20Z")

</div>

Hi, so I’m fairly new to Julia coming from Python. I was playing around with the ForwardDiff package and stumbled upon the following ‘problem’: A 2-D Gaussian from the Distributions package can take a matrix of size =…

---

## [CSV ruins scientific notation](https://discourse.julialang.org/t/csv-ruins-scientific-notation/25835)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 10\
**Last updated:** [July 17, 2019, 5:52pm UTC](https://discourse.julialang.org/t/csv-ruins-scientific-notation/25835 "2019-07-17T17:52:41Z")

</div>

I think it’s a bug in CSV but I’m not 100% sure that’s why I ask here first: I wrote some code to convert a txt file into a csv file (basically adding a header and commata). My code: fname = input\_name = split(split(t…

---

## [New behaviour due to an update of the package CSV when using CSV.write](https://discourse.julialang.org/t/new-behaviour-due-to-an-update-of-the-package-csv-when-using-csv-write/26442)

<div class="topic-metadata">

**Author:** [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Replies:** 7\
**Last updated:** [July 17, 2019, 1:02pm UTC](https://discourse.julialang.org/t/new-behaviour-due-to-an-update-of-the-package-csv-when-using-csv-write/26442 "2019-07-17T13:02:29Z")

</div>

Hello, When I use the code using CSV using DataFrames rm("tmp.csv",force=true) df=DataFrame(\[Float64 for k in 1:1\],\[Symbol("ps\_prev\_$k") for k in 1:1\],0); push!(df,1000.0) CSV.write("tmp.csv",df,delim=';', append=true,…

---

## [Strange allocation](https://discourse.julialang.org/t/strange-allocation/26462)

<div class="topic-metadata">

**Author:** [@TheBB](https://discourse.julialang.org/u/TheBB)\
**Replies:** 2\
**Last updated:** [July 17, 2019, 3:31pm UTC](https://discourse.julialang.org/t/strange-allocation/26462 "2019-07-17T15:31:37Z")

</div>

I’m writing a type to represent an affine transformation (y=Ax+b), using static arrays. Here’s the code using BenchmarkTools using StaticArrays struct Affine{F, T, R} matrix :: SMatrix{T, F, R} vector :: SVecto…

---

## [Cxx.jl calling the Julia error function from C++](https://discourse.julialang.org/t/cxx-jl-calling-the-julia-error-function-from-c/26449)

<div class="topic-metadata">

**Author:** [@ethomag](https://discourse.julialang.org/u/ethomag)\
**Replies:** 1\
**Last updated:** [July 17, 2019, 1:05pm UTC](https://discourse.julialang.org/t/cxx-jl-calling-the-julia-error-function-from-c/26449 "2019-07-17T13:05:03Z")

</div>

I am trying to propagate an error from C++ to Julia. From the Cxx.jl documentation, I found (which works fine): julia\> cxx"“” void testJuliaPrint() { $:(println(“\\nTo end this test, press any key”)::Nothing); } “…

---

## [Unusually bad performance of eigen() compared to eig() in Matlab](https://discourse.julialang.org/t/unusually-bad-performance-of-eigen-compared-to-eig-in-matlab/26433)

<div class="topic-metadata">

**Author:** [@doit](https://discourse.julialang.org/u/doit)\
**Replies:** 16\
**Last updated:** [July 17, 2019, 11:19am UTC](https://discourse.julialang.org/t/unusually-bad-performance-of-eigen-compared-to-eig-in-matlab/26433 "2019-07-17T11:19:35Z")

</div>

Hello everyone, I’m fairly new to Julia. I am working on implementing SBFEM in Julia. SBFEM requires solving a lot of eigenvalue problems. I noticed that my code in Matlab is running much (much) faster than in Julia. I …

---

## [Error compiling PyCall](https://discourse.julialang.org/t/error-compiling-pycall/26415)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 4\
**Last updated:** [July 17, 2019, 10:41am UTC](https://discourse.julialang.org/t/error-compiling-pycall/26415 "2019-07-17T10:41:45Z")

</div>

Hi guys, I am trying to get started with Matplotlib. My environment is versioninfo versioninfo (generic function with 2 methods) julia\> versioninfo() Julia Version 1.1.0 Commit 80516ca202 (2019-01-21 21:24 UTC) Platf…

---

## [What does this mean: "Entropy pool not available to seed RNG; using ad-hoc entropy sources"?](https://discourse.julialang.org/t/what-does-this-mean-entropy-pool-not-available-to-seed-rng-using-ad-hoc-entropy-sources/26432)

<div class="topic-metadata">

**Author:** [@Akon](https://discourse.julialang.org/u/Akon)\
**Replies:** 4\
**Last updated:** [July 17, 2019, 2:09am UTC](https://discourse.julialang.org/t/what-does-this-mean-entropy-pool-not-available-to-seed-rng-using-ad-hoc-entropy-sources/26432 "2019-07-17T02:09:58Z")

</div>

I am trying to use a package (Laplacians: https://github.com/danspielman/Laplacians.jl) with Julia- v1.0.4. However, I get the following message(error) when I use it: “Entropy pool not available to seed RNG; using ad-ho…

---

## [Cuda - run code with list](https://discourse.julialang.org/t/cuda-run-code-with-list/26441)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 0\
**Last updated:** [July 16, 2019, 8:54pm UTC](https://discourse.julialang.org/t/cuda-run-code-with-list/26441 "2019-07-16T20:54:05Z")

</div>

I wanted to get line coordinates from startpoint to endpoint, but it didn’t work. I guess that the problem is in data type of Segment list(and overally a lists). In my program I will use lists to load data. using CUDAd…

---

## [How to unspecify parametric arguments](https://discourse.julialang.org/t/how-to-unspecify-parametric-arguments/26427)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 2\
**Last updated:** [July 16, 2019, 8:47pm UTC](https://discourse.julialang.org/t/how-to-unspecify-parametric-arguments/26427 "2019-07-16T20:47:07Z")

</div>

I want to write a method for a parametric type, where I specify some of the parameters (to have multiple dispatch) but leave some of the others alone, cause they don’t make a difference. To my “dismay” this MWE works… s…

---

## [MKL bundled Julia by Julia Computing](https://discourse.julialang.org/t/mkl-bundled-julia-by-julia-computing/18585)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 40\
**Last updated:** [July 16, 2019, 1:30pm UTC](https://discourse.julialang.org/t/mkl-bundled-julia-by-julia-computing/18585 "2019-07-16T13:30:11Z")

</div>

I was wondering if it is possible for Julia Computing to offer a MKL bundled Julia. I feel like JuliaPro free version is a little bit too large for me and it takes long time to install, and I can set up Atom and Juno by …

---

## [How to correctly initialize mutable structures in Callback functions with DifferentialEquations.jl](https://discourse.julialang.org/t/how-to-correctly-initialize-mutable-structures-in-callback-functions-with-differentialequations-jl/26428)

<div class="topic-metadata">

**Author:** [@luis\_munoz](https://discourse.julialang.org/u/luis_munoz)\
**Replies:** 3\
**Last updated:** [July 16, 2019, 3:48pm UTC](https://discourse.julialang.org/t/how-to-correctly-initialize-mutable-structures-in-callback-functions-with-differentialequations-jl/26428 "2019-07-16T15:48:16Z")

</div>

Hi, As part of my ODE problem, I create a mutable struct Event to store data in a readable manner within the Callback framework of DifferentialEquations.jl. I have then implemented an instance Buffer of type Event to co…

---

## [Linear Algebra over different fields (\`LinearAlgebra.det\` does not respect the \`+\` and \`\*\` multimethods)](https://discourse.julialang.org/t/linear-algebra-over-different-fields-linearalgebra-det-does-not-respect-the-and-multimethods/26391)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 8\
**Last updated:** [July 16, 2019, 1:06pm UTC](https://discourse.julialang.org/t/linear-algebra-over-different-fields-linearalgebra-det-does-not-respect-the-and-multimethods/26391 "2019-07-16T13:06:14Z")

</div>

I want to get a random matrix of binary numbers (the GF(2) field, i.e. {0,1}), then check whether it is invertible by calculating its determinant and getting its inverse. From stylistic (and elegance of types) point of …

---

## [Debugger fails on pycall](https://discourse.julialang.org/t/debugger-fails-on-pycall/23560)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 19\
**Last updated:** [July 16, 2019, 11:57am UTC](https://discourse.julialang.org/t/debugger-fails-on-pycall/23560 "2019-07-16T11:57:16Z")

</div>

I’m using Debugger.jl to debug an RL algorithm calling into OpenAIGym.jl using PyCall. Upon the call, the error ERROR: sigatomic\_end called in non-sigatomic region is thrown. Is this a known limitation of the debugger …

---

## [Speed of dispatch with heterogeneous functions and types](https://discourse.julialang.org/t/speed-of-dispatch-with-heterogeneous-functions-and-types/26282)

<div class="topic-metadata">

**Author:** [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Replies:** 10\
**Last updated:** [July 16, 2019, 10:57am UTC](https://discourse.julialang.org/t/speed-of-dispatch-with-heterogeneous-functions-and-types/26282 "2019-07-16T10:57:51Z")

</div>

I am planning to implement a continuous-time version of a discrete-time agent-based simulation (see https://github.com/mhinsch/RRGraphs). That means there will be some sort of central scheduler that handles dispatch of a…

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

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