# General Usage

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

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

**Page:** 949

---

## [Interpolate.jl a vector of \`Point\`](https://discourse.julialang.org/t/interpolate-jl-a-vector-of-point/13929)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 6\
**Last updated:** [August 25, 2018, 1:55pm UTC](https://discourse.julialang.org/t/interpolate-jl-a-vector-of-point/13929 "2018-08-25T13:55:07Z")

</div>

Suppose a have a custom type Point: struct Point{T} x::T y::T end I would like to find a way to use Interpolations.jl to interpolate a Vector{Point{T}}, but I can’t get my head around it. Say I have this ju…

---

## [Destruction of Shared Array does not work anymore](https://discourse.julialang.org/t/destruction-of-shared-array-does-not-work-anymore/14037)

<div class="topic-metadata">

**Author:** [@Sarem\_Seitz](https://discourse.julialang.org/u/Sarem_Seitz)\
**Replies:** 0\
**Last updated:** [August 25, 2018, 1:19pm UTC](https://discourse.julialang.org/t/destruction-of-shared-array-does-not-work-anymore/14037 "2018-08-25T13:19:32Z")

</div>

Hi, I am trying to get a distributed workflow running where - in a loop - a shared array gets created, some operations are performed on the shared array in parallel and then the shared array gets destroyed in order to f…

---

## [Julia v1.0 Install notes](https://discourse.julialang.org/t/julia-v1-0-install-notes/13583)

<div class="topic-metadata">

**Author:** [@dgleich](https://discourse.julialang.org/u/dgleich)\
**Replies:** 23\
**Last updated:** [August 25, 2018, 1:05pm UTC](https://discourse.julialang.org/t/julia-v1-0-install-notes/13583 "2018-08-25T13:05:20Z")

</div>

Hey all, I love all the work on Julia 1.0 and am looking forwarding to the language stabilizing. I’m about to teach a class where we are (tentatively) going to use Julia 1.0 exclusively. This means we need to have plot…

---

## [Too many ways to do the same thing in Julia](https://discourse.julialang.org/t/too-many-ways-to-do-the-same-thing-in-julia/13983)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 16\
**Last updated:** [August 25, 2018, 4:02am UTC](https://discourse.julialang.org/t/too-many-ways-to-do-the-same-thing-in-julia/13983 "2018-08-25T04:02:45Z")

</div>

Sure, it gives freedom. But if you are reading someone else code it means you have to learn all the possible ways. And it may lead to unexpected inconsistencies. Some examples. Use the new package manager (using Pkg)…

---

## [How to set path after running juliac.jl?](https://discourse.julialang.org/t/how-to-set-path-after-running-juliac-jl/14025)

<div class="topic-metadata">

**Author:** [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Replies:** 0\
**Last updated:** [August 25, 2018, 3:43am UTC](https://discourse.julialang.org/t/how-to-set-path-after-running-juliac-jl/14025 "2018-08-25T03:43:44Z")

</div>

So I did: julia ~/.julia/packages/PackageCompiler/5u3Km/juliac.jl -vae hello.jl Then these three files are generated under builddir/ hello hello.a hello.so Then I tried to execute hello, but got errors: $ ./hello …

---

## [Function imgradients does not accept keyword arguments](https://discourse.julialang.org/t/function-imgradients-does-not-accept-keyword-arguments/14019)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 2\
**Last updated:** [August 25, 2018, 2:25am UTC](https://discourse.julialang.org/t/function-imgradients-does-not-accept-keyword-arguments/14019 "2018-08-25T02:25:18Z")

</div>

Hi! I am trying to get the gradient magnitude for each pixel of the image as here: imgradients(imgF, kernelfun=KernelFactors.ando3, border="replicate") I am getting this error: function imgradients does not accept …

---

## [Higher-order lazy ranges/iterators](https://discourse.julialang.org/t/higher-order-lazy-ranges-iterators/13995)

<div class="topic-metadata">

**Author:** [@nordlow](https://discourse.julialang.org/u/nordlow)\
**Replies:** 4\
**Last updated:** [August 24, 2018, 11:35pm UTC](https://discourse.julialang.org/t/higher-order-lazy-ranges-iterators/13995 "2018-08-24T23:35:15Z")

</div>

Will Julia (under the hood) in the future fuse the loops of calls such as map(x -\> x + 1, map(x -\> x \* 2, \[1, 2, 3\])) into a single loop, requiring only a single temporary element, regardless of the size of x? Similar …

---

## [Best practices for examples with Pkg3](https://discourse.julialang.org/t/best-practices-for-examples-with-pkg3/13356)

<div class="topic-metadata">

**Author:** [@krcools](https://discourse.julialang.org/u/krcools)\
**Replies:** 15\
**Last updated:** [August 24, 2018, 11:20pm UTC](https://discourse.julialang.org/t/best-practices-for-examples-with-pkg3/13356 "2018-08-24T23:20:03Z")

</div>

Often, example scripts explicitly import dependencies of the package they are included with at top level scope. This was not an issue with OldPkg as the dependencies are installed and visible for code loading in any cont…

---

## [Get Cholesky Factors of sparse input matrix in Julia v0.7/1.0](https://discourse.julialang.org/t/get-cholesky-factors-of-sparse-input-matrix-in-julia-v0-7-1-0/13987)

<div class="topic-metadata">

**Author:** [@migarstka](https://discourse.julialang.org/u/migarstka)\
**Replies:** 4\
**Last updated:** [August 24, 2018, 9:36pm UTC](https://discourse.julialang.org/t/get-cholesky-factors-of-sparse-input-matrix-in-julia-v0-7-1-0/13987 "2018-08-24T21:36:14Z")

</div>

Hi everyone, is there any way to extract the lower triangular matrix L from the cholesky factorization F of a sparse matrix A = L\*L' obtained by F = cholesky(A) MWE: using LinearAlgebra # create a sparse random pos…

---

## [Plot, surface! with MethodError: no method matching length(::ColorGradient)](https://discourse.julialang.org/t/plot-surface-with-methoderror-no-method-matching-length-colorgradient/14011)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 1\
**Last updated:** [August 24, 2018, 8:48pm UTC](https://discourse.julialang.org/t/plot-surface-with-methoderror-no-method-matching-length-colorgradient/14011 "2018-08-24T20:48:20Z")

</div>

using Plots x\_min, x\_max = -5, 5 y\_min, y\_max = -5, 5 α, β = 0.2, 0.1 # Axes gs = 3 z = range(x\_min, stop = x\_max, length = gs) x = zeros(gs) y = zeros(gs) plot(x, y, z, color=:black, linewidth=2, alpha=0.5, label="",…

---

## [JuliaBox v2 Unable to Clone Git Repo](https://discourse.julialang.org/t/juliabox-v2-unable-to-clone-git-repo/8405)

<div class="topic-metadata">

**Author:** [@gaomrx](https://discourse.julialang.org/u/gaomrx)\
**Replies:** 2\
**Last updated:** [August 24, 2018, 8:20pm UTC](https://discourse.julialang.org/t/juliabox-v2-unable-to-clone-git-repo/8405 "2018-08-24T20:20:28Z")

</div>

I tried cloning a private Git repo using Juliabox v2 and ended up with the following message I am still a little disappointed that users are no longer able to use the terminal for Git operations.

---

## [Is it possible to override keyword arguments for specific types?](https://discourse.julialang.org/t/is-it-possible-to-override-keyword-arguments-for-specific-types/13924)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 7\
**Last updated:** [August 24, 2018, 8:15pm UTC](https://discourse.julialang.org/t/is-it-possible-to-override-keyword-arguments-for-specific-types/13924 "2018-08-24T20:15:00Z")

</div>

I have library code that looks like the following: foo(x) = 1 foo(::Float64) = 2.0 foo2(x; height=foo(x)) = "hi" and I want to override foo2 in the special case where foo(x) returns a MyType. Looking at https://docs.ju…

---

## [Scope, for loops and arrays](https://discourse.julialang.org/t/scope-for-loops-and-arrays/14005)

<div class="topic-metadata">

**Author:** [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Replies:** 5\
**Last updated:** [August 24, 2018, 6:03pm UTC](https://discourse.julialang.org/t/scope-for-loops-and-arrays/14005 "2018-08-24T18:03:39Z")

</div>

I’m using Julia 1.0 (yay!) and have set up a function where I’m having behavior I do not understand. Specifically, the following works: ϵ33FieldOld=\[0.0 for theX3 in x3vals, theX1 in x1vals\] for i in 1:10 …

---

## [Weird docstrings error](https://discourse.julialang.org/t/weird-docstrings-error/14000)

<div class="topic-metadata">

**Author:** [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Replies:** 3\
**Last updated:** [August 24, 2018, 3:31pm UTC](https://discourse.julialang.org/t/weird-docstrings-error/14000 "2018-08-24T15:31:13Z")

</div>

MWE: abstract type SpinCategory end struct SpinAware \<: SpinCategory end """ Looks at axes to figure out the spin category - no spin-axis -\> SpinDegenerate - fastest changing dimension -\> ColinearSpinFirst - \`n\`th di…

---

## [Most efficient way to unpack array into variables?](https://discourse.julialang.org/t/most-efficient-way-to-unpack-array-into-variables/13725)

<div class="topic-metadata">

**Author:** [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Replies:** 7\
**Last updated:** [August 24, 2018, 2:42pm UTC](https://discourse.julialang.org/t/most-efficient-way-to-unpack-array-into-variables/13725 "2018-08-24T14:42:11Z")

</div>

When optimising some complicated model, I find two things are important: Readability (I want to use correct variable names, not array\_of\_parameters\[index\_required\]) Speed (the function may be called many thousands …

---

## [Are generator expressions documented? Also other questions](https://discourse.julialang.org/t/are-generator-expressions-documented-also-other-questions/13786)

<div class="topic-metadata">

**Author:** [@taliesinb](https://discourse.julialang.org/u/taliesinb)\
**Replies:** 8\
**Last updated:** [August 24, 2018, 1:51pm UTC](https://discourse.julialang.org/t/are-generator-expressions-documented-also-other-questions/13786 "2018-08-24T13:51:25Z")

</div>

Sorry, this might be a dumb question. This search reveals nothing obviously relevant, at least in the top results: Search · The Julia Language And yet I’ve noticed from some examples I saw online that Python-like gener…

---

## [Poor performance of multivariate RNG in 1.0](https://discourse.julialang.org/t/poor-performance-of-multivariate-rng-in-1-0/13966)

<div class="topic-metadata">

**Author:** [@kaskarn](https://discourse.julialang.org/u/kaskarn)\
**Replies:** 7\
**Last updated:** [August 24, 2018, 1:23pm UTC](https://discourse.julialang.org/t/poor-performance-of-multivariate-rng-in-1-0/13966 "2018-08-24T13:23:41Z")

</div>

I am updating some code form 0.5.2 to 1.0 and found large drops in performance, largely due to RNG I generated 10M Float64 draws from N(0,1) and MVN(0,I(10)), with both rand() and rand! After running everything a coupl…

---

## [A question about JuliaInv](https://discourse.julialang.org/t/a-question-about-juliainv/13992)

<div class="topic-metadata">

**Author:** [@chdlkl](https://discourse.julialang.org/u/chdlkl)\
**Replies:** 0\
**Last updated:** [August 24, 2018, 12:48pm UTC](https://discourse.julialang.org/t/a-question-about-juliainv/13992 "2018-08-24T12:48:59Z")

</div>

I downloaded the MaxwellTime package from https://github.com/JuliaInv/MaxwellTime. When I tested testAnalyticsGroundedSource.jl in the folder test, I encountered the following problem. Does anyone know how to solve it? …

---

## [Outdated information in error, Pkg 3.0?](https://discourse.julialang.org/t/outdated-information-in-error-pkg-3-0/13926)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 4\
**Last updated:** [August 24, 2018, 12:14pm UTC](https://discourse.julialang.org/t/outdated-information-in-error-pkg-3-0/13926 "2018-08-24T12:14:55Z")

</div>

After some cleaning on my computer I run Julia 1.0 and have using IJulia ERROR: ArgumentError: Package IJulia not found in current path: - Run \`Pkg.add("IJulia")\` to install the IJulia package. Stacktrace: \[1\] require…

---

## [Plots.jl -\> funny message](https://discourse.julialang.org/t/plots-jl-funny-message/13985)

<div class="topic-metadata">

**Author:** [@j2b2](https://discourse.julialang.org/u/j2b2)\
**Replies:** 0\
**Last updated:** [August 24, 2018, 9:45am UTC](https://discourse.julialang.org/t/plots-jl-funny-message/13985 "2018-08-24T09:45:05Z")

</div>

While executing a simple personal function, that includes a few calls to scatter and plot, I get this message: \[ Info: it is surprising that this function is called - please report a use case as a Plots issue After s…

---

## [Has anyone run your julia code on a cloud server?](https://discourse.julialang.org/t/has-anyone-run-your-julia-code-on-a-cloud-server/13972)

<div class="topic-metadata">

**Author:** [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Replies:** 3\
**Last updated:** [August 24, 2018, 7:30am UTC](https://discourse.julialang.org/t/has-anyone-run-your-julia-code-on-a-cloud-server/13972 "2018-08-24T07:30:04Z")

</div>

Do you run it with the source code there? Are you concerned about losing your code? Seems like julia code can not be compiled easily, what can you do when you need to distribute your program?

---

## [How to speed up my code](https://discourse.julialang.org/t/how-to-speed-up-my-code/13958)

<div class="topic-metadata">

**Author:** [@donquicote](https://discourse.julialang.org/u/donquicote)\
**Replies:** 8\
**Last updated:** [August 24, 2018, 4:33am UTC](https://discourse.julialang.org/t/how-to-speed-up-my-code/13958 "2018-08-24T04:33:57Z")

</div>

Hi there, I am solving a dynamic programming problem (first try in Julia). Previously I solved the same problem in Python. I was expecting Julia solving it much faster than Python, and I don’t get that much improvement.…

---

## [How long are object references guaranteed to live?](https://discourse.julialang.org/t/how-long-are-object-references-guaranteed-to-live/13916)

<div class="topic-metadata">

**Author:** [@lcmylin](https://discourse.julialang.org/u/lcmylin)\
**Replies:** 5\
**Last updated:** [August 24, 2018, 1:39am UTC](https://discourse.julialang.org/t/how-long-are-object-references-guaranteed-to-live/13916 "2018-08-24T01:39:44Z")

</div>

Relatively simple question: are object references guaranteed to “live” (i.e. retain the object they point to) for the entirety of the lexical scope in which they reside, or is the compiler free to “forget” them in the mi…

---

## [Revisiting type stability](https://discourse.julialang.org/t/revisiting-type-stability/13955)

<div class="topic-metadata">

**Author:** [@Wenjie](https://discourse.julialang.org/u/Wenjie)\
**Replies:** 5\
**Last updated:** [August 23, 2018, 7:35pm UTC](https://discourse.julialang.org/t/revisiting-type-stability/13955 "2018-08-23T19:35:21Z")

</div>

Type Stability is one of the most important concept in Julia but never properly defined. Instead, it is described with examples; most examples are similar to the following: function t1(n) s = 0 t = 1 for i in 1:n …

---

## [Help to create a macro / overload to mimic setindex! behavior in SArrays](https://discourse.julialang.org/t/help-to-create-a-macro-overload-to-mimic-setindex-behavior-in-sarrays/13959)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 6\
**Last updated:** [August 23, 2018, 6:35pm UTC](https://discourse.julialang.org/t/help-to-create-a-macro-overload-to-mimic-setindex-behavior-in-sarrays/13959 "2018-08-23T18:35:28Z")

</div>

Hi guys! I am trying to use SArrays in my project. I have tons of vectors and matrices that, in some cases, I need to modify only one index. What I am doing is to replace: Trw\[i\] = T(0) to Trw = setindex(Trw, 0, i) B…

---

## [Sparse Array Compression and Decompression upgrade to v0.7+](https://discourse.julialang.org/t/sparse-array-compression-and-decompression-upgrade-to-v0-7/13863)

<div class="topic-metadata">

**Author:** [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Replies:** 6\
**Last updated:** [August 23, 2018, 6:13pm UTC](https://discourse.julialang.org/t/sparse-array-compression-and-decompression-upgrade-to-v0-7/13863 "2018-08-23T18:13:18Z")

</div>

Summary: I can “compress” and “decompress” a sparse array using deprecated functions. I want to upgrade the code to v0.7+. (I want to use this compression/decompression to numerically evaluate the Jacobian of a function …

---

## [Iterators does not precompile under 1.0](https://discourse.julialang.org/t/iterators-does-not-precompile-under-1-0/13954)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 2\
**Last updated:** [August 23, 2018, 4:47pm UTC](https://discourse.julialang.org/t/iterators-does-not-precompile-under-1-0/13954 "2018-08-23T16:47:50Z")

</div>

I think Iterators is part of the base distribution. Correct? Alas, here it tells me julia\> using Iterators \[ Info: Precompiling Iterators \[a4bce56a-f44e-563f-a45f-5312daf41243\] ERROR: LoadError: syntax: extra token "T…

---

## [Bizarre Pkg bug reports: different versions when testing to make tests pass?](https://discourse.julialang.org/t/bizarre-pkg-bug-reports-different-versions-when-testing-to-make-tests-pass/13946)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 7\
**Last updated:** [August 23, 2018, 4:41pm UTC](https://discourse.julialang.org/t/bizarre-pkg-bug-reports-different-versions-when-testing-to-make-tests-pass/13946 "2018-08-23T16:41:42Z")

</div>

Has anyone seen this behavior where you can get different versions of a package when testing than when you using? I haven’t gotten it, but I am getting bug reports about it and am not sure how to tell users how to handle…

---

## [Copying data from ptr returned from ccall to julia data structure](https://discourse.julialang.org/t/copying-data-from-ptr-returned-from-ccall-to-julia-data-structure/13948)

<div class="topic-metadata">

**Author:** [@r\_v](https://discourse.julialang.org/u/r_v)\
**Replies:** 2\
**Last updated:** [August 23, 2018, 4:21pm UTC](https://discourse.julialang.org/t/copying-data-from-ptr-returned-from-ccall-to-julia-data-structure/13948 "2018-08-23T16:21:40Z")

</div>

I am trying to use an API that allocates memory and fills it out and passes data to the caller (and the caller must call another function in the API when done with the data to free the memory). I am not sure how to copy …

---

## [Package development of a not yet public package](https://discourse.julialang.org/t/package-development-of-a-not-yet-public-package/13933)

<div class="topic-metadata">

**Author:** [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Replies:** 6\
**Last updated:** [August 23, 2018, 3:08pm UTC](https://discourse.julialang.org/t/package-development-of-a-not-yet-public-package/13933 "2018-08-23T15:08:12Z")

</div>

I am having a little trouble with package development. It seems, Pkg3 prefers to do some caching here and there. I hava a MyPack.jl/ folder containing my package (with git repository src/\`\`docs/ test/ and such) When I …

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

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