# Latest

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

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

**Page:** 1250

---

## [How to parallelize within a function](https://discourse.julialang.org/t/how-to-parallelize-within-a-function/69082)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 6\
**Last updated:** [October 3, 2021, 4:42pm UTC](https://discourse.julialang.org/t/how-to-parallelize-within-a-function/69082 "2021-10-03T16:42:37Z")

</div>

I started with Julia about a week ago. So far so good although I suffered quite a bit before I managed to get the VSCode debugger work properly. (It would get stuck forever when reading large dataframes) Now my issues a…

---

## [How do I have to read an unknown number of floats in binary data till EOF?](https://discourse.julialang.org/t/how-do-i-have-to-read-an-unknown-number-of-floats-in-binary-data-till-eof/69117)

<div class="topic-metadata">

**Author:** [@Zweta\_Fuze](https://discourse.julialang.org/u/Zweta_Fuze)\
**Replies:** 8\
**Last updated:** [October 3, 2021, 2:53pm UTC](https://discourse.julialang.org/t/how-do-i-have-to-read-an-unknown-number-of-floats-in-binary-data-till-eof/69117 "2021-10-03T14:53:46Z")

</div>

% MATLAB for low-level reading of 32bit-floating point numbers f=fopen(‘Float32.dat’,‘r’); A=fread(f,\[100 inf\],‘single’); % important for me to use inf fclose(f); Julia f=open(“Float32.dat”,“r”); A= read(???); clos…

---

## [DifferentialEquations, Control Systems, and Linearization](https://discourse.julialang.org/t/differentialequations-control-systems-and-linearization/31178)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 9\
**Last updated:** [October 3, 2021, 2:40pm UTC](https://discourse.julialang.org/t/differentialequations-control-systems-and-linearization/31178 "2021-10-03T14:40:40Z")

</div>

I have a more general question regarding Differential Equations, Control Systems, and Linearization. Thanks to Tamas\_Papp, ssfrr, DrPapa, ChrisRackauckas, and longemen3000 for help in a previous thread on ‘ForwardDiff & …

---

## [Separating a column into a variable number of possible columns](https://discourse.julialang.org/t/separating-a-column-into-a-variable-number-of-possible-columns/69035)

<div class="topic-metadata">

**Author:** [@Alex\_Tantos](https://discourse.julialang.org/u/Alex_Tantos)\
**Replies:** 22\
**Last updated:** [October 3, 2021, 12:40pm UTC](https://discourse.julialang.org/t/separating-a-column-into-a-variable-number-of-possible-columns/69035 "2021-10-03T12:40:49Z")

</div>

Hi there. Am trying to replicate some R code based on a movies dataset (available here) using Julia’s data wrangling utilities. What am trying to achieve is to separate/split a column into two or more columns depending…

---

## [How to play the audiobook .m4b file in julia?](https://discourse.julialang.org/t/how-to-play-the-audiobook-m4b-file-in-julia/69091)

<div class="topic-metadata">

**Author:** [@wuxinyu](https://discourse.julialang.org/u/wuxinyu)\
**Replies:** 3\
**Last updated:** [October 3, 2021, 11:27am UTC](https://discourse.julialang.org/t/how-to-play-the-audiobook-m4b-file-in-julia/69091 "2021-10-03T11:27:53Z")

</div>

I want to play a audio book file xxx.m4b in a web app, but I can’t find a package to handle the m4b file. I find a possible package called ffmpeg but I have no idea how to implement it. How can I play a audio book file i…

---

## [Why is there a difference when you Sum over an Array versus a Generator?](https://discourse.julialang.org/t/why-is-there-a-difference-when-you-sum-over-an-array-versus-a-generator/69132)

<div class="topic-metadata">

**Author:** [@Timothy](https://discourse.julialang.org/u/Timothy)\
**Replies:** 5\
**Last updated:** [October 3, 2021, 10:14am UTC](https://discourse.julialang.org/t/why-is-there-a-difference-when-you-sum-over-an-array-versus-a-generator/69132 "2021-10-03T10:14:24Z")

</div>

Vector summation: ‘’’ sum(\[1/n^2 for n = 1:100000\])‘’’ returns: 1.644924066898228 Generator summation: ‘’‘sum((1/n^2 for n = 1:100000))’‘’ returns: 1.6449240668982423 Why is there a difference in these results, and…

---

## [Differentiating a function involving the adjoint of a LinearMap (LinearMaps.jl and Zygote.jl)](https://discourse.julialang.org/t/differentiating-a-function-involving-the-adjoint-of-a-linearmap-linearmaps-jl-and-zygote-jl/69078)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 1\
**Last updated:** [October 3, 2021, 9:49am UTC](https://discourse.julialang.org/t/differentiating-a-function-involving-the-adjoint-of-a-linearmap-linearmaps-jl-and-zygote-jl/69078 "2021-10-03T09:49:48Z")

</div>

Hi! I’m trying to write differentiable code using LinearMaps.jl. However, I am running into an issue that I just haven’t been able to fix. Below is a minimum working example of this problem. using Zygote using LinearMap…

---

## [Is it possible to activate an environment by absolute path?](https://discourse.julialang.org/t/is-it-possible-to-activate-an-environment-by-absolute-path/69131)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [October 3, 2021, 7:52am UTC](https://discourse.julialang.org/t/is-it-possible-to-activate-an-environment-by-absolute-path/69131 "2021-10-03T07:52:17Z")

</div>

For example julia\> using Pkg; julia\> Pkg.activate("~/abc") Activating new environment at \`~/Dropbox/JuliaPackages/~/abc/Project.toml\` assumes that the path is relative, however I wanted to use an absolute path here.…

---

## [Question regarding the support of the Geometric distribution in Julia](https://discourse.julialang.org/t/question-regarding-the-support-of-the-geometric-distribution-in-julia/69123)

<div class="topic-metadata">

**Author:** [@conorhassan](https://discourse.julialang.org/u/conorhassan)\
**Replies:** 1\
**Last updated:** [October 3, 2021, 3:18am UTC](https://discourse.julialang.org/t/question-regarding-the-support-of-the-geometric-distribution-in-julia/69123 "2021-10-03T03:18:54Z")

</div>

Hi all, I am evaluating a likelihood involving the Geometric distribution, with a binary latent variable which indicates whether to set the parameter value p of the Geometric distribution to be equal to p=1. As these t…

---

## [Independent version requirements for each dependency to avoid downgrades?](https://discourse.julialang.org/t/independent-version-requirements-for-each-dependency-to-avoid-downgrades/69089)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 18\
**Last updated:** [October 3, 2021, 3:02am UTC](https://discourse.julialang.org/t/independent-version-requirements-for-each-dependency-to-avoid-downgrades/69089 "2021-10-03T03:02:21Z")

</div>

I often run into a problem when installing packages with a large number of dependencies where my environment will be forced to downgrade to old versions because a single dependency hasn’t updated its version requirements…

---

## [Difference in Random numbers between 1.5 & 1.6](https://discourse.julialang.org/t/difference-in-random-numbers-between-1-5-1-6/69090)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 5\
**Last updated:** [October 3, 2021, 2:27am UTC](https://discourse.julialang.org/t/difference-in-random-numbers-between-1-5-1-6/69090 "2021-10-03T02:27:58Z")

</div>

The HISTORY.md file does not show any changes to Random number generation between v1.5 and v1.6, but I still see different numbers generated with the same seed/RNG: Julia 1.5.4: julia\> VERSION v"1.5.4" julia\> using Ra…

---

## [How to extend the JuMP @variable so that it can construct a sparse array which can be used as a full matrix?](https://discourse.julialang.org/t/how-to-extend-the-jump-variable-so-that-it-can-construct-a-sparse-array-which-can-be-used-as-a-full-matrix/69125)

<div class="topic-metadata">

**Author:** [@iiitr](https://discourse.julialang.org/u/iiitr)\
**Replies:** 1\
**Last updated:** [October 3, 2021, 1:54am UTC](https://discourse.julialang.org/t/how-to-extend-the-jump-variable-so-that-it-can-construct-a-sparse-array-which-can-be-used-as-a-full-matrix/69125 "2021-10-03T01:54:41Z")

</div>

Hi all In fact, this question is a derivative of my last question. I want to create a 4x4 array variables, but it only has a value at the index (1, 2), (2, 1), (2, 3), (3, 2) and the rest is 0. @blegat provide sever…

---

## [Can JuMP.jl create a sparse array variable that can be used as a full matrix?](https://discourse.julialang.org/t/can-jump-jl-create-a-sparse-array-variable-that-can-be-used-as-a-full-matrix/69114)

<div class="topic-metadata">

**Author:** [@iiitr](https://discourse.julialang.org/u/iiitr)\
**Replies:** 2\
**Last updated:** [October 3, 2021, 1:21am UTC](https://discourse.julialang.org/t/can-jump-jl-create-a-sparse-array-variable-that-can-be-used-as-a-full-matrix/69114 "2021-10-03T01:21:15Z")

</div>

Hi all Recently, I have encountered some problems in optimizing code speed. I guess it is because I always create dense array variables I want to create a 4x4 array variables, but it only has a value at the index (1, 2…

---

## [Cognibotics is looking for experienced Julia programmer](https://discourse.julialang.org/t/cognibotics-is-looking-for-experienced-julia-programmer/68138)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 1\
**Last updated:** [October 3, 2021, 1:06am UTC](https://discourse.julialang.org/t/cognibotics-is-looking-for-experienced-julia-programmer/68138 "2021-10-03T01:06:54Z")

</div>

Cognibotics is looking for an experienced Julia programmer! We are looking for someone with a computer science (or related) background and the following experience: Design of software libraries and APIs in Julia. Fami…

---

## [Using @pywith for PyCall](https://discourse.julialang.org/t/using-pywith-for-pycall/68878)

<div class="topic-metadata">

**Author:** [@rubaiyat](https://discourse.julialang.org/u/rubaiyat)\
**Replies:** 5\
**Last updated:** [October 3, 2021, 12:19am UTC](https://discourse.julialang.org/t/using-pywith-for-pycall/68878 "2021-10-03T00:19:38Z")

</div>

Hello everyone, I’m trying to run a Python package named PyBLP from Julia using Pycall, and ran into an issue using @pywith. All the PyBLP commands run just fine, however when it comes to using “parallel” through a “wi…

---

## [@time a module](https://discourse.julialang.org/t/time-a-module/69121)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [October 2, 2021, 11:51pm UTC](https://discourse.julialang.org/t/time-a-module/69121 "2021-10-02T23:51:21Z")

</div>

I want to know how long it takes to run a module. julia\> @time module Foo; x = 1 end ERROR: syntax: "module" expression not at top level How can I do that?

---

## [Strange nan errors when mutating immutable struct arrays](https://discourse.julialang.org/t/strange-nan-errors-when-mutating-immutable-struct-arrays/69084)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 4\
**Last updated:** [October 2, 2021, 11:46pm UTC](https://discourse.julialang.org/t/strange-nan-errors-when-mutating-immutable-struct-arrays/69084 "2021-10-02T23:46:39Z")

</div>

I’m working on a large economic model that involves a dynamic optimization problem. I’ve set up arrays within immutable structs to hold the solutions to the problem. The algorithm involves iterating on fixed points on …

---

## [How to code the following optimization problem](https://discourse.julialang.org/t/how-to-code-the-following-optimization-problem/69098)

<div class="topic-metadata">

**Author:** [@Jaidy](https://discourse.julialang.org/u/Jaidy)\
**Replies:** 4\
**Last updated:** [October 2, 2021, 10:57pm UTC](https://discourse.julialang.org/t/how-to-code-the-following-optimization-problem/69098 "2021-10-02T22:57:26Z")

</div>

Hi everyone, I have the following optimization problem to solve: minimize c^Tx, subject to ||c^Tx||\_1 \<= C Can someone tell me how to write this in say NLopt, or any other library?

---

## [How to write a generic rrule?](https://discourse.julialang.org/t/how-to-write-a-generic-rrule/69058)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [October 2, 2021, 9:56pm UTC](https://discourse.julialang.org/t/how-to-write-a-generic-rrule/69058 "2021-10-02T21:56:04Z")

</div>

Consider the following example: function ancestor\_accumulate(x::AbstractMatrix, ancestors::AbstractVector{Int}) @assert size(x, 2) == length(ancestors) @assert issorted(ancestors) && all(a .\< 1:length(ancestors)…

---

## [Hacktoberfest 2021 x The Julia Programming Language](https://discourse.julialang.org/t/hacktoberfest-2021-x-the-julia-programming-language/69120)

<div class="topic-metadata">

**Author:** [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Replies:** 0\
**Last updated:** [October 2, 2021, 9:55pm UTC](https://discourse.julialang.org/t/hacktoberfest-2021-x-the-julia-programming-language/69120 "2021-10-02T21:55:57Z")

</div>

Hey folks, it is that time of the year again, Hacktoberfest! If you want to participate, make sure to sign up as a contributor at: https://hacktoberfest.digitalocean.com (who doesn’t love a free t-shirt). If you want to…

---

## [Automatic differentiation performance & computing derivatives of only a subset of the arguments](https://discourse.julialang.org/t/automatic-differentiation-performance-computing-derivatives-of-only-a-subset-of-the-arguments/69074)

<div class="topic-metadata">

**Author:** [@gianmariomanca](https://discourse.julialang.org/u/gianmariomanca)\
**Replies:** 6\
**Last updated:** [October 2, 2021, 8:46pm UTC](https://discourse.julialang.org/t/automatic-differentiation-performance-computing-derivatives-of-only-a-subset-of-the-arguments/69074 "2021-10-02T20:46:41Z")

</div>

Here is a minimal working example const x = -10:10 f(m) = exp.(-1.5 .\* (x .- m).^2) function rs(d,xs) d0 = f(xs) d .- sum(d .\* d0) / sum(d0 .\* d0) .\* d0 end drs(d,xs) = (rs(d,xs + 1e-6) .- rs(d,xs)) / 1e-6 drs\_aut…

---

## [How to best program this function with cases?](https://discourse.julialang.org/t/how-to-best-program-this-function-with-cases/68703)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 6\
**Last updated:** [October 2, 2021, 7:37pm UTC](https://discourse.julialang.org/t/how-to-best-program-this-function-with-cases/68703 "2021-10-02T19:37:09Z")

</div>

I have this function that depends on cases i. I programmed it this way, but I am wondering if there is a better way of achieving the same result and with better performance. using ComponentArrays θ = ComponentArray(one…

---

## [Clustering using matrix decomp code performance tips](https://discourse.julialang.org/t/clustering-using-matrix-decomp-code-performance-tips/68838)

<div class="topic-metadata">

**Author:** [@spinkney](https://discourse.julialang.org/u/spinkney)\
**Replies:** 5\
**Last updated:** [October 2, 2021, 7:05pm UTC](https://discourse.julialang.org/t/clustering-using-matrix-decomp-code-performance-tips/68838 "2021-10-02T19:05:18Z")

</div>

Hi Julians, I’ve ported this matlab code from Clustering by low-rank doubly stochastic matrix decomposition to Julia. But it’s much too slow for my application. I’m still green to Julia so posting here to see if there’…

---

## [I encountered a problem when using a convolutional neural network for training](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training/69087)

<div class="topic-metadata">

**Author:** [@wondering](https://discourse.julialang.org/u/wondering)\
**Replies:** 0\
**Last updated:** [October 2, 2021, 3:23am UTC](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training/69087 "2021-10-02T03:23:53Z")

</div>

My task contains two neural networks. There is an MLP (Multilayer Perceptron) network named Model\_out in front, and its parameters are stored in: p\_out, re\_out = Flux.destructure(model\_out), and split\_i = length(p\_out); …

---

## [Understanding Flux.jl use of \`gradient\` and \`params\`](https://discourse.julialang.org/t/understanding-flux-jl-use-of-gradient-and-params/69077)

<div class="topic-metadata">

**Author:** [@davibarreira](https://discourse.julialang.org/u/davibarreira)\
**Replies:** 4\
**Last updated:** [October 2, 2021, 4:54pm UTC](https://discourse.julialang.org/t/understanding-flux-jl-use-of-gradient-and-params/69077 "2021-10-02T16:54:23Z")

</div>

I’m reading the “60-minutes blitz” for Flux, and I’m trying to understand more deeply how the package works. Now, I have the following code: using Flux: params W = randn(3, 5) b = zeros(3) x = \[3,1,0,1,2\] y(x) = sum(…

---

## [StochasticDiffEq for receiver BER estimation?](https://discourse.julialang.org/t/stochasticdiffeq-for-receiver-ber-estimation/68957)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 2\
**Last updated:** [October 2, 2021, 3:48pm UTC](https://discourse.julialang.org/t/stochasticdiffeq-for-receiver-ber-estimation/68957 "2021-10-02T15:48:58Z")

</div>

Having an engineering background, I would like to ask the more mathematically inclined experts. One of the key parameters of a radio reception device is its bit error rate (BER) for a given ratio of wanted signal and di…

---

## [Is label an attribute of scatter() and lines() in Makie.jl?](https://discourse.julialang.org/t/is-label-an-attribute-of-scatter-and-lines-in-makie-jl/68961)

<div class="topic-metadata">

**Author:** [@Adam\_Fleischhacker](https://discourse.julialang.org/u/Adam_Fleischhacker)\
**Replies:** 6\
**Last updated:** [October 2, 2021, 2:44pm UTC](https://discourse.julialang.org/t/is-label-an-attribute-of-scatter-and-lines-in-makie-jl/68961 "2021-10-02T14:44:44Z")

</div>

I am working on my understanding of the Makie package. In the plot from the help documentation (https://makie.juliaplots.org/dev/examples/layoutables/legend/), different markers get used with their legend labels determi…

---

## [Why is there difference between time and @time?](https://discourse.julialang.org/t/why-is-there-difference-between-time-and-time/69094)

<div class="topic-metadata">

**Author:** [@zhaoli-IHEP](https://discourse.julialang.org/u/zhaoli-IHEP)\
**Replies:** 8\
**Last updated:** [October 2, 2021, 1:57pm UTC](https://discourse.julialang.org/t/why-is-there-difference-between-time-and-time/69094 "2021-10-02T13:57:23Z")

</div>

In a simple script using SymEngine function test() @vars q1, q2 return q1+q2 end # function test @time test() we measure the time by using @time, and then we check the timing in the script run like \[ ~/works/…

---

## [Faster squared euclidean distance calculation](https://discourse.julialang.org/t/faster-squared-euclidean-distance-calculation/68969)

<div class="topic-metadata">

**Author:** [@jroon](https://discourse.julialang.org/u/jroon)\
**Replies:** 11\
**Last updated:** [October 2, 2021, 12:59pm UTC](https://discourse.julialang.org/t/faster-squared-euclidean-distance-calculation/68969 "2021-10-02T12:59:34Z")

</div>

Hi all. Trying to speed up a small function that multiplies an array by vector before doing a distance calculation. A small reprex: using BenchmarkTools using Distances using Tullio function calc1(r::Array{Float64, 1}…

---

## [Firebird database in Julia?](https://discourse.julialang.org/t/firebird-database-in-julia/33295)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 6\
**Last updated:** [October 2, 2021, 12:40pm UTC](https://discourse.julialang.org/t/firebird-database-in-julia/33295 "2021-10-02T12:40:42Z")

</div>

Hello, we use Firebird database in our compnay, for our Erp software. I was trying to use a firebird driver for Julia, and i found this: But I, who am a beginner, cannot import the package … I have this error … (i a…

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

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