# Latest

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

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

**Page:** 1102

---

## [TaskFailedException with @threads macro with Dict](https://discourse.julialang.org/t/taskfailedexception-with-threads-macro-with-dict/77564)

<div class="topic-metadata">

**Author:** [@ekbrown](https://discourse.julialang.org/u/ekbrown)\
**Replies:** 4\
**Last updated:** [March 9, 2022, 8:06am UTC](https://discourse.julialang.org/t/taskfailedexception-with-threads-macro-with-dict/77564 "2022-03-09T08:06:27Z")

</div>

When using Julia v1.7.2, I get a TaskFailedException when trying to use the @threads macro on a for loop over a dictionary, even though a non-threaded for loop works correctly. I lock the DataFrame that is written to. Do…

---

## [Creating a struct from a YAML file](https://discourse.julialang.org/t/creating-a-struct-from-a-yaml-file/73743)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 20\
**Last updated:** [March 9, 2022, 6:08am UTC](https://discourse.julialang.org/t/creating-a-struct-from-a-yaml-file/73743 "2022-03-09T06:08:41Z")

</div>

I want to provide a struct with configuration variables (parameters) to my simulation. I have a yaml file like this one: system: log\_file: "data/log\_8700W\_8ms" # filename without extension \[replay only\] time\_l…

---

## [Avoiding array mutation with vector combinations for use in flux](https://discourse.julialang.org/t/avoiding-array-mutation-with-vector-combinations-for-use-in-flux/77425)

<div class="topic-metadata">

**Author:** [@vleon1234](https://discourse.julialang.org/u/vleon1234)\
**Replies:** 4\
**Last updated:** [March 9, 2022, 5:18am UTC](https://discourse.julialang.org/t/avoiding-array-mutation-with-vector-combinations-for-use-in-flux/77425 "2022-03-09T05:18:09Z")

</div>

Hi all, I’m working on a parameter estimation problem of an ODE system with two variables u1 and u2. As one part of an objective that I will use in the loss function, I want to calculate a vector of the product of combi…

---

## [JuMP CPLEX attribute error for getting CPX\_PARAM\_INTSOLLIM](https://discourse.julialang.org/t/jump-cplex-attribute-error-for-getting-cpx-param-intsollim/77595)

<div class="topic-metadata">

**Author:** [@hideakiv](https://discourse.julialang.org/u/hideakiv)\
**Replies:** 2\
**Last updated:** [March 9, 2022, 3:41am UTC](https://discourse.julialang.org/t/jump-cplex-attribute-error-for-getting-cpx-param-intsollim/77595 "2022-03-09T03:41:58Z")

</div>

I am trying to get a CPLEX attribute of a model. I am using JuMP v0.21.10 and CPLEX v0.7.8. using JuMP, CPLEX m = Model() set\_optimizer(m, optimizer\_with\_attributes(CPLEX.Optimizer, "CPX\_PARAM\_INTSOLLIM" =\> 1)) get\_opt…

---

## ['\\n' is not working in \`print\` for customized string literals](https://discourse.julialang.org/t/n-is-not-working-in-print-for-customized-string-literals/31517)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 3\
**Last updated:** [March 9, 2022, 3:02am UTC](https://discourse.julialang.org/t/n-is-not-working-in-print-for-customized-string-literals/31517 "2022-03-09T03:02:17Z")

</div>

I define a @c\_str macro for colored strings: using Rematch: @match function color\_string(str::AbstractString, color::AbstractChar) env = @match color begin 'b' =\> "\\033\[34m" 'r' =\> "\\033\[31m" …

---

## [Flux. Pooling followed by Dense](https://discourse.julialang.org/t/flux-pooling-followed-by-dense/77394)

<div class="topic-metadata">

**Author:** [@Emmanuel-R8](https://discourse.julialang.org/u/Emmanuel-R8)\
**Replies:** 10\
**Last updated:** [March 9, 2022, 2:44am UTC](https://discourse.julialang.org/t/flux-pooling-followed-by-dense/77394 "2022-03-09T02:44:28Z")

</div>

I am at a loss about the following. I am building a small 2D network where the last 2 layers are a MaxPool followed by a Dense. The parameters to create MaxPool do not care about the size of the input. But the Dense just…

---

## [Makie examples in PortAudio](https://discourse.julialang.org/t/makie-examples-in-portaudio/77614)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 0\
**Last updated:** [March 9, 2022, 1:40am UTC](https://discourse.julialang.org/t/makie-examples-in-portaudio/77614 "2022-03-09T01:40:11Z")

</div>

I’m trying to get all of the examples in the PortAudio repo to run as part of CI. I’ve gotten most of the examples to run but I’m struggling with the two examples that use Makie. What I’ve got so far is in this PR: https…

---

## [Bonmin\_jll](https://discourse.julialang.org/t/bonmin-jll/77612)

<div class="topic-metadata">

**Author:** [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Replies:** 1\
**Last updated:** [March 9, 2022, 1:12am UTC](https://discourse.julialang.org/t/bonmin-jll/77612 "2022-03-09T01:12:01Z")

</div>

I got this error message. I am using Bonmin\_jll to solve my model. What can I do? The provided optimizer\_constructor is invalid. It must be callable with zero arguments. For example, "Ipopt.Optimizer" or "() -\> ECOS.Opt…

---

## [Quick 'for' and 'if' one-line loop](https://discourse.julialang.org/t/quick-for-and-if-one-line-loop/43199)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 16\
**Last updated:** [March 9, 2022, 1:10am UTC](https://discourse.julialang.org/t/quick-for-and-if-one-line-loop/43199 "2022-03-09T01:10:53Z")

</div>

Hi, For some very simple function like +=1 if the element of this array is 0, is there any concise way? c=\[0,1,0\] map(x-\>x=0, c) #but I wish to add a \*\*if\*\* in this one-line for loop #otherwise how verbose my usual so…

---

## [Addprocs behavior changed in recent update -- have to enter password now](https://discourse.julialang.org/t/addprocs-behavior-changed-in-recent-update-have-to-enter-password-now/77537)

<div class="topic-metadata">

**Author:** [@chelseas](https://discourse.julialang.org/u/chelseas)\
**Replies:** 2\
**Last updated:** [March 8, 2022, 9:46pm UTC](https://discourse.julialang.org/t/addprocs-behavior-changed-in-recent-update-have-to-enter-password-now/77537 "2022-03-08T21:46:59Z")

</div>

I have passwordless ssh login setup to my server like: ssh csidrane@myserver But then when I go into my terminal and I type: using Distributed addprocs(\[(“myserver”, 1)\]) it used to work just fine! About a month ago…

---

## [How to approach this piece of code?](https://discourse.julialang.org/t/how-to-approach-this-piece-of-code/77598)

<div class="topic-metadata">

**Author:** [@Dharik\_Arsath](https://discourse.julialang.org/u/Dharik_Arsath)\
**Replies:** 3\
**Last updated:** [March 8, 2022, 9:00pm UTC](https://discourse.julialang.org/t/how-to-approach-this-piece-of-code/77598 "2022-03-08T21:00:02Z")

</div>

I am trying to implement Standard Scalar, where I have to store my mean and standard deviation of training data and use that mean and std\_dev in the test set. function standard\_scalar!(X, scaled\_out) mean = 1/length(X…

---

## [Factor of two in Zygote complex gradient](https://discourse.julialang.org/t/factor-of-two-in-zygote-complex-gradient/77545)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 5\
**Last updated:** [March 8, 2022, 8:14pm UTC](https://discourse.julialang.org/t/factor-of-two-in-zygote-complex-gradient/77545 "2022-03-08T20:14:59Z")

</div>

Either Zygote’s gradients for a scalar function with respect to a complex vector are off by a factor of two, I’ve been doing matrix algebra wrong for the last 10 years, or I’m just being stupid here. Consider the followi…

---

## [Eigenvectors of a symmetric tensor and a matrix](https://discourse.julialang.org/t/eigenvectors-of-a-symmetric-tensor-and-a-matrix/77604)

<div class="topic-metadata">

**Author:** [@FrootLoops](https://discourse.julialang.org/u/FrootLoops)\
**Replies:** 2\
**Last updated:** [March 8, 2022, 8:09pm UTC](https://discourse.julialang.org/t/eigenvectors-of-a-symmetric-tensor-and-a-matrix/77604 "2022-03-08T20:09:35Z")

</div>

Hi, I have a problem calculating the eigenvectors of a matrix/tensor. Maybe someone can explain why the outputs differ from each other. using LinearAlgebra, Tensors A = \[-24.978551803697826 -51.42238499537693 0.0; -51…

---

## [Social Media Mapping](https://discourse.julialang.org/t/social-media-mapping/77605)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 0\
**Last updated:** [March 8, 2022, 7:25pm UTC](https://discourse.julialang.org/t/social-media-mapping/77605 "2022-03-08T19:25:18Z")

</div>

Is there anyone that has experience making maps of social networks, by friends or by posts?

---

## [Stratified and weighted sampling in dataframes](https://discourse.julialang.org/t/stratified-and-weighted-sampling-in-dataframes/77565)

<div class="topic-metadata">

**Author:** [@George\_Githinji](https://discourse.julialang.org/u/George_Githinji)\
**Replies:** 8\
**Last updated:** [March 8, 2022, 7:11pm UTC](https://discourse.julialang.org/t/stratified-and-weighted-sampling-in-dataframes/77565 "2022-03-08T19:11:37Z")

</div>

I have a function that can take a random sample from a dataframe. However I ran into an issue when working with grouped a dataframe in which case I have grouped the data by several columns and I would like to sample with…

---

## [Tuning the gamma parameter in FrankWolfe.jl](https://discourse.julialang.org/t/tuning-the-gamma-parameter-in-frankwolfe-jl/77023)

<div class="topic-metadata">

**Author:** [@dridz](https://discourse.julialang.org/u/dridz)\
**Replies:** 7\
**Last updated:** [March 8, 2022, 5:47pm UTC](https://discourse.julialang.org/t/tuning-the-gamma-parameter-in-frankwolfe-jl/77023 "2022-03-08T17:47:33Z")

</div>

Hi, I found out about the FrankWolfe.jl package and it looks great ! I am dealing with an optimization problem for which I have a lot of intuition about a good warm start and also about the order of magnitude of a good …

---

## [Scalar indexing error when loading MNIST](https://discourse.julialang.org/t/scalar-indexing-error-when-loading-mnist/77496)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 2\
**Last updated:** [March 8, 2022, 5:37pm UTC](https://discourse.julialang.org/t/scalar-indexing-error-when-loading-mnist/77496 "2022-03-08T17:37:14Z")

</div>

The following code in a fresh session produces a scalar indexing error: using Flux using MLDatasets categories = 0:9 xtrain, ytrain = MNIST.traindata(Float32) xtest, ytest = MNIST.testdata(Float32) ytrain, ytest = Flu…

---

## [I think broke my Plots ("Failed to precompile Plots")– how can I restore it?](https://discourse.julialang.org/t/i-think-broke-my-plots-failed-to-precompile-plots-how-can-i-restore-it/72389)

<div class="topic-metadata">

**Author:** [@chrisoffner](https://discourse.julialang.org/u/chrisoffner)\
**Replies:** 3\
**Last updated:** [March 8, 2022, 5:20pm UTC](https://discourse.julialang.org/t/i-think-broke-my-plots-failed-to-precompile-plots-how-can-i-restore-it/72389 "2022-03-08T17:20:17Z")

</div>

I’ve been happily working in Pluto using the Plotly backend for a few days, but today after updating to Julia 1.7 I had some issue that I tried to solve by following some instruction somewhere which made me delete files …

---

## [Base packages for all users](https://discourse.julialang.org/t/base-packages-for-all-users/77262)

<div class="topic-metadata">

**Author:** [@RonRahaman](https://discourse.julialang.org/u/RonRahaman)\
**Replies:** 26\
**Last updated:** [March 8, 2022, 5:07pm UTC](https://discourse.julialang.org/t/base-packages-for-all-users/77262 "2022-03-08T17:07:07Z")

</div>

Hi all, I’m an administrator of a shared compute cluster, and I’d like to provide a few packages in a sort of “base environment” for all users on the system. What’s the recommended workflow for this? Specifically, I’d…

---

## [Is my understanding of Julia correct?](https://discourse.julialang.org/t/is-my-understanding-of-julia-correct/76924)

<div class="topic-metadata">

**Author:** [@sychen52](https://discourse.julialang.org/u/sychen52)\
**Replies:** 38\
**Last updated:** [March 8, 2022, 4:53pm UTC](https://discourse.julialang.org/t/is-my-understanding-of-julia-correct/76924 "2022-03-08T16:53:15Z")

</div>

Memory Management Garbage Collector I noticed this issue when Chris Lattner pointed during a \[debate\]. In short, Julia uses the mark-and-sweep Garbage Collector. It may cause memory not being released in time. This is es…

---

## [Julia User Group Munich: Share&Code on ControlSystems.jl with Fredrik Bagge Carlson](https://discourse.julialang.org/t/julia-user-group-munich-share-code-on-controlsystems-jl-with-fredrik-bagge-carlson/77055)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 4\
**Last updated:** [March 8, 2022, 4:51pm UTC](https://discourse.julialang.org/t/julia-user-group-munich-share-code-on-controlsystems-jl-with-fredrik-bagge-carlson/77055 "2022-03-08T16:51:13Z")

</div>

Join us :spiral\_calendar: Monday 07. March 2022 :clock630: CET 18:30 organized via meetup Design and analysis of control systems in Julia - ControlSystems.jl ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ I am glad to welcome Fredri…

---

## [How to print multiple values in a loop](https://discourse.julialang.org/t/how-to-print-multiple-values-in-a-loop/77474)

<div class="topic-metadata">

**Author:** [@Eric.O](https://discourse.julialang.org/u/Eric.O)\
**Replies:** 8\
**Last updated:** [March 8, 2022, 4:48pm UTC](https://discourse.julialang.org/t/how-to-print-multiple-values-in-a-loop/77474 "2022-03-08T16:48:05Z")

</div>

I want to print my output in Julia, I have written it in the form presented below but I want to use a for loop to make it more concise. Any help on how to write the code below using for loop will be appreciated please. …

---

## [How to sort a vector by an expensive function in place efficiently?](https://discourse.julialang.org/t/how-to-sort-a-vector-by-an-expensive-function-in-place-efficiently/77540)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 14\
**Last updated:** [March 8, 2022, 4:19pm UTC](https://discourse.julialang.org/t/how-to-sort-a-vector-by-an-expensive-function-in-place-efficiently/77540 "2022-03-08T16:19:20Z")

</div>

The normal sort!(...;by=f) sorts in place by a function, but it results in calling that function many more times than the length of the vector. I tried all the sorting algorithms included in Base and all of them resulted…

---

## [Opportunity for Julia advocates in The Netherlands](https://discourse.julialang.org/t/opportunity-for-julia-advocates-in-the-netherlands/75301)

<div class="topic-metadata">

**Author:** [@Klaas\_Pauly](https://discourse.julialang.org/u/Klaas_Pauly)\
**Replies:** 1\
**Last updated:** [March 8, 2022, 3:46pm UTC](https://discourse.julialang.org/t/opportunity-for-julia-advocates-in-the-netherlands/75301 "2022-03-08T15:46:43Z")

</div>

This might be of interest and an excellent opportunity to enable outreach for active Julia users and advocates at universities and research institutes in The Netherlands: Fellowship Programme - eScience Center

---

## [MPI on Raspberry pi distributed computer](https://discourse.julialang.org/t/mpi-on-raspberry-pi-distributed-computer/77588)

<div class="topic-metadata">

**Author:** [@Isonoglu](https://discourse.julialang.org/u/Isonoglu)\
**Replies:** 1\
**Last updated:** [March 8, 2022, 3:28pm UTC](https://discourse.julialang.org/t/mpi-on-raspberry-pi-distributed-computer/77588 "2022-03-08T15:28:51Z")

</div>

Hello everyone. I’m a total beginner in Julia and cluster computing. I have already made a Raspberry pi distributed computer with 4 nodes. Any node can SSH to every other. Every node should perform some calculations “loc…

---

## [Finding crossing points of two vectors of vertices](https://discourse.julialang.org/t/finding-crossing-points-of-two-vectors-of-vertices/15786)

<div class="topic-metadata">

**Author:** [@jcook](https://discourse.julialang.org/u/jcook)\
**Replies:** 15\
**Last updated:** [March 8, 2022, 12:54pm UTC](https://discourse.julialang.org/t/finding-crossing-points-of-two-vectors-of-vertices/15786 "2022-03-08T12:54:32Z")

</div>

Is there a tool out there that is able to find the locations of where two lines cross one another? By line I mean a vector of positions in the 2D plane, where the positions are connected by straight lines. I would prefer…

---

## [Default norm used in ODE error control](https://discourse.julialang.org/t/default-norm-used-in-ode-error-control/70995)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 4\
**Last updated:** [March 8, 2022, 1:47pm UTC](https://discourse.julialang.org/t/default-norm-used-in-ode-error-control/70995 "2022-03-08T13:47:41Z")

</div>

The error control in DifferentialEquations using the default internal norm is as follow: Compute tolerance on i-th component: tolerance\_i = absoluteTolerance\_i + relativeTolerance\_i \* max( \\lvert previousState\_i \\rver…

---

## [Avoid repeating the same \`using\` line for enclosed modules](https://discourse.julialang.org/t/avoid-repeating-the-same-using-line-for-enclosed-modules/2549)

<div class="topic-metadata">

**Author:** [@xqrongm](https://discourse.julialang.org/u/xqrongm)\
**Replies:** 7\
**Last updated:** [March 8, 2022, 1:28pm UTC](https://discourse.julialang.org/t/avoid-repeating-the-same-using-line-for-enclosed-modules/2549 "2022-03-08T13:28:22Z")

</div>

I want to write modules inside of a module. Is there a way to avoid repeating the same using line of code? module Module0 using Pkg1, Pkg2, Pkg3 module Module01 using Pkg1, Pkg2, Pkg3 some\_code\_1 end module Module02 …

---

## [Addition of floats allocates memory in not fully qualified struct](https://discourse.julialang.org/t/addition-of-floats-allocates-memory-in-not-fully-qualified-struct/77583)

<div class="topic-metadata">

**Author:** [@ncxst](https://discourse.julialang.org/u/ncxst)\
**Replies:** 1\
**Last updated:** [March 8, 2022, 1:20pm UTC](https://discourse.julialang.org/t/addition-of-floats-allocates-memory-in-not-fully-qualified-struct/77583 "2022-03-08T13:20:17Z")

</div>

Hi, I see allocations when adding floats in a not fully qualified struct. Can you explain why the function func allocates memory when passing a BarSlow type into it? Below you find a minimal working example. Thank you, …

---

## [CBC solver](https://discourse.julialang.org/t/cbc-solver/77548)

<div class="topic-metadata">

**Author:** [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Replies:** 18\
**Last updated:** [March 8, 2022, 1:08pm UTC](https://discourse.julialang.org/t/cbc-solver/77548 "2022-03-08T13:08:01Z")

</div>

I got this error while trying to test Alpine: Failed to precompile Cbc. What can I do to fix this ? Any suggestion ? My Julia version: JuliaPro\_v1.5.3-1

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

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