# General Usage

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

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

**Page:** 938

---

## [Converting to base SI units with Unitful.jl](https://discourse.julialang.org/t/converting-to-base-si-units-with-unitful-jl/15277)

<div class="topic-metadata">

**Author:** [@DrPapa](https://discourse.julialang.org/u/DrPapa)\
**Replies:** 2\
**Last updated:** [September 21, 2018, 5:43pm UTC](https://discourse.julialang.org/t/converting-to-base-si-units-with-unitful-jl/15277 "2018-09-21T17:43:14Z")

</div>

I’m trying to figure out if its possible to convert dimensions to base SI units using Unitful without explicitly specifying the base unit. Right now I do: a = 800.0u"ft/s" |\> u"m/s" b = 50.0u"cm^2" |\> u"m^2" Edit: ac…

---

## [A question about JLD2](https://discourse.julialang.org/t/a-question-about-jld2/15292)

<div class="topic-metadata">

**Author:** [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Replies:** 3\
**Last updated:** [September 21, 2018, 4:51pm UTC](https://discourse.julialang.org/t/a-question-about-jld2/15292 "2018-09-21T16:51:43Z")

</div>

I am developing a generic package implementing a parallel algorithm and I want to provide generic IO routines for user types. I know that JLD2 may have breakage between Julia releases because the serialization of types i…

---

## [ForwardDiff.gradient of function with nested functions calls](https://discourse.julialang.org/t/forwarddiff-gradient-of-function-with-nested-functions-calls/15291)

<div class="topic-metadata">

**Author:** [@Andrey.Borzunov](https://discourse.julialang.org/u/Andrey.Borzunov)\
**Replies:** 2\
**Last updated:** [September 21, 2018, 3:53pm UTC](https://discourse.julialang.org/t/forwarddiff-gradient-of-function-with-nested-functions-calls/15291 "2018-09-21T15:53:01Z")

</div>

I’m trying to get gradient of function that calls another one. using ForwardDiff, BenchmarkTools const f\_l, f\_r = 0.0,0.0; function J(f::AbstractArray, α::AbstractArray, mesh::AbstractArray) J = 0.0; N = length…

---

## [Can't access jld data from julia0.7](https://discourse.julialang.org/t/cant-access-jld-data-from-julia0-7/15284)

<div class="topic-metadata">

**Author:** [@pegger0709](https://discourse.julialang.org/u/pegger0709)\
**Replies:** 1\
**Last updated:** [September 21, 2018, 3:22pm UTC](https://discourse.julialang.org/t/cant-access-jld-data-from-julia0-7/15284 "2018-09-21T15:22:00Z")

</div>

Hello, I just upgraded to 0.7 on my way to 1.0 and noticed that I couldn’t install the JLD package. julia\> Pkg.add("JLD") WARNING: Base.Pkg is deprecated, run \`using Pkg\` instead in module Main Cloning default regi…

---

## [Plotting a filled contour and saving as eps or svg](https://discourse.julialang.org/t/plotting-a-filled-contour-and-saving-as-eps-or-svg/15152)

<div class="topic-metadata">

**Author:** [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Replies:** 26\
**Last updated:** [September 21, 2018, 2:49pm UTC](https://discourse.julialang.org/t/plotting-a-filled-contour-and-saving-as-eps-or-svg/15152 "2018-09-21T14:49:30Z")

</div>

I would like to simply plot a filled contour for given x, y, and z variables (or a function z(x,y)), and save it to eps (or svg). My goal is to make a GitHub repo of simple plotting examples that export to eps, svg, pdf,…

---

## [Write/read multiple arrays of different types 300+ Million elements each. Brute force .jld seems stupid.](https://discourse.julialang.org/t/write-read-multiple-arrays-of-different-types-300-million-elements-each-brute-force-jld-seems-stupid/15229)

<div class="topic-metadata">

**Author:** [@Mikkel-Holm](https://discourse.julialang.org/u/Mikkel-Holm)\
**Replies:** 14\
**Last updated:** [September 21, 2018, 2:09pm UTC](https://discourse.julialang.org/t/write-read-multiple-arrays-of-different-types-300-million-elements-each-brute-force-jld-seems-stupid/15229 "2018-09-21T14:09:22Z")

</div>

I am working with a semi-large dataset consisting of multiple arrays of different types each of ~300 Mil indexes. Using the JLD package to load the data as .jld files takes around 60 minutes, which is simply too slow. W…

---

## [Simple type question](https://discourse.julialang.org/t/simple-type-question/15257)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 3\
**Last updated:** [September 21, 2018, 12:17pm UTC](https://discourse.julialang.org/t/simple-type-question/15257 "2018-09-21T12:17:11Z")

</div>

julia\> TwoLegged() ERROR: MethodError: no method matching get\_name(::Type{Handler.HandlerContext{##WithLegsName#721,M,T} where T where M}) Closest candidates are: get\_name(::Type{HandlerContext{N,M,T}}) where {N, M, T}…

---

## [Testing for lossless \<:Integer -\> \<:AbstractFloat conversion](https://discourse.julialang.org/t/testing-for-lossless-integer-abstractfloat-conversion/15267)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [September 21, 2018, 11:33am UTC](https://discourse.julialang.org/t/testing-for-lossless-integer-abstractfloat-conversion/15267 "2018-09-21T11:33:45Z")

</div>

After tracking down a bug in my code which can be neatly summarized as julia\> maxintfloat() + 1 ≤ maxintfloat() true I was wondering how to test if an vec\[index\] = elt can be performed losslessly, if vec::AbstractVec…

---

## [ModiaMath has no know versions (although 3 versions released)](https://discourse.julialang.org/t/modiamath-has-no-know-versions-although-3-versions-released/15264)

<div class="topic-metadata">

**Author:** [@MartinOtter](https://discourse.julialang.org/u/MartinOtter)\
**Replies:** 3\
**Last updated:** [September 21, 2018, 7:33am UTC](https://discourse.julialang.org/t/modiamath-has-no-know-versions-although-3-versions-released/15264 "2018-09-21T07:33:27Z")

</div>

ModiaMath has three released versions and all are registered at METADATA. Modia uses ModiaMath and has ModiaMath in its dependencies (in Project.toml/Manifest.toml file). Modia is cloned to .julia/dev, the current enviro…

---

## [Two modules with the same exported function name but different signature](https://discourse.julialang.org/t/two-modules-with-the-same-exported-function-name-but-different-signature/15231)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 13\
**Last updated:** [September 21, 2018, 5:08am UTC](https://discourse.julialang.org/t/two-modules-with-the-same-exported-function-name-but-different-signature/15231 "2018-09-21T05:08:24Z")

</div>

Hello, I have the following situation which I did not expected: defining a fucntion with the same name but different signature in two modules like this: ## Module RawTables function save(T::RawTable, name\_pref::String) …

---

## [Readability of \`@code\_warntype\`](https://discourse.julialang.org/t/readability-of-code-warntype/15073)

<div class="topic-metadata">

**Author:** [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Replies:** 3\
**Last updated:** [September 20, 2018, 4:09pm UTC](https://discourse.julialang.org/t/readability-of-code-warntype/15073 "2018-09-20T16:09:58Z")

</div>

Hello all, I find that the readability of @code\_warntype has regressed considerably since v0.6. I am no expert on code introspection, but I used to be able to make out some of the meanings, not anymore :slight\_smile: E…

---

## [Opening two interdependent .so files in Libdl](https://discourse.julialang.org/t/opening-two-interdependent-so-files-in-libdl/15046)

<div class="topic-metadata">

**Author:** [@jstrube](https://discourse.julialang.org/u/jstrube)\
**Replies:** 16\
**Last updated:** [September 20, 2018, 11:10pm UTC](https://discourse.julialang.org/t/opening-two-interdependent-so-files-in-libdl/15046 "2018-09-20T23:10:52Z")

</div>

I’m trying to wrap a c++ library using CxxWrap.jl. I’ve built the libs with BinaryBuilder (https://github.com/jstrube/FastJetBuilder/releases), and the wrapper code compiles (Releases · jstrube/FastJet\_Julia\_Wrapper · Gi…

---

## [Possible to parse strings containing strings?](https://discourse.julialang.org/t/possible-to-parse-strings-containing-strings/15081)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 12\
**Last updated:** [September 20, 2018, 7:06pm UTC](https://discourse.julialang.org/t/possible-to-parse-strings-containing-strings/15081 "2018-09-20T19:06:50Z")

</div>

I’m looking into calling functions with an input argument which is a string – normally of type: s = "K = 5" myfunction(s) where myfunction should parse the string argument and then set K equal to the number 5 when call…

---

## [Overwriting .ji files for modules with the same name](https://discourse.julialang.org/t/overwriting-ji-files-for-modules-with-the-same-name/15228)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 6:58pm UTC](https://discourse.julialang.org/t/overwriting-ji-files-for-modules-with-the-same-name/15228 "2018-09-20T18:58:23Z")

</div>

I just noticed this, in one of my apps. Wondering what happens if I have two apps with the same module name, running at the same time? \[ Info: Recompiling stale cache file /Users/adrian/.julia/compiled/v1.0/BooksControl…

---

## [Julia recompiles same code more than once](https://discourse.julialang.org/t/julia-recompiles-same-code-more-than-once/15180)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 14\
**Last updated:** [September 20, 2018, 5:23pm UTC](https://discourse.julialang.org/t/julia-recompiles-same-code-more-than-once/15180 "2018-09-20T17:23:42Z")

</div>

I have a code that looks like module M # Actually a package struct Model ... end function stiffness(elem::T) # always return Matrix{FLoat64} # there are more stiffness functions # for differen…

---

## [ForwardDiff gradient with additional parameters](https://discourse.julialang.org/t/forwarddiff-gradient-with-additional-parameters/3186)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 3\
**Last updated:** [April 12, 2017, 8:52pm UTC](https://discourse.julialang.org/t/forwarddiff-gradient-with-additional-parameters/3186 "2017-04-12T20:52:27Z")

</div>

I am trying to use ForwardDiff.gradient on a function that takes arguments at which the gradient should be taken, as well as data. For example using Distributions, ForwardDiff srand(1) D = rand(Normal(5.0, 1.0), 10) f(…

---

## ['eigs' gives incorrect solution](https://discourse.julialang.org/t/eigs-gives-incorrect-solution/15233)

<div class="topic-metadata">

**Author:** [@FiniteelementDuan](https://discourse.julialang.org/u/FiniteelementDuan)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 2:21pm UTC](https://discourse.julialang.org/t/eigs-gives-incorrect-solution/15233 "2018-09-20T14:21:31Z")

</div>

I have following complex sparse matrices A and B (24\*24). These are copied here for testing. import Pkg Pkg.update() Pkg.add("Arpack") using Arpack A=\[0.00000000000000 + 0.00000000000000im 0.00000000000000 + 0.00000000…

---

## [Optimal Binary Search Trees?](https://discourse.julialang.org/t/optimal-binary-search-trees/15232)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 2\
**Last updated:** [September 20, 2018, 1:37pm UTC](https://discourse.julialang.org/t/optimal-binary-search-trees/15232 "2018-09-20T13:37:55Z")

</div>

Has anyone written a fast, low memory optimal binary search tree implementation? The data is fixed so nodes don’t need to be added or deleted, just accessed.

---

## [How to predict the type of a view(A, ...)](https://discourse.julialang.org/t/how-to-predict-the-type-of-a-view-a/15200)

<div class="topic-metadata">

**Author:** [@galenlynch](https://discourse.julialang.org/u/galenlynch)\
**Replies:** 6\
**Last updated:** [September 20, 2018, 12:47pm UTC](https://discourse.julialang.org/t/how-to-predict-the-type-of-a-view-a/15200 "2018-09-20T12:47:42Z")

</div>

I often want to pre-allocate a container for a bunch of views, but have no idea how to predict the type that view will return, and therefore don’t know how to make a container for them. I understand that this may be diff…

---

## [Multiple Versions of one Module in same Environment](https://discourse.julialang.org/t/multiple-versions-of-one-module-in-same-environment/15162)

<div class="topic-metadata">

**Author:** [@maximilianpreisinger](https://discourse.julialang.org/u/maximilianpreisinger)\
**Replies:** 3\
**Last updated:** [September 20, 2018, 12:25pm UTC](https://discourse.julialang.org/t/multiple-versions-of-one-module-in-same-environment/15162 "2018-09-20T12:25:17Z")

</div>

Hello Guys, this is both a question and a feature request. I am very happy with the new package manager and the environment solution, so that the dependency hell can be decreased. However I figured out a situation, whe…

---

## [How to describe parametric Union Types and types in struct](https://discourse.julialang.org/t/how-to-describe-parametric-union-types-and-types-in-struct/15212)

<div class="topic-metadata">

**Author:** [@xiang0x48](https://discourse.julialang.org/u/xiang0x48)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 7:42am UTC](https://discourse.julialang.org/t/how-to-describe-parametric-union-types-and-types-in-struct/15212 "2018-09-20T07:42:40Z")

</div>

Hi, I’m trying to define several types like: using StaticArrays struct CartesianPoint{T \<: Number} \<: FieldVector{3, T} x::T y::T z::T end struct UnitCartesianPoint{T \<: Number} \<: FieldVector{3, T} x::…

---

## [AppVeyor does not show package version used](https://discourse.julialang.org/t/appveyor-does-not-show-package-version-used/15218)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 7:41am UTC](https://discourse.julialang.org/t/appveyor-does-not-show-package-version-used/15218 "2018-09-20T07:41:37Z")

</div>

My tests are failing. Presumably because of a dependency. Now I can use the history on AppVeyor to find the latest working version of a package. However, for some packages, like PyCall, I cannot find the version which …

---

## [Confusion about version control under Pkg3](https://discourse.julialang.org/t/confusion-about-version-control-under-pkg3/15203)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 6:35am UTC](https://discourse.julialang.org/t/confusion-about-version-control-under-pkg3/15203 "2018-09-20T06:35:39Z")

</div>

I am developing a package, which lives in a git repository and working on upgrading to 0.7. There are two kinds of “versions” associated with packages: The version one assigns in a Project.toml file The version contai…

---

## [Plots... filling area between two curves?](https://discourse.julialang.org/t/plots-filling-area-between-two-curves/15204)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 2\
**Last updated:** [September 20, 2018, 5:29am UTC](https://discourse.julialang.org/t/plots-filling-area-between-two-curves/15204 "2018-09-20T05:29:18Z")

</div>

With Plots – how can I fill the area between two curves/time series? E.g., suppose: I have one time series consisting of pairs (x\_i,y\_i) with i\\in\\{1,\\ldots,N\\} - where y\_i could be the expected value of some system, a…

---

## [Sending modules from a local julia file to remote machines](https://discourse.julialang.org/t/sending-modules-from-a-local-julia-file-to-remote-machines/8088)

<div class="topic-metadata">

**Author:** [@Snir\_Gazit](https://discourse.julialang.org/u/Snir_Gazit)\
**Replies:** 4\
**Last updated:** [September 20, 2018, 2:31am UTC](https://discourse.julialang.org/t/sending-modules-from-a-local-julia-file-to-remote-machines/8088 "2018-09-20T02:31:55Z")

</div>

Hi, I’m trying to run a Julia program comprising multiple modules on a remote machine. The relevant Julia files are available locally but not on the remote machine. Adding processes on the remote machines seems to work…

---

## [Makie - modification of lighting](https://discourse.julialang.org/t/makie-modification-of-lighting/15209)

<div class="topic-metadata">

**Author:** [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Replies:** 0\
**Last updated:** [September 20, 2018, 1:11am UTC](https://discourse.julialang.org/t/makie-modification-of-lighting/15209 "2018-09-20T01:11:41Z")

</div>

I have implemented a useful visualization of 3D surface function using Makie. I can “do science” with this, but the specular highlights are too strong (especially when combined with dark, shadowy regions of the same sur…

---

## [Interpolate - deprecate getindex](https://discourse.julialang.org/t/interpolate-deprecate-getindex/15207)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 12:34am UTC](https://discourse.julialang.org/t/interpolate-deprecate-getindex/15207 "2018-09-20T00:34:31Z")

</div>

Hi, I am interpolating two vectors and then evaluating the function at some other point. For example, f = interpolate(a,b, Gridded(Linear())) c = f\[zz\[1\]\] where zz\[1\] is the first element of a vector. I get this err…

---

## [How to start writing a new Julia package?](https://discourse.julialang.org/t/how-to-start-writing-a-new-julia-package/2864)

<div class="topic-metadata">

**Author:** [@sbohor3](https://discourse.julialang.org/u/sbohor3)\
**Replies:** 47\
**Last updated:** [March 26, 2017, 9:07pm UTC](https://discourse.julialang.org/t/how-to-start-writing-a-new-julia-package/2864 "2017-03-26T21:07:43Z")

</div>

@andreasnoack: OK. Thanks. I have a quick question. I am writing a Julia package for a stat method that we developed. Is there a good documentation/package to teach writing the package and share it? Thanks.

---

## [Array indexing order vs dimension number](https://discourse.julialang.org/t/array-indexing-order-vs-dimension-number/15154)

<div class="topic-metadata">

**Author:** [@Adriel](https://discourse.julialang.org/u/Adriel)\
**Replies:** 6\
**Last updated:** [September 19, 2018, 10:11pm UTC](https://discourse.julialang.org/t/array-indexing-order-vs-dimension-number/15154 "2018-09-19T22:11:16Z")

</div>

This is a general question, I’m not seeking help with anything specific. The linear algebra convention for matrix indices is (row, column), which is also the case in julia (and matlab). So why does julia (and matlab) as…

---

## [How may I send data to other processes within a function?](https://discourse.julialang.org/t/how-may-i-send-data-to-other-processes-within-a-function/15080)

<div class="topic-metadata">

**Author:** [@shipengcheng1230](https://discourse.julialang.org/u/shipengcheng1230)\
**Replies:** 2\
**Last updated:** [September 19, 2018, 8:34pm UTC](https://discourse.julialang.org/t/how-may-i-send-data-to-other-processes-within-a-function/15080 "2018-09-19T20:34:27Z")

</div>

Hello, I would like to send some data to other processes in a function, however, it is not successful. Only when I @spawnat in the Main module is it able to show up on the var table and be accessible within @everywhere. …

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

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