# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1992

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

**Page:** 1993

---

## [Evaluate expression in function](https://discourse.julialang.org/t/evaluate-expression-in-function/24402)

<div class="topic-metadata">

**Author:** [@Elmer\_Cusipuma](https://discourse.julialang.org/u/Elmer_Cusipuma)\
**Replies:** 12\
**Last updated:** [May 20, 2019, 11:49pm UTC](https://discourse.julialang.org/t/evaluate-expression-in-function/24402 "2019-05-20T23:49:11Z")

</div>

I have constructed an function like follows: function f(a::Vector{Float64}) for i = 1:length(a) b = eval(Meta.parse(string("a\[",i,"\]"))) println(b) end end Getting this error when I run test c = rand…

---

## [Simple fibonacci function](https://discourse.julialang.org/t/simple-fibonacci-function/24368)

<div class="topic-metadata">

**Author:** [@samusz](https://discourse.julialang.org/u/samusz)\
**Replies:** 5\
**Last updated:** [May 20, 2019, 11:33pm UTC](https://discourse.julialang.org/t/simple-fibonacci-function/24368 "2019-05-20T23:33:06Z")

</div>

julia\> function fib(n::Int) n\<0 && error("n must be non negative") n==1 && return 1 fib(n-1) + fib(n-2) end fib (generic function with 1 method) julia\> fib(2) ERROR: n must be non negative St…

---

## [Julia vs. Chapel performance](https://discourse.julialang.org/t/julia-vs-chapel-performance/24098)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 2\
**Last updated:** [May 20, 2019, 7:41pm UTC](https://discourse.julialang.org/t/julia-vs-chapel-performance/24098 "2019-05-20T19:41:24Z")

</div>

I saw this Julia vs. Chapel performance comparison in the benchmarksgame website. It seems that for all the programs, Chapel is very close to or much faster than Julia. In addition, the Chapel codes are as easy to unders…

---

## [Pinned dependency ignored when adding my package to a fresh install of Julia](https://discourse.julialang.org/t/pinned-dependency-ignored-when-adding-my-package-to-a-fresh-install-of-julia/24410)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 5\
**Last updated:** [May 20, 2019, 6:35pm UTC](https://discourse.julialang.org/t/pinned-dependency-ignored-when-adding-my-package-to-a-fresh-install-of-julia/24410 "2019-05-20T18:35:59Z")

</div>

I’m developing a package with an energy system model (working name “Supergrid”). It’s in a private repo on Github for now but will soon be open sourced. I wanted to test if my package worked on a different machine with a…

---

## [Local filtering of nonuniform points](https://discourse.julialang.org/t/local-filtering-of-nonuniform-points/24407)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 2\
**Last updated:** [May 20, 2019, 5:09pm UTC](https://discourse.julialang.org/t/local-filtering-of-nonuniform-points/24407 "2019-05-20T17:09:28Z")

</div>

Hi! There are packages like LocalFilters and ImageFiltering that can apply a function, e.g. mean, to a rolling window across an array. However, I could not find any package which supports a rolling window defined not by …

---

## [Finding the number of arguments of an anonymous function](https://discourse.julialang.org/t/finding-the-number-of-arguments-of-an-anonymous-function/24394)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 31\
**Last updated:** [May 20, 2019, 4:14pm UTC](https://discourse.julialang.org/t/finding-the-number-of-arguments-of-an-anonymous-function/24394 "2019-05-20T16:14:51Z")

</div>

I have an API wherein a kwarg is a function. function apifunc(; f::Function = identity) ... end I would like to do something different depending on the number of arguments of f, so that apifunc(f = x -\> 2) calls \_apifu…

---

## [Png resolution](https://discourse.julialang.org/t/png-resolution/24330)

<div class="topic-metadata">

**Author:** [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Replies:** 7\
**Last updated:** [May 20, 2019, 2:32pm UTC](https://discourse.julialang.org/t/png-resolution/24330 "2019-05-20T14:32:12Z")

</div>

How can I increase the resolution in a plot saved by png?

---

## [Bunch-Kaufman with rook pivoting](https://discourse.julialang.org/t/bunch-kaufman-with-rook-pivoting/24379)

<div class="topic-metadata">

**Author:** [@dpo](https://discourse.julialang.org/u/dpo)\
**Replies:** 5\
**Last updated:** [May 20, 2019, 2:30pm UTC](https://discourse.julialang.org/t/bunch-kaufman-with-rook-pivoting/24379 "2019-05-20T14:30:32Z")

</div>

I asked this question on Slack but didn’t get an answer. Could someone explain how to use the Bunch-Kaufman factorization with rook pivoting? julia\> A = \[0.271242 0.657867 1.14586; 0.657867 1.20111 1.13588; 1.14586 1.13…

---

## [@btime println("someText")?](https://discourse.julialang.org/t/btime-println-sometext/24401)

<div class="topic-metadata">

**Author:** [@mwolff](https://discourse.julialang.org/u/mwolff)\
**Replies:** 2\
**Last updated:** [May 20, 2019, 2:18pm UTC](https://discourse.julialang.org/t/btime-println-sometext/24401 "2019-05-20T14:18:25Z")

</div>

Hello, what’s wrong with the @btime macro when measuring the println function? Runs zig passes until it stops. Is this normal or is there a parameter that it will stop after a run. With @time there is no problem. bes…

---

## [JuMP - variable constraint depending on variable](https://discourse.julialang.org/t/jump-variable-constraint-depending-on-variable/24313)

<div class="topic-metadata">

**Author:** [@Ulrich](https://discourse.julialang.org/u/Ulrich)\
**Replies:** 5\
**Last updated:** [May 20, 2019, 1:59pm UTC](https://discourse.julialang.org/t/jump-variable-constraint-depending-on-variable/24313 "2019-05-20T13:59:13Z")

</div>

Hey, I need some help with JuMP. I am trying to modell Liquid-Liquid Equilirum. @variable(l, xp1\[1:n\_komp\]) @constraint(l, gammap1 == GAMMAP1(n\_komp, t, xp1)) To do this, I need an activity coeff., which is dependent…

---

## [Dynamic dimensions of optimization variable in JuMP](https://discourse.julialang.org/t/dynamic-dimensions-of-optimization-variable-in-jump/24399)

<div class="topic-metadata">

**Author:** [@lgo](https://discourse.julialang.org/u/lgo)\
**Replies:** 1\
**Last updated:** [May 20, 2019, 1:22pm UTC](https://discourse.julialang.org/t/dynamic-dimensions-of-optimization-variable-in-jump/24399 "2019-05-20T13:22:29Z")

</div>

Hello, Although my question itself is JuMP related, the underlying problem relates to metaprogramming in general: As the title suggests, I want to create a variable, which dimensions change depending on the numeric inp…

---

## [DifferentialEquations Events](https://discourse.julialang.org/t/differentialequations-events/24393)

<div class="topic-metadata">

**Author:** [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Replies:** 3\
**Last updated:** [May 20, 2019, 10:34am UTC](https://discourse.julialang.org/t/differentialequations-events/24393 "2019-05-20T10:34:53Z")

</div>

I want to simulate a hybrid system with many different parameters. They all have the same event function but the location is dependent on the parameters given. Let’s say we have inverted pendulum and I want to give a rev…

---

## [Compile time exponentiation](https://discourse.julialang.org/t/compile-time-exponentiation/24390)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 6\
**Last updated:** [May 20, 2019, 10:09am UTC](https://discourse.julialang.org/t/compile-time-exponentiation/24390 "2019-05-20T10:09:28Z")

</div>

I want to evaluate x^y at compile time. The reason is to facilitate efficient construction of NTuple using ntuple(f, Val(N)) method. Compare bar1 and bar2 functions below: struct Foo end getX(::Foo) = 5 function bar…

---

## [Pkg.instantiate() error](https://discourse.julialang.org/t/pkg-instantiate-error/24386)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 2\
**Last updated:** [May 20, 2019, 6:33am UTC](https://discourse.julialang.org/t/pkg-instantiate-error/24386 "2019-05-20T06:33:12Z")

</div>

Hi, When I start Julia and load packages - e.g. I type using Calculus - I get an error that says it cannot find the package and that I need to use Pkg.instantiate(). After I do that, the package loads. It is annoying as…

---

## [Running in world age ... while current world is](https://discourse.julialang.org/t/running-in-world-age-while-current-world-is/23113)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 9\
**Last updated:** [May 20, 2019, 3:56am UTC](https://discourse.julialang.org/t/running-in-world-age-while-current-world-is/23113 "2019-05-20T03:56:15Z")

</div>

Hi, When I run some functions in Julia I obtain this error: The applicable method may be too new: running in world age 26887, while current world is 26894. If I run the code again, there is no error. This is a systemat…

---

## [JuliaDB: efficiently rank subgroups](https://discourse.julialang.org/t/juliadb-efficiently-rank-subgroups/24299)

<div class="topic-metadata">

**Author:** [@jade\_mackay](https://discourse.julialang.org/u/jade_mackay)\
**Replies:** 2\
**Last updated:** [May 20, 2019, 1:04am UTC](https://discourse.julialang.org/t/juliadb-efficiently-rank-subgroups/24299 "2019-05-20T01:04:37Z")

</div>

Hi, I would be grateful for some advice on how to create a column containing the ordinal rank of a score grouped by another column. For example: using JuliaDB using StatsBase Nx, Ny = 4, 3 x = repeat(1:Nx,inner=Ny) # l…

---

## [Hi. Trying to add Julia to the PATH on my Mac Book Pro.](https://discourse.julialang.org/t/hi-trying-to-add-julia-to-the-path-on-my-mac-book-pro/24369)

<div class="topic-metadata">

**Author:** [@paulgureghian](https://discourse.julialang.org/u/paulgureghian)\
**Replies:** 7\
**Last updated:** [May 20, 2019, 12:17am UTC](https://discourse.julialang.org/t/hi-trying-to-add-julia-to-the-path-on-my-mac-book-pro/24369 "2019-05-20T00:17:48Z")

</div>

Thanks.

---

## [Parametric method type matching issue](https://discourse.julialang.org/t/parametric-method-type-matching-issue/24383)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 10\
**Last updated:** [May 19, 2019, 11:47pm UTC](https://discourse.julialang.org/t/parametric-method-type-matching-issue/24383 "2019-05-19T23:47:39Z")

</div>

Consider this function foo(x::T, y::S) where {T \<: Integer, S \<: T} = 1 I read it as y has a type of S type S should be a subtype of T type T should be a subtype of Integer But, I can do julia\> foo(1, 0x00) 1 T…

---

## [Flux support for sparse CuArrays](https://discourse.julialang.org/t/flux-support-for-sparse-cuarrays/24387)

<div class="topic-metadata">

**Author:** [@rayegun](https://discourse.julialang.org/u/rayegun)\
**Replies:** 0\
**Last updated:** [May 19, 2019, 9:03pm UTC](https://discourse.julialang.org/t/flux-support-for-sparse-cuarrays/24387 "2019-05-19T21:03:38Z")

</div>

Hey. I opened an issue on GitHub in the CuArrays repo but this may be a better avenue. Does Flux support (fully/partially) the sparse arrays implemented in that repo? Are there any hidden errors/issues I should be aware…

---

## [Can we make a comparison/overview of different GPU computing implementations?](https://discourse.julialang.org/t/can-we-make-a-comparison-overview-of-different-gpu-computing-implementations/24294)

<div class="topic-metadata">

**Author:** [@freemint](https://discourse.julialang.org/u/freemint)\
**Replies:** 6\
**Last updated:** [May 19, 2019, 7:26pm UTC](https://discourse.julialang.org/t/can-we-make-a-comparison-overview-of-different-gpu-computing-implementations/24294 "2019-05-19T19:26:46Z")

</div>

Hello, I am overwhelmed by the sheer number of GPU computing libraries. Every day i look into it i find a new implementation so far i found: CuArrays CUDAnative ArrayFire Knet.Arrays CLArrays AMDGPUnative Vulkan and…

---

## [Makie user defined marker example?](https://discourse.julialang.org/t/makie-user-defined-marker-example/24346)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 2\
**Last updated:** [May 19, 2019, 4:38pm UTC](https://discourse.julialang.org/t/makie-user-defined-marker-example/24346 "2019-05-19T16:38:31Z")

</div>

Hi, It try to set up an animation for colliding polygons with Makie. It is OK if a use poly! and pass new polygon coordinates at each time steps but I guess that it would be more efficient If I use scatter! with user d…

---

## [Some nice-to-have syntax](https://discourse.julialang.org/t/some-nice-to-have-syntax/24331)

<div class="topic-metadata">

**Author:** [@tkluck](https://discourse.julialang.org/u/tkluck)\
**Replies:** 16\
**Last updated:** [May 19, 2019, 2:03pm UTC](https://discourse.julialang.org/t/some-nice-to-have-syntax/24331 "2019-05-19T14:03:21Z")

</div>

Here’s two syntax features I think would be nice additions: allow newline before where, so I can nicely align my arguments: function f(x::T, y::S) where T \<: AbstractMatrix{El} where S \<: AbstractVec…

---

## [How to call and get var to/from file.exe](https://discourse.julialang.org/t/how-to-call-and-get-var-to-from-file-exe/24359)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 4\
**Last updated:** [May 19, 2019, 6:42am UTC](https://discourse.julialang.org/t/how-to-call-and-get-var-to-from-file-exe/24359 "2019-05-19T06:42:37Z")

</div>

in C++ int main() { return 70; } compiled program zwrot.exe julia\> cmd = Cmd(\`zwrot.exe\`) \`zwrot.exe\` julia\> run(cmd) ERROR: failed process: Process(\`zwrot.exe\`, ProcessExited(70)) \[70\] Stacktrace: \[1\] error(::S…

---

## [Unexpected output for @which with keyword constructor](https://discourse.julialang.org/t/unexpected-output-for-which-with-keyword-constructor/24373)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 2\
**Last updated:** [May 19, 2019, 10:31am UTC](https://discourse.julialang.org/t/unexpected-output-for-which-with-keyword-constructor/24373 "2019-05-19T10:31:15Z")

</div>

The output for @which Hammer(weight = 25) is not what I expected, nor is it consistent with the other invocations. Not sure if bug, known issue, or by design: abstract type Product end abstract type Tool \<: Product end…

---

## [Base.nonmissingtype and Core.Compiler.typesubtract aren't exported](https://discourse.julialang.org/t/base-nonmissingtype-and-core-compiler-typesubtract-arent-exported/24367)

<div class="topic-metadata">

**Author:** [@Diego\_Javier\_Zea](https://discourse.julialang.org/u/Diego_Javier_Zea)\
**Replies:** 1\
**Last updated:** [May 19, 2019, 10:30am UTC](https://discourse.julialang.org/t/base-nonmissingtype-and-core-compiler-typesubtract-arent-exported/24367 "2019-05-19T10:30:20Z")

</div>

Hi! I was trying to create new arrays a, b with the not missing elements of A and B, respectively and I want to exclude Missing from the element type of a and b. Sadly, Base.nonmissingtype and Core.Compiler.typesubtra…

---

## [Is there a terminal command to upgrade from 1.1.0 to 1.1.1  ?](https://discourse.julialang.org/t/is-there-a-terminal-command-to-upgrade-from-1-1-0-to-1-1-1/24301)

<div class="topic-metadata">

**Author:** [@paulgureghian](https://discourse.julialang.org/u/paulgureghian)\
**Replies:** 8\
**Last updated:** [May 19, 2019, 7:30am UTC](https://discourse.julialang.org/t/is-there-a-terminal-command-to-upgrade-from-1-1-0-to-1-1-1/24301 "2019-05-19T07:30:59Z")

</div>

I installed Julia from a binary.

---

## [Compilation times for long static vectors are increasing](https://discourse.julialang.org/t/compilation-times-for-long-static-vectors-are-increasing/24371)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 2\
**Last updated:** [May 19, 2019, 7:22am UTC](https://discourse.julialang.org/t/compilation-times-for-long-static-vectors-are-increasing/24371 "2019-05-19T07:22:19Z")

</div>

I recently got my hands on the 1.3 nightly binary and noticed a huge increase in compilation time for my code using static arrays. This goes against what I’ve noticed for most other code, which generally compiles faster …

---

## [Type annotation for one-line parametric methods](https://discourse.julialang.org/t/type-annotation-for-one-line-parametric-methods/21446)

<div class="topic-metadata">

**Author:** [@pnalysz](https://discourse.julialang.org/u/pnalysz)\
**Replies:** 2\
**Last updated:** [May 19, 2019, 1:50am UTC](https://discourse.julialang.org/t/type-annotation-for-one-line-parametric-methods/21446 "2019-05-19T01:50:00Z")

</div>

Hi, Why do I get error for f3 while both f1 and f2 are correct? Is there any special syntax for type annotation of one-line parametric methods? function f1(v::Base.Vector{T})::Core.Bool where {T} return true end f…

---

## [Changing default package installation directory](https://discourse.julialang.org/t/changing-default-package-installation-directory/24363)

<div class="topic-metadata">

**Author:** [@devlwkyan](https://discourse.julialang.org/u/devlwkyan)\
**Replies:** 1\
**Last updated:** [May 18, 2019, 10:06pm UTC](https://discourse.julialang.org/t/changing-default-package-installation-directory/24363 "2019-05-18T22:06:30Z")

</div>

Is there are way to change the default Julia package installation directory from /home/user/./julia to some other location on linux?

---

## [Polynomial Roots With Multiplicities](https://discourse.julialang.org/t/polynomial-roots-with-multiplicities/24309)

<div class="topic-metadata">

**Author:** [@Hans\_W\_Borchers](https://discourse.julialang.org/u/Hans_W_Borchers)\
**Replies:** 8\
**Last updated:** [May 18, 2019, 9:12pm UTC](https://discourse.julialang.org/t/polynomial-roots-with-multiplicities/24309 "2019-05-18T21:12:54Z")

</div>

When using the roots function from the Polynomials package, the values found for multiple roots can be quite inaccurate. Just as an example, here is the polynomial with zeros at 1 and -1, each of multiplicity 4. julia\> …

[Previous page](https://discourse.julialang.org/latest.md?page=1991)

[Next page](https://discourse.julialang.org/latest.md?page=1993)
