# Latest

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

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

**Page:** 1686

---

## [Confusion regarding Threads.@spawn performance](https://discourse.julialang.org/t/confusion-regarding-threads-spawn-performance/43210)

<div class="topic-metadata">

**Author:** [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Replies:** 4\
**Last updated:** [July 19, 2020, 4:43am UTC](https://discourse.julialang.org/t/confusion-regarding-threads-spawn-performance/43210 "2020-07-19T04:43:27Z")

</div>

I’m not able to use Threads.@spawn with the kind of performance I’d expect: samuela@n64:~/dev/research/julia/odecontrol$ JULIA\_NUM\_THREADS=32 julia --project \_ \_ \_ \_(\_)\_ | Documentation: htt…

---

## ['Reducing' scope of global variables in functions](https://discourse.julialang.org/t/reducing-scope-of-global-variables-in-functions/43256)

<div class="topic-metadata">

**Author:** [@1ozturkbe](https://discourse.julialang.org/u/1ozturkbe)\
**Replies:** 9\
**Last updated:** [July 19, 2020, 2:34am UTC](https://discourse.julialang.org/t/reducing-scope-of-global-variables-in-functions/43256 "2020-07-19T02:34:04Z")

</div>

I have a question with respect to globals in functions. I rely a lot on generating functions inside functions that take in data arguments. However, I am finding that changing the data (eg. a and idxs in the global scope …

---

## [Performance of findmax vs. raw loop](https://discourse.julialang.org/t/performance-of-findmax-vs-raw-loop/43305)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 12\
**Last updated:** [July 19, 2020, 1:23am UTC](https://discourse.julialang.org/t/performance-of-findmax-vs-raw-loop/43305 "2020-07-19T01:23:24Z")

</div>

I’m curious if there is a high level concept to find maximum element and index in mapped array, which has similar performance to raw loop. I’m comparing f4 and f5: using BenchmarkTools, Random, StaticArrays, LinearAlgeb…

---

## [Summation of rows of array without allocation](https://discourse.julialang.org/t/summation-of-rows-of-array-without-allocation/43313)

<div class="topic-metadata">

**Author:** [@aaraujo71](https://discourse.julialang.org/u/aaraujo71)\
**Replies:** 1\
**Last updated:** [July 18, 2020, 11:42pm UTC](https://discourse.julialang.org/t/summation-of-rows-of-array-without-allocation/43313 "2020-07-18T23:42:14Z")

</div>

Suppose we have an array x with m rows and n columns and a vector s with m elements. I would like to sum the elements of each row of array x and save these results in vector s. This can be easily implemented in Julia us…

---

## [ForwardDiffSensitivity() and TrackerAdjoint() give different answers](https://discourse.julialang.org/t/forwarddiffsensitivity-and-trackeradjoint-give-different-answers/43254)

<div class="topic-metadata">

**Author:** [@fernando-duarte](https://discourse.julialang.org/u/fernando-duarte)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 10:57pm UTC](https://discourse.julialang.org/t/forwarddiffsensitivity-and-trackeradjoint-give-different-answers/43254 "2020-07-18T22:57:16Z")

</div>

using DiffEqSensitivity, OrdinaryDiffEq, Zygote, StochasticDiffEq # similar to documentation, but out-of-place function fiip(u,p,t) du1 = dx = p\[1\]\*u\[1\] - p\[2\]\*u\[1\]\*u\[2\] du2 = dy = -p\[3\]\*u\[2\] + p\[4\]\*u\[1\]\*u\[2\] ret…

---

## [Understanding the dangers of abusing multiple dispatch](https://discourse.julialang.org/t/understanding-the-dangers-of-abusing-multiple-dispatch/43301)

<div class="topic-metadata">

**Author:** [@Bryan\_So](https://discourse.julialang.org/u/Bryan_So)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 10:44pm UTC](https://discourse.julialang.org/t/understanding-the-dangers-of-abusing-multiple-dispatch/43301 "2020-07-18T22:44:01Z")

</div>

Hi, I’d like to understand more about this topic: The dangers of abusing multiple dispatch https://docs.julialang.org/en/v1.6-dev/manual/performance-tips/#The-dangers-of-abusing-multiple-dispatch-(aka,-more-on-types-wi…

---

## [Round inplace?](https://discourse.julialang.org/t/round-inplace/43298)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 9\
**Last updated:** [July 18, 2020, 9:07pm UTC](https://discourse.julialang.org/t/round-inplace/43298 "2020-07-18T21:07:39Z")

</div>

What is the reason that there are not round! functions? Is it not possible to do that type of operation in place? It seems like it is no different than replace! (which exists) and the thing you are replacing with is simp…

---

## [HTTP.jl websockets - iterator?](https://discourse.julialang.org/t/http-jl-websockets-iterator/43299)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 0\
**Last updated:** [July 18, 2020, 5:45pm UTC](https://discourse.julialang.org/t/http-jl-websockets-iterator/43299 "2020-07-18T17:45:30Z")

</div>

I’m not sure if this is an HTTP.jl usage question or really a design question, but in any case… I’m trying to code an application for which I can seamlessly swap the bit that provides it with streaming data, and I want …

---

## [Error: JuMP constraint vs Array constraint (same size) --\> ArgumentError: Broadcasting](https://discourse.julialang.org/t/error-jump-constraint-vs-array-constraint-same-size-argumenterror-broadcasting/42812)

<div class="topic-metadata">

**Author:** [@PabloGalaz](https://discourse.julialang.org/u/PabloGalaz)\
**Replies:** 2\
**Last updated:** [July 18, 2020, 7:27pm UTC](https://discourse.julialang.org/t/error-jump-constraint-vs-array-constraint-same-size-argumenterror-broadcasting/42812 "2020-07-18T19:27:55Z")

</div>

Hello everyone, I’m using Julia v1.4.2 and JuMP v0.21.2 to solve a optimization problem. I want to compare a decision variable with an array of zeros and a calculated array (with other array and another decision variabl…

---

## [\[ANN\] CSV.jl 0.7 Release](https://discourse.julialang.org/t/ann-csv-jl-0-7-release/42162)

<div class="topic-metadata">

**Author:** [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Replies:** 38\
**Last updated:** [July 18, 2020, 7:18pm UTC](https://discourse.julialang.org/t/ann-csv-jl-0-7-release/42162 "2020-07-18T19:18:17Z")

</div>

I’m happy to announce a new 0.7 release of the CSV.jl package. This is the last anticipated release before an official 1.0 release, and can be considered a 1.0 “trial run”. Major changes include: Deprecations CSV.read(…

---

## [Asking again about tick labels in Makie](https://discourse.julialang.org/t/asking-again-about-tick-labels-in-makie/43304)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 0\
**Last updated:** [July 18, 2020, 7:08pm UTC](https://discourse.julialang.org/t/asking-again-about-tick-labels-in-makie/43304 "2020-07-18T19:08:20Z")

</div>

Hellos :vulcan\_salute: I come upon this post of how to change tick labels with Makie, but is it not working because NT is not defined. Looking at Makie documentation, the solution should be the function: Function xtic…

---

## [Unintuitive behaviour with BenchmarkTools](https://discourse.julialang.org/t/unintuitive-behaviour-with-benchmarktools/43291)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 12\
**Last updated:** [July 18, 2020, 5:39pm UTC](https://discourse.julialang.org/t/unintuitive-behaviour-with-benchmarktools/43291 "2020-07-18T17:39:03Z")

</div>

I’m baffled by this error. Here is the relevant code fragment: function f1(p) total = 0. for i in 1:length(p)-2 q = p\[i\] a = p\[i+1\] b = p\[i+2\] dx = b.x - a.x dy = b.y - …

---

## [Travis, Documentation, Codecov: need a review?](https://discourse.julialang.org/t/travis-documentation-codecov-need-a-review/43293)

<div class="topic-metadata">

**Author:** [@DataPsycho](https://discourse.julialang.org/u/DataPsycho)\
**Replies:** 1\
**Last updated:** [July 18, 2020, 5:17pm UTC](https://discourse.julialang.org/t/travis-documentation-codecov-need-a-review/43293 "2020-07-18T17:17:07Z")

</div>

Hi, I am new to Julia and TDD. I have created a new package in Julia. I have run the test locally. I can create the documentation locally with Documenter.jl. But I am not sure why The build is failing Where to add the …

---

## [Surprised by randcycle](https://discourse.julialang.org/t/surprised-by-randcycle/43286)

<div class="topic-metadata">

**Author:** [@Oystein\_Rognes\_Solhe](https://discourse.julialang.org/u/Oystein_Rognes_Solhe)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 4:10pm UTC](https://discourse.julialang.org/t/surprised-by-randcycle/43286 "2020-07-18T16:10:21Z")

</div>

Hi, first time poster here! I am fooling around with cyclic permutations today in Julia 1.4.2 and was surprised to see that the randcycle function in Random do not include the identity permutation. As an example: julia\>…

---

## [Any function return inference in Julia \>1.3?](https://discourse.julialang.org/t/any-function-return-inference-in-julia-1-3/43290)

<div class="topic-metadata">

**Author:** [@tro3](https://discourse.julialang.org/u/tro3)\
**Replies:** 2\
**Last updated:** [July 18, 2020, 4:00pm UTC](https://discourse.julialang.org/t/any-function-return-inference-in-julia-1-3/43290 "2020-07-18T16:00:26Z")

</div>

Has there been any addition in Julia 1.4/1.5 of function return inference, given arg types? As of Julia 1.3, I was using \_detect\_type(fn, itr) = eltype(map(fn, empty(itr))) function myfunc(fn, itr) result = Vector{\_…

---

## [Unfortunate interaction between ImageCore and Gadfly](https://discourse.julialang.org/t/unfortunate-interaction-between-imagecore-and-gadfly/43287)

<div class="topic-metadata">

**Author:** [@NicholasWMRitchie](https://discourse.julialang.org/u/NicholasWMRitchie)\
**Replies:** 1\
**Last updated:** [July 18, 2020, 3:39pm UTC](https://discourse.julialang.org/t/unfortunate-interaction-between-imagecore-and-gadfly/43287 "2020-07-18T15:39:36Z")

</div>

I’ve discovered an unfortunate interaction in which just loading ImageCore causes Gadfly to fail. This took me days to debug :frowning: as initially I assumed the error was in my code. It was only when I guessed that t…

---

## [What does sizeof return for wrappers of arrays?](https://discourse.julialang.org/t/what-does-sizeof-return-for-wrappers-of-arrays/43237)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [July 17, 2020, 3:21pm UTC](https://discourse.julialang.org/t/what-does-sizeof-return-for-wrappers-of-arrays/43237 "2020-07-17T15:21:39Z")

</div>

Eg: julia\> a = ones(10); julia\> sizeof(a) 80 julia\> sizeof(a') 8 julia\> a = ones(ComplexF64, 10); julia\> sizeof(a') 8 I’m not sure how to interpret the results for the adjoint? Similar issues arise for OffsetArrays…

---

## [Built-in vs. user-defined functions](https://discourse.julialang.org/t/built-in-vs-user-defined-functions/43213)

<div class="topic-metadata">

**Author:** [@andreas.karatzas](https://discourse.julialang.org/u/andreas.karatzas)\
**Replies:** 13\
**Last updated:** [July 18, 2020, 2:07pm UTC](https://discourse.julialang.org/t/built-in-vs-user-defined-functions/43213 "2020-07-18T14:07:50Z")

</div>

Hello, I am relatively new to Julia. I am mainly interested in Julia because of the performance. There are some functions that are built in Julia like sum(). A custom sum function is worse in performance than the built-…

---

## [How to understand place of numbers with Irrational type in Julia?](https://discourse.julialang.org/t/how-to-understand-place-of-numbers-with-irrational-type-in-julia/43258)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 2\
**Last updated:** [July 18, 2020, 1:35pm UTC](https://discourse.julialang.org/t/how-to-understand-place-of-numbers-with-irrational-type-in-julia/43258 "2020-07-18T13:35:32Z")

</div>

I recently try to understand how numbers of Irrational type as \\pi, e, \\gamma (Euler-Mascheroni constant) works in Julia. At these moment I think of them as living in vast space between constants floating points approxim…

---

## [JuAFEM mesh issue](https://discourse.julialang.org/t/juafem-mesh-issue/41467)

<div class="topic-metadata">

**Author:** [@bocc](https://discourse.julialang.org/u/bocc)\
**Replies:** 19\
**Last updated:** [July 18, 2020, 1:07pm UTC](https://discourse.julialang.org/t/juafem-mesh-issue/41467 "2020-07-18T13:07:36Z")

</div>

Hello, sorry in advance for posting this here, as this is most likely not a JuAFEM issue, but a problem with an external mesh. Also apologies for not being able to create a copy-pastable MWE. Any insight is appreciated …

---

## [How to print string with assigned variable and an "!" character?](https://discourse.julialang.org/t/how-to-print-string-with-assigned-variable-and-an-character/43275)

<div class="topic-metadata">

**Author:** [@hismawan](https://discourse.julialang.org/u/hismawan)\
**Replies:** 6\
**Last updated:** [July 18, 2020, 12:47pm UTC](https://discourse.julialang.org/t/how-to-print-string-with-assigned-variable-and-an-character/43275 "2020-07-18T12:47:58Z")

</div>

I tried a simple code with julia: x = readline() print(String(“Hello, $x!”)) and Julia took the variable as “x!”, instead of “x”. But, it was just fine when I changed the “!” with “.” Is “!” a special character or e…

---

## [FiniteDiff.finite\_difference\_gradient changes input when it errors?](https://discourse.julialang.org/t/finitediff-finite-difference-gradient-changes-input-when-it-errors/43279)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 12:45pm UTC](https://discourse.julialang.org/t/finitediff-finite-difference-gradient-changes-input-when-it-errors/43279 "2020-07-18T12:45:01Z")

</div>

I ran into a surprising thing today. Consider the function sumlog: function sumlog(x) sum(log(i) for i in x) end I’m interested in taking the gradient of sumlog at x: using FiniteDiff x = \[1e-6, 1e-6\] FiniteDiff…

---

## [Subvector of SVector](https://discourse.julialang.org/t/subvector-of-svector/43273)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 2\
**Last updated:** [July 18, 2020, 12:42pm UTC](https://discourse.julialang.org/t/subvector-of-svector/43273 "2020-07-18T12:42:46Z")

</div>

In this code snippet: using StaticArrays Vec2f = SVector{2, Float32} Vec3f = SVector{3, Float32} a = Vec3f(1, 2, 3) b = a\[1:2\] c = a\[\[true, false, true\]\] b and c type is Array{Float32,1}. How do I ma…

---

## [Surprising StackOverflowError](https://discourse.julialang.org/t/surprising-stackoverflowerror/43277)

<div class="topic-metadata">

**Author:** [@Bigorneau](https://discourse.julialang.org/u/Bigorneau)\
**Replies:** 2\
**Last updated:** [July 18, 2020, 12:40pm UTC](https://discourse.julialang.org/t/surprising-stackoverflowerror/43277 "2020-07-18T12:40:44Z")

</div>

I encountered a surprising error today. The following two lines result in a StackOverflowError (with Julia 1.4.2): f(x::T, y::T, z::S) where {S,T\<:Vector{S}} = "method 1" f(x::T, z::S, y::T) where {S,T\<:Vector{S}} = "me…

---

## [JSON write and read back Arrays](https://discourse.julialang.org/t/json-write-and-read-back-arrays/43283)

<div class="topic-metadata">

**Author:** [@sz1992](https://discourse.julialang.org/u/sz1992)\
**Replies:** 2\
**Last updated:** [July 18, 2020, 12:38pm UTC](https://discourse.julialang.org/t/json-write-and-read-back-arrays/43283 "2020-07-18T12:38:21Z")

</div>

I would like to write some multi-D Array into JSON and parse it back. I tried using JSON.jl : julia\> using JSON julia\> ar=rand(2,2,2) 2×2×2 Array{Float64,3}: \[:, :, 1\] = 0.238296 0.813746 0.156503 0.953343 \[:,…

---

## [Difference between Base.product and Iterators.product?](https://discourse.julialang.org/t/difference-between-base-product-and-iterators-product/43263)

<div class="topic-metadata">

**Author:** [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 11:16am UTC](https://discourse.julialang.org/t/difference-between-base-product-and-iterators-product/43263 "2020-07-18T11:16:18Z")

</div>

They seem identical down to the documentation: help?\> Base.product product(iters...) Return an iterator over the product of several iterators. Each generated element is a tuple whose ith element comes from the it…

---

## [Port Julia to the GraalVM](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194)

<div class="topic-metadata">

**Author:** [@KenziTrader](https://discourse.julialang.org/u/KenziTrader)\
**Replies:** 4\
**Last updated:** [July 18, 2020, 10:57am UTC](https://discourse.julialang.org/t/port-julia-to-the-graalvm/33194 "2020-07-18T10:57:16Z")

</div>

The GraalVM allows to combine code written in JVM-based languages such as Java, Scala, and Kotlin, but also other programming languages such as JavaScript, Ruby, Python, and R. I would like to be able to use Julia as wel…

---

## [Is there a way to set Non Negativity, with CVODE\_BDF()~ Sundials Pkg, as isoutofdomain() was ignored-Thanks?](https://discourse.julialang.org/t/is-there-a-way-to-set-non-negativity-with-cvode-bdf-sundials-pkg-as-isoutofdomain-was-ignored-thanks/42960)

<div class="topic-metadata">

**Author:** [@cbasile21](https://discourse.julialang.org/u/cbasile21)\
**Replies:** 7\
**Last updated:** [July 18, 2020, 2:27am UTC](https://discourse.julialang.org/t/is-there-a-way-to-set-non-negativity-with-cvode-bdf-sundials-pkg-as-isoutofdomain-was-ignored-thanks/42960 "2020-07-18T02:27:09Z")

</div>

Hello there, Earlier I had asked a question about prevent Domain errors , and non-negativity, Related to this, I want to apply this to CVODE\_BDF, but I believe is not compatible with Sundials, it raises the error it …

---

## [Performance issue when searching for an occurrence in larger matrix](https://discourse.julialang.org/t/performance-issue-when-searching-for-an-occurrence-in-larger-matrix/43209)

<div class="topic-metadata">

**Author:** [@a.fas](https://discourse.julialang.org/u/a.fas)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 1:11am UTC](https://discourse.julialang.org/t/performance-issue-when-searching-for-an-occurrence-in-larger-matrix/43209 "2020-07-18T01:11:39Z")

</div>

I wrote some code that searches a large matrix to find occurrences of a given vector. MWE: A = repeat(\[1 2 3; 4 5 6; 7 8 9\], 100, 1); b = \[4; 5; 6\]; In this case, what I would want is a boolean vector that is true for …

---

## [Dispatch on all binary operations](https://discourse.julialang.org/t/dispatch-on-all-binary-operations/43269)

<div class="topic-metadata">

**Author:** [@AnderGray](https://discourse.julialang.org/u/AnderGray)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 1:05am UTC](https://discourse.julialang.org/t/dispatch-on-all-binary-operations/43269 "2020-07-18T01:05:19Z")

</div>

Hi all, been using Julia for sometime now, first time I’m posting here. Is it possible for me to dispatch over all binary operations which have specific type arguments? I’m working on a Fuzzy Arithmetic package, where …

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

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