# Latest

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

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

**Page:** 1075

---

## [Licensing when writing a package from a research paper](https://discourse.julialang.org/t/licensing-when-writing-a-package-from-a-research-paper/79080)

<div class="topic-metadata">

**Author:** [@garrek](https://discourse.julialang.org/u/garrek)\
**Replies:** 5\
**Last updated:** [April 7, 2022, 1:25am UTC](https://discourse.julialang.org/t/licensing-when-writing-a-package-from-a-research-paper/79080 "2022-04-07T01:25:09Z")

</div>

I am writing a Julia package based on a research paper (implementing an electrodynamics algorithm). At some point I realized that the authors had implemented their algorithm in Python with a GPL 3 license. (Their code is…

---

## [Limit number of threads from Threads.@threads](https://discourse.julialang.org/t/limit-number-of-threads-from-threads-threads/79118)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 4\
**Last updated:** [April 6, 2022, 10:38pm UTC](https://discourse.julialang.org/t/limit-number-of-threads-from-threads-threads/79118 "2022-04-06T22:38:26Z")

</div>

Is there any way to limit the number of threads used in Threads.@threads loops (for instance, use at most 3 threads)? I have a nested function where both inner and outer function does multithreading, but due to memory c…

---

## [Weird behavior assigning values to initialized vector of matrices?](https://discourse.julialang.org/t/weird-behavior-assigning-values-to-initialized-vector-of-matrices/79128)

<div class="topic-metadata">

**Author:** [@poopsilon](https://discourse.julialang.org/u/poopsilon)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 10:19pm UTC](https://discourse.julialang.org/t/weird-behavior-assigning-values-to-initialized-vector-of-matrices/79128 "2022-04-06T22:19:06Z")

</div>

I came across a behavior of arrays of arrays that I find unintuitive. I suspect I might be missing something basic here. I think the following illustrates the behavior. Suppose I make a vector of matrices julia\> V = Ve…

---

## [Optional positional arguments must occur at end](https://discourse.julialang.org/t/optional-positional-arguments-must-occur-at-end/79051)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 12\
**Last updated:** [April 6, 2022, 9:46pm UTC](https://discourse.julialang.org/t/optional-positional-arguments-must-occur-at-end/79051 "2022-04-06T21:46:52Z")

</div>

It seems to me that wanting optional arguments not at end needs unnecessary contortions in Julia. Here is a typical example: julia\> test(io::IO=stdout,x)=print(io,x) ERROR: syntax: optional positional arguments must oc…

---

## [Inconsistency between zero(x) and zero(T::Type) for matrices](https://discourse.julialang.org/t/inconsistency-between-zero-x-and-zero-t-type-for-matrices/79117)

<div class="topic-metadata">

**Author:** [@Tbl](https://discourse.julialang.org/u/Tbl)\
**Replies:** 6\
**Last updated:** [April 6, 2022, 8:58pm UTC](https://discourse.julialang.org/t/inconsistency-between-zero-x-and-zero-t-type-for-matrices/79117 "2022-04-06T20:58:57Z")

</div>

I was experimenting with function sum and found out that it does not work for empty collections of matrices, Julia 1.7.2. The reason is there is no method zero(::Type{Array{T,N}}), thus you must specify init manually. Ho…

---

## [BifurcationKit.jl incorrect automatic branch switching at simple branch point](https://discourse.julialang.org/t/bifurcationkit-jl-incorrect-automatic-branch-switching-at-simple-branch-point/78721)

<div class="topic-metadata">

**Author:** [@sceptri](https://discourse.julialang.org/u/sceptri)\
**Replies:** 8\
**Last updated:** [April 6, 2022, 8:46pm UTC](https://discourse.julialang.org/t/bifurcationkit-jl-incorrect-automatic-branch-switching-at-simple-branch-point/78721 "2022-04-06T20:46:02Z")

</div>

Hello, I have a simple 2D system and I tried continuation from simple branch points using Plots, BifurcationKit, Setfield, ForwardDiff, Parameters const BK = BifurcationKit function f(x,p) @unpack a,g,γ,r,d = p M,C =…

---

## [Recurrent Neural Networks using Julia](https://discourse.julialang.org/t/recurrent-neural-networks-using-julia/79119)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 8:30pm UTC](https://discourse.julialang.org/t/recurrent-neural-networks-using-julia/79119 "2022-04-06T20:30:50Z")

</div>

Consider the following simple situation: I have a timeseries of IBM stock (a simple array of 5000 prices) and I want to predict the next price given that data. How can I use Julia to create a Recurrent Neural Networks a…

---

## [Can't make head nor tails of this error message: package won't compile](https://discourse.julialang.org/t/cant-make-head-nor-tails-of-this-error-message-package-wont-compile/79121)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 8:25pm UTC](https://discourse.julialang.org/t/cant-make-head-nor-tails-of-this-error-message-package-wont-compile/79121 "2022-04-06T20:25:53Z")

</div>

Failed to precompile CovidSim\_ilm \[top-level\] to /Users/lewis/.julia/compiled/v1.7/jl\_B3U1A7. Stacktrace: \[1\] error(s::String) @ Base ./error.jl:33 \[2\] compilecache(pkg::Base.PkgId, path::String, internal\_stderr…

---

## [Function argument not being updated correctly](https://discourse.julialang.org/t/function-argument-not-being-updated-correctly/79105)

<div class="topic-metadata">

**Author:** [@staufenbach](https://discourse.julialang.org/u/staufenbach)\
**Replies:** 4\
**Last updated:** [April 6, 2022, 6:08pm UTC](https://discourse.julialang.org/t/function-argument-not-being-updated-correctly/79105 "2022-04-06T18:08:36Z")

</div>

hi, i have a mutable struct representing an octree. its contains various info such as the list of all particle (another struct) inside it. I passed it as an argument of a function that should modify it. but only some pa…

---

## [Adding Error Bars To Legend](https://discourse.julialang.org/t/adding-error-bars-to-legend/79018)

<div class="topic-metadata">

**Author:** [@cmdenis](https://discourse.julialang.org/u/cmdenis)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 7:18pm UTC](https://discourse.julialang.org/t/adding-error-bars-to-legend/79018 "2022-04-06T19:18:52Z")

</div>

Hi, I’m trying to make a plot (with Plots) with some data points. I’d like to be able to add an entry to the legend labeling the error bars. So far I have something of the sort: scatter( rand(10), yerr = rand(…

---

## [Understanding @time memory allocations](https://discourse.julialang.org/t/understanding-time-memory-allocations/79075)

<div class="topic-metadata">

**Author:** [@qt\_codes](https://discourse.julialang.org/u/qt_codes)\
**Replies:** 7\
**Last updated:** [April 6, 2022, 5:44pm UTC](https://discourse.julialang.org/t/understanding-time-memory-allocations/79075 "2022-04-06T17:44:35Z")

</div>

I am timing a function in my code am confused as to why my memory allocations while compiling go up when I make the input smaller. The function is called twice, so I can look at pre and post compiling. @time begin m…

---

## [Incorrect function evaluation in Zygote when swapping variables](https://discourse.julialang.org/t/incorrect-function-evaluation-in-zygote-when-swapping-variables/79082)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 5:42pm UTC](https://discourse.julialang.org/t/incorrect-function-evaluation-in-zygote-when-swapping-variables/79082 "2022-04-06T17:42:36Z")

</div>

I have a relatively concise routine cheby that evaluates Φ = exp(-i H dt) Ψ for a Hermitian matrix H and a complex vector Ψ by expanding the exponential into Cheybchev polynomials. A minimal working example adapted from t…

---

## [Optimization Technique in JuMP model](https://discourse.julialang.org/t/optimization-technique-in-jump-model/79108)

<div class="topic-metadata">

**Author:** [@iAnkiit](https://discourse.julialang.org/u/iAnkiit)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 4:57pm UTC](https://discourse.julialang.org/t/optimization-technique-in-jump-model/79108 "2022-04-06T16:57:55Z")

</div>

Could someone please tell , which optimization technique /algorithm JuMP model uses ? like, when we perform : “optimize! (model)” ? Or, is it completely solver dependent ?

---

## [Registering information to a module global dict using macros](https://discourse.julialang.org/t/registering-information-to-a-module-global-dict-using-macros/77766)

<div class="topic-metadata">

**Author:** [@mkschleg](https://discourse.julialang.org/u/mkschleg)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 4:44pm UTC](https://discourse.julialang.org/t/registering-information-to-a-module-global-dict-using-macros/77766 "2022-04-06T16:44:07Z")

</div>

Hello! I’m trying to get some convenience functionality working for a macro I’m working on. What I want to do is register a key and where this key occurs in both the internal package and external uses of the package. You…

---

## [Efficiently interpreting byte-packed buffer](https://discourse.julialang.org/t/efficiently-interpreting-byte-packed-buffer/78975)

<div class="topic-metadata">

**Author:** [@nhardy](https://discourse.julialang.org/u/nhardy)\
**Replies:** 31\
**Last updated:** [April 6, 2022, 4:41pm UTC](https://discourse.julialang.org/t/efficiently-interpreting-byte-packed-buffer/78975 "2022-04-06T16:41:06Z")

</div>

tl;dr Is there a built-in way to interpret (or instantiate from) a byte-packed buffer to a Julia struct? If not, is there an efficient, non-allocating method to instantiate a new struct from the buffer data? I am repl…

---

## [Postgresql Read from multi-processing](https://discourse.julialang.org/t/postgresql-read-from-multi-processing/79068)

<div class="topic-metadata">

**Author:** [@Jack](https://discourse.julialang.org/u/Jack)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 4:34pm UTC](https://discourse.julialang.org/t/postgresql-read-from-multi-processing/79068 "2022-04-06T16:34:49Z")

</div>

I use LibPQ as following to read postgresql in a docker with multiple cores ( using the Distributed package ), using LibPQ: Connection conn = Connection("""host = wrds-pgdata.wharton.upenn.edu port = port …

---

## [Unexpected Behaviour of the Rounding Function](https://discourse.julialang.org/t/unexpected-behaviour-of-the-rounding-function/79101)

<div class="topic-metadata">

**Author:** [@GrandlyHelping](https://discourse.julialang.org/u/GrandlyHelping)\
**Replies:** 7\
**Last updated:** [April 6, 2022, 4:02pm UTC](https://discourse.julialang.org/t/unexpected-behaviour-of-the-rounding-function/79101 "2022-04-06T16:02:29Z")

</div>

I am trying to round some Float64 values and don’t understand the behavior of the round() function for specific values. If I take: round(0.585, digits=2, RoundNearestTiesUp) I get 0.59, as expected, since I want value…

---

## [The best approach to interact with images by clicking on them and retreiving position of the pixel I clicked on](https://discourse.julialang.org/t/the-best-approach-to-interact-with-images-by-clicking-on-them-and-retreiving-position-of-the-pixel-i-clicked-on/79078)

<div class="topic-metadata">

**Author:** [@MK-1138](https://discourse.julialang.org/u/MK-1138)\
**Replies:** 4\
**Last updated:** [April 6, 2022, 4:00pm UTC](https://discourse.julialang.org/t/the-best-approach-to-interact-with-images-by-clicking-on-them-and-retreiving-position-of-the-pixel-i-clicked-on/79078 "2022-04-06T16:00:29Z")

</div>

I’m loading an image via imshow() which allows me to track coordinates of the mouse as I hover it over the image. I’m using the coordinates as inputs for some other stuff. I wonder if it’s possible instead to display an…

---

## [\[ANN\] WordCloud.jl - a word cloud generator in julia](https://discourse.julialang.org/t/ann-wordcloud-jl-a-word-cloud-generator-in-julia/53587)

<div class="topic-metadata">

**Author:** [@guoyongzhi](https://discourse.julialang.org/u/guoyongzhi)\
**Replies:** 18\
**Last updated:** [April 6, 2022, 2:34pm UTC](https://discourse.julialang.org/t/ann-wordcloud-jl-a-word-cloud-generator-in-julia/53587 "2022-04-06T14:34:06Z")

</div>

Hi, I’m very happy to announce my first julia package WordCloud.jl here. Word cloud (tag cloud or wordle) is a novelty visual representation of text data. The importance of each word is shown with font size or color. Wor…

---

## [How to send binary data by socket with Genie?](https://discourse.julialang.org/t/how-to-send-binary-data-by-socket-with-genie/79098)

<div class="topic-metadata">

**Author:** [@D\_A](https://discourse.julialang.org/u/D_A)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 2:26pm UTC](https://discourse.julialang.org/t/how-to-send-binary-data-by-socket-with-genie/79098 "2022-04-06T14:26:22Z")

</div>

Hello, I am developing a small web application which consists of a simple page with a form, where the user has to check some boxes but mostly choose files to upload to the server so that the server runs a process and se…

---

## [Fortran to Julia with a nested struct](https://discourse.julialang.org/t/fortran-to-julia-with-a-nested-struct/79099)

<div class="topic-metadata">

**Author:** [@james3](https://discourse.julialang.org/u/james3)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 2:01pm UTC](https://discourse.julialang.org/t/fortran-to-julia-with-a-nested-struct/79099 "2022-04-06T14:01:51Z")

</div>

This is following on from a question I had here https://discourse.julialang.org/t/fortran-to-julia-struct/79081. I’m still trying to get Julia speaking to a Fortran library. My problem now is dealing with nested structs…

---

## [Combining a dataframe with a Vector{Float64}, and naming the new column something other than "x1"](https://discourse.julialang.org/t/combining-a-dataframe-with-a-vector-float64-and-naming-the-new-column-something-other-than-x1/79093)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 3\
**Last updated:** [April 6, 2022, 1:55pm UTC](https://discourse.julialang.org/t/combining-a-dataframe-with-a-vector-float64-and-naming-the-new-column-something-other-than-x1/79093 "2022-04-06T13:55:21Z")

</div>

I have the following code: \`DataFrame(\[df new\_column\])\` where df is an existing dataframe and new\_column is a Vector{Float64}. The result creates a new df where the content of new\_column has the name “x1”. How can I …

---

## [Inverting a matrix of symbolic equations](https://discourse.julialang.org/t/inverting-a-matrix-of-symbolic-equations/79083)

<div class="topic-metadata">

**Author:** [@Isaiah\_Warnke](https://discourse.julialang.org/u/Isaiah_Warnke)\
**Replies:** 6\
**Last updated:** [April 6, 2022, 1:14pm UTC](https://discourse.julialang.org/t/inverting-a-matrix-of-symbolic-equations/79083 "2022-04-06T13:14:10Z")

</div>

I’d like to invert a 4x4 matrix of symbolic equations. I’m able to successfully invert a matrix of symbolic expressions like this: using Symbolics using LinearAlgebra @variables x y\[1:16\] z Symbolics.scalarize(y) eq11…

---

## [Define my own convolutional kernel/mask/filter in Flux.jl](https://discourse.julialang.org/t/define-my-own-convolutional-kernel-mask-filter-in-flux-jl/79090)

<div class="topic-metadata">

**Author:** [@Pijus](https://discourse.julialang.org/u/Pijus)\
**Replies:** 0\
**Last updated:** [April 6, 2022, 12:29pm UTC](https://discourse.julialang.org/t/define-my-own-convolutional-kernel-mask-filter-in-flux-jl/79090 "2022-04-06T12:29:17Z")

</div>

Hello all, I am trying to define my own convolutional kernels: For 1D case: \[1 -2 1\] For 2D case: | 0 1 0 | | 1 -4 1 | | 0 1 0 | Does anyone have any idea on how to do that in Flux.jl? You can only say…

---

## [History of the current (temporary) environment](https://discourse.julialang.org/t/history-of-the-current-temporary-environment/79067)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [April 6, 2022, 11:57am UTC](https://discourse.julialang.org/t/history-of-the-current-temporary-environment/79067 "2022-04-06T11:57:28Z")

</div>

Is it possible to fetch (or copy to a file) the history of the commands of specifically the current temporary environment? Such as something like: (@v1.7) pkg\> activate --temp Activating new project at \`/tmp/jl\_gaocNs…

---

## [Passing tuple of structs to a CUDA.jl kernel](https://discourse.julialang.org/t/passing-tuple-of-structs-to-a-cuda-jl-kernel/79064)

<div class="topic-metadata">

**Author:** [@lodygaw](https://discourse.julialang.org/u/lodygaw)\
**Replies:** 4\
**Last updated:** [April 6, 2022, 11:52am UTC](https://discourse.julialang.org/t/passing-tuple-of-structs-to-a-cuda-jl-kernel/79064 "2022-04-06T11:52:51Z")

</div>

Hi, I have a problem with passing a tuple of structs to a CUDA.jl kernel. This is MWE: using CUDA, Adapt, StaticArrays struct MyType1 end struct MyType2 end struct MyStruct{T,N,L} type :: T data :: SMatrix{N,2,Flo…

---

## [StepRange and StepRangeLen have no common abstract class](https://discourse.julialang.org/t/steprange-and-steprangelen-have-no-common-abstract-class/79085)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 10:31am UTC](https://discourse.julialang.org/t/steprange-and-steprangelen-have-no-common-abstract-class/79085 "2022-04-06T10:31:59Z")

</div>

Hello, I would like to have a function like this (where I want to do something more interesting than printing): x = (myrange::Range) -\> print(length(range)) But I cannot find an abstract type that has both StepRange 1…

---

## [ParallelStencil w/MPI](https://discourse.julialang.org/t/parallelstencil-w-mpi/79077)

<div class="topic-metadata">

**Author:** [@wkharold](https://discourse.julialang.org/u/wkharold)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 9:41am UTC](https://discourse.julialang.org/t/parallelstencil-w-mpi/79077 "2022-04-06T09:41:47Z")

</div>

Is the CPU parallelism in the ParallelStencil.jl Concise single/multi-XPU miniapps limited to threads, or since it’s built on/with ImplicitGlobalGrid can it do MPI as well? I don’t see anything that looks like MPI suppo…

---

## [Linear problem with multiple shifts](https://discourse.julialang.org/t/linear-problem-with-multiple-shifts/69086)

<div class="topic-metadata">

**Author:** [@Jae-Mo\_Lihm](https://discourse.julialang.org/u/Jae-Mo_Lihm)\
**Replies:** 8\
**Last updated:** [April 6, 2022, 9:49am UTC](https://discourse.julialang.org/t/linear-problem-with-multiple-shifts/69086 "2022-04-06T09:49:58Z")

</div>

I want to solve (A - c\_i) \* x = b for multiple shifts c\_i. A is a Hermitian matrix, where A\*x is efficient than obtaining A directly. A - c\_i \* I is positive definite. I know that one can use Krylov subspace methods (Lan…

---

## [JuMP/MOI performance overhead vs XPress api](https://discourse.julialang.org/t/jump-moi-performance-overhead-vs-xpress-api/78994)

<div class="topic-metadata">

**Author:** [@Marie](https://discourse.julialang.org/u/Marie)\
**Replies:** 12\
**Last updated:** [April 6, 2022, 9:17am UTC](https://discourse.julialang.org/t/jump-moi-performance-overhead-vs-xpress-api/78994 "2022-04-06T09:17:47Z")

</div>

Solving exactly same lp problem using XPress api is way faster than using JuMP/MOI: 2 ses vs 9 secs for a simple case; then 452 secs vs 1796 for more complex case. Is this overhead a known issue? Is there a way to optimi…

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

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