# General Usage

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

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

**Page:** 808

---

## [Julia Pro can't install packages](https://discourse.julialang.org/t/julia-pro-cant-install-packages/30333)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 2\
**Last updated:** [December 5, 2019, 2:40pm UTC](https://discourse.julialang.org/t/julia-pro-cant-install-packages/30333 "2019-12-05T14:40:24Z")

</div>

I just re-installed JuliaPro - that was working before - and now when I try to add a package I get this error Updating git-repo \`https://pkg.juliacomputing.com//registry/JuliaPro\` ERROR: GitError(Code:EMERGECONFLICT, Cl…

---

## [Infinite recursion kills Julia instead of stackoverflowing](https://discourse.julialang.org/t/infinite-recursion-kills-julia-instead-of-stackoverflowing/31819)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 6\
**Last updated:** [December 5, 2019, 2:35pm UTC](https://discourse.julialang.org/t/infinite-recursion-kills-julia-instead-of-stackoverflowing/31819 "2019-12-05T14:35:40Z")

</div>

This is fine julia\> function recur(var::String) recur("Ai") end recur (generic function with 1 method) julia\> recur("ai") ERROR: StackOverflowError: Stacktrace: \[1\] recur(::String) at .\\REPL\[2\]:2 (repeat…

---

## [Type annotation make JIT compile faster?](https://discourse.julialang.org/t/type-annotation-make-jit-compile-faster/31906)

<div class="topic-metadata">

**Author:** [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Replies:** 2\
**Last updated:** [December 5, 2019, 2:11pm UTC](https://discourse.julialang.org/t/type-annotation-make-jit-compile-faster/31906 "2019-12-05T14:11:11Z")

</div>

I have a very simple question about Julia itself. Does type annotation for function make JIT compile faster? In other words, Should I add type annotations as much as possible for good JIT compile performance? Best

---

## [Add single point to plot using Plots pyplot()](https://discourse.julialang.org/t/add-single-point-to-plot-using-plots-pyplot/31886)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 2\
**Last updated:** [December 5, 2019, 12:57pm UTC](https://discourse.julialang.org/t/add-single-point-to-plot-using-plots-pyplot/31886 "2019-12-05T12:57:04Z")

</div>

Hi, I would like to add a point to a graph, like a heatmap. It works fine if I do plot!(\[1.\],\[1.\],color="blue") but if use plot!(\[a.\],\[a.\],color="blue") where a is a variable Int64, I get the error unexpected \]. Re…

---

## [Linear interpolations of (langitude, latitude, altitude) triples?](https://discourse.julialang.org/t/linear-interpolations-of-langitude-latitude-altitude-triples/31903)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 0\
**Last updated:** [December 5, 2019, 12:50pm UTC](https://discourse.julialang.org/t/linear-interpolations-of-langitude-latitude-altitude-triples/31903 "2019-12-05T12:50:53Z")

</div>

I hope this is a right place to ask this question. mutable struct LLA lat::Float64 lon::Float64 alt::Float64 end LLA(lat, lon) = LLA(lat, lon, 0.0) function linearInterpolation(startLoc::LLA, endLoc::LLA, f…

---

## [Writing functions for types defined in another module](https://discourse.julialang.org/t/writing-functions-for-types-defined-in-another-module/31895)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 5\
**Last updated:** [December 5, 2019, 11:51am UTC](https://discourse.julialang.org/t/writing-functions-for-types-defined-in-another-module/31895 "2019-12-05T11:51:51Z")

</div>

I want to have type definitions in one module module1 and then write functions that operate on my type in another module module2 and use these functions and the type in my main script / REPL. But in my current setup I th…

---

## [Update the last line while writing the current line during writing to a file in julia](https://discourse.julialang.org/t/update-the-last-line-while-writing-the-current-line-during-writing-to-a-file-in-julia/31899)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [December 5, 2019, 11:33am UTC](https://discourse.julialang.org/t/update-the-last-line-while-writing-the-current-line-during-writing-to-a-file-in-julia/31899 "2019-12-05T11:33:09Z")

</div>

Hi. I need to create a file with four columns, say startTimes, startLocs, routeNds, and edgesTravelTimes. Because each column has different length, I figured that I can only use a normal txt file, or a csv file, without …

---

## [Pkg doesn't seem to work so well under 1.3](https://discourse.julialang.org/t/pkg-doesnt-seem-to-work-so-well-under-1-3/31898)

<div class="topic-metadata">

**Author:** [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Replies:** 2\
**Last updated:** [December 5, 2019, 11:30am UTC](https://discourse.julialang.org/t/pkg-doesnt-seem-to-work-so-well-under-1-3/31898 "2019-12-05T11:30:45Z")

</div>

just upgrade to 1.3 from 1.1.1, I did an “update” under Pkg, but nothing happened though I had quite many packages installed under 1.1 (and I have not been up to date for a few months). “status” doesn’t show any existin…

---

## [Is there a way to define custom Zygote adjoints for only some arguments of a function?](https://discourse.julialang.org/t/is-there-a-way-to-define-custom-zygote-adjoints-for-only-some-arguments-of-a-function/31884)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 1\
**Last updated:** [December 5, 2019, 11:08am UTC](https://discourse.julialang.org/t/is-there-a-way-to-define-custom-zygote-adjoints-for-only-some-arguments-of-a-function/31884 "2019-12-05T11:08:35Z")

</div>

Suppose I have some function for which I define custom Zygote adjoints, but the gradient for some of the arguments I don’t need yet and I’d like to leave to implement later. Currently, I could define that adjoint to retu…

---

## [Map and mapreduce with Threads](https://discourse.julialang.org/t/map-and-mapreduce-with-threads/31861)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [December 5, 2019, 9:39am UTC](https://discourse.julialang.org/t/map-and-mapreduce-with-threads/31861 "2019-12-05T09:39:22Z")

</div>

I would like to experiment with parallelizing an embarrassingly parallel computation on an iterable using the new multithreading in 1.3. I need map and mapreduce. I would prefer to leave return type determination to Jul…

---

## [Documentation of eachindex](https://discourse.julialang.org/t/documentation-of-eachindex/31607)

<div class="topic-metadata">

**Author:** [@emmt](https://discourse.julialang.org/u/emmt)\
**Replies:** 1\
**Last updated:** [December 5, 2019, 7:10am UTC](https://discourse.julialang.org/t/documentation-of-eachindex/31607 "2019-12-05T07:10:52Z")

</div>

I find the documentation of eachindex a bit confusing when is says that: If the arrays have different sizes and/or dimensionalities, eachindex will return an iterable that spans the largest range along each dimension. …

---

## ["Pkg.resolve()" problems](https://discourse.julialang.org/t/pkg-resolve-problems/31793)

<div class="topic-metadata">

**Author:** [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Replies:** 2\
**Last updated:** [December 3, 2019, 12:57pm UTC](https://discourse.julialang.org/t/pkg-resolve-problems/31793 "2019-12-03T12:57:40Z")

</div>

Hello everybody, I cannot solve this problem using “Pkg.resolve()”. LoadError: ArgumentError: Package FEMBasis does not have Tensors in its dependencies: If you have FEMBasis checked out for development and have ad…

---

## [Can't add Zygote in Julia 1.3](https://discourse.julialang.org/t/cant-add-zygote-in-julia-1-3/31870)

<div class="topic-metadata">

**Author:** [@vavrines](https://discourse.julialang.org/u/vavrines)\
**Replies:** 8\
**Last updated:** [December 5, 2019, 3:51am UTC](https://discourse.julialang.org/t/cant-add-zygote-in-julia-1-3/31870 "2019-12-05T03:51:12Z")

</div>

When I tried to add Zygote.jl into Julia 1.3, it reported the following issues. Any ideas on how to solve it? Thanks :slight\_smile: (v1.3) pkg\> add Zygote Updating registry at \`~/.julia/registries/General\` Updatin…

---

## [Unexpected subtyping behavior \<:](https://discourse.julialang.org/t/unexpected-subtyping-behavior/31701)

<div class="topic-metadata">

**Author:** [@holylorenzo](https://discourse.julialang.org/u/holylorenzo)\
**Replies:** 2\
**Last updated:** [November 30, 2019, 8:58pm UTC](https://discourse.julialang.org/t/unexpected-subtyping-behavior/31701 "2019-11-30T20:58:17Z")

</div>

Hey everyone, could someone explain this subtyping behavior to me? It does not seem intuitive to me. Array{T where T} \<: AbstractArray{T where T} # true Array{Array{T where T}} \<: AbstractArray{Array{T where T}} # al…

---

## [Threads.@threads and BitArrays](https://discourse.julialang.org/t/threads-threads-and-bitarrays/31878)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 3\
**Last updated:** [December 4, 2019, 11:54pm UTC](https://discourse.julialang.org/t/threads-threads-and-bitarrays/31878 "2019-12-04T23:54:59Z")

</div>

Issue https://github.com/JuliaLang/julia/issues/33750 is about BitArrays not being threadsafe. My reading: changing elements of a BitArray inside a Threads.@threads for loop can give unpredictable results. My question i…

---

## [Has anyone used log axes in GR?](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 4\
**Last updated:** [December 4, 2019, 10:53pm UTC](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836 "2019-12-04T22:53:26Z")

</div>

I tried doing the following: using GR x = 1:100 y = abs.(randn(100)) setscale(GR.OPTION\_X\_LOG) plot(x,y) readline() and no logarithmic x-axis. i thought i was crazy, so i looked for an example that used a log axis an…

---

## [How to debug compilation time and loading time of packages?](https://discourse.julialang.org/t/how-to-debug-compilation-time-and-loading-time-of-packages/31583)

<div class="topic-metadata">

**Author:** [@jonas-schulze](https://discourse.julialang.org/u/jonas-schulze)\
**Replies:** 4\
**Last updated:** [December 4, 2019, 7:33pm UTC](https://discourse.julialang.org/t/how-to-debug-compilation-time-and-loading-time-of-packages/31583 "2019-12-04T19:33:50Z")

</div>

While waiting for general improvements in compile and load times (cf. comment in Roadmap for a faster time-to-first-plot? - #199 by ChrisRackauckas), what else can we do to improve the user experience for the packages we…

---

## [Help with if-like macro](https://discourse.julialang.org/t/help-with-if-like-macro/31856)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 21\
**Last updated:** [December 4, 2019, 7:27pm UTC](https://discourse.julialang.org/t/help-with-if-like-macro/31856 "2019-12-04T19:27:26Z")

</div>

Hi - yet another macro related yelp for help :slight\_smile: I’ve been trying everything I could think of but I just can’t get it right, help much appreciated. The objective is to be able to write something in the line …

---

## [Linking to exactly one documentation in @docs of Documenter.jl](https://discourse.julialang.org/t/linking-to-exactly-one-documentation-in-docs-of-documenter-jl/31865)

<div class="topic-metadata">

**Author:** [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Replies:** 2\
**Last updated:** [December 4, 2019, 7:00pm UTC](https://discourse.julialang.org/t/linking-to-exactly-one-documentation-in-docs-of-documenter-jl/31865 "2019-12-04T19:00:19Z")

</div>

I would like to refer to exactly one version of a function that is implemented for several subtypes in Documenter, see here. Especially the line 28 which reads manifold\_dimension(::SymmetricPositiveDefinite{N}) where N…

---

## [Wrong paths reported by @less and @which](https://discourse.julialang.org/t/wrong-paths-reported-by-less-and-which/31850)

<div class="topic-metadata">

**Author:** [@lbilli](https://discourse.julialang.org/u/lbilli)\
**Replies:** 0\
**Last updated:** [December 4, 2019, 12:11pm UTC](https://discourse.julialang.org/t/wrong-paths-reported-by-less-and-which/31850 "2019-12-04T12:11:36Z")

</div>

In Julia v1.3.0, macros @less and @which don’t seem to work as expected when applied to methods from the standard library: # This works @which sin(1) sin(x::Real) in Base.Math at special/trig.jl:53 # This doesn't using…

---

## [Passing locally defined function](https://discourse.julialang.org/t/passing-locally-defined-function/31846)

<div class="topic-metadata">

**Author:** [@racinmat](https://discourse.julialang.org/u/racinmat)\
**Replies:** 2\
**Last updated:** [December 4, 2019, 1:23pm UTC](https://discourse.julialang.org/t/passing-locally-defined-function/31846 "2019-12-04T13:23:04Z")

</div>

Hi, I have a function with local variable, which I want to apply for each element in an array, in parallel manner. I am using ThreadTools library. Assuming following code using ThreadTools do\_it(a, b, c, d) = a + b \* …

---

## [Got routing travel time Inf during simulation while in real case, any two locations are reachable from one to another](https://discourse.julialang.org/t/got-routing-travel-time-inf-during-simulation-while-in-real-case-any-two-locations-are-reachable-from-one-to-another/31840)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 0\
**Last updated:** [December 4, 2019, 9:59am UTC](https://discourse.julialang.org/t/got-routing-travel-time-inf-during-simulation-while-in-real-case-any-two-locations-are-reachable-from-one-to-another/31840 "2019-12-04T09:59:02Z")

</div>

Hi. I hope this is a right question to ask here. I’m doing a simulation of vehicle transportation. So during each round, I need to use shortest-path-algorithm to find the route with the shortest traveling time. In this p…

---

## [Introduce delayed element in differential equations with Julia's DifferentialEquations.jl](https://discourse.julialang.org/t/introduce-delayed-element-in-differential-equations-with-julias-differentialequations-jl/31794)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 9\
**Last updated:** [December 4, 2019, 9:54am UTC](https://discourse.julialang.org/t/introduce-delayed-element-in-differential-equations-with-julias-differentialequations-jl/31794 "2019-12-04T09:54:52Z")

</div>

Hello, I have a set of ordinary differential equations (ODE) that describe the growth of bacteria susceptible and resistant to phage infection: that generate this plot: To note that at t=1000 h the resistant stra…

---

## [Update old .64 code to 1.x](https://discourse.julialang.org/t/update-old-64-code-to-1-x/31832)

<div class="topic-metadata">

**Author:** [@theburdman](https://discourse.julialang.org/u/theburdman)\
**Replies:** 2\
**Last updated:** [December 4, 2019, 4:06am UTC](https://discourse.julialang.org/t/update-old-64-code-to-1-x/31832 "2019-12-04T04:06:21Z")

</div>

Hi guys, I searched the forum, so apologies if I missed this topic. Catalina seems to not play nicely with Julia Pro .64 so I’m trying to update the code to work with 1.x but it’s been a slog. Is there a list somewhere …

---

## [User's input](https://discourse.julialang.org/t/users-input/31825)

<div class="topic-metadata">

**Author:** [@ebasile](https://discourse.julialang.org/u/ebasile)\
**Replies:** 5\
**Last updated:** [December 4, 2019, 1:22am UTC](https://discourse.julialang.org/t/users-input/31825 "2019-12-04T01:22:11Z")

</div>

Hi, I’m trying to generate a user’s input, so i wrote the nexts code lines: function input(prompt) print(prompt) readline() end user\_value = parse(Float64, input(“Age:”)) #Here end the user’s input and continue the…

---

## [Miscellaneous GR questions](https://discourse.julialang.org/t/miscellaneous-gr-questions/31778)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 3\
**Last updated:** [December 3, 2019, 11:59pm UTC](https://discourse.julialang.org/t/miscellaneous-gr-questions/31778 "2019-12-03T23:59:19Z")

</div>

1 is there a “show” equivalent a la matplotlib ? i see one in the GR reference but it doesn’t appear to be mapped through to julia. I’d like for the plot to sit there until i close it. 2 what’s the right way to contin…

---

## [How do I make Revise.jl work in multiple workers environment?](https://discourse.julialang.org/t/how-do-i-make-revise-jl-work-in-multiple-workers-environment/31474)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 2\
**Last updated:** [December 3, 2019, 11:26pm UTC](https://discourse.julialang.org/t/how-do-i-make-revise-jl-work-in-multiple-workers-environment/31474 "2019-12-03T23:26:20Z")

</div>

Hello! I have a simple module file (MyMod.jl), say: module MyMod using Distributed using Base.Threads function func() println("calling func()") r = @spawn sqrt(4) fetch(r) end end # MyMod Now I do the following i…

---

## [Generator Evaluation Order?](https://discourse.julialang.org/t/generator-evaluation-order/31823)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 4\
**Last updated:** [December 3, 2019, 9:53pm UTC](https://discourse.julialang.org/t/generator-evaluation-order/31823 "2019-12-03T21:53:07Z")

</div>

julia\> fun() = begin res = 0 map(tuple, begin ret = ((a=1/(i+j);res+=a;println("VAL = ",res);a) for i=1:2, j=1:2) println("RES : ",res) …

---

## [Possible Bug in Displaying Generator Exprs](https://discourse.julialang.org/t/possible-bug-in-displaying-generator-exprs/31817)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 4\
**Last updated:** [December 3, 2019, 9:23pm UTC](https://discourse.julialang.org/t/possible-bug-in-displaying-generator-exprs/31817 "2019-12-03T21:23:29Z")

</div>

\[Error showing value of type Expr: ERROR: type LineNumberNode has no field args Stacktrace: \[1\] getproperty(::Any, ::Symbol) at ./Base.jl:20 \[2\] show\_generator(::IOContext{REPL.Terminals.TTYTerminal}, ::Expr, ::Int…

---

## [Check if a value is in an enum](https://discourse.julialang.org/t/check-if-a-value-is-in-an-enum/31815)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 3\
**Last updated:** [December 3, 2019, 8:02pm UTC](https://discourse.julialang.org/t/check-if-a-value-is-in-an-enum/31815 "2019-12-03T20:02:15Z")

</div>

Hello, I have an enum like julia\> @enum Fruit apple=1 orange=2 kiwi=3 I can check that apple is a Fruit julia\> apple isa Fruit true But can’t check if 3 is an “allowed” value (ie a value which is used by this enum) …

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

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