# Latest

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

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

**Page:** 1684

---

## [Strange behavior of @spawn](https://discourse.julialang.org/t/strange-behavior-of-spawn/43442)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [July 21, 2020, 6:49pm UTC](https://discourse.julialang.org/t/strange-behavior-of-spawn/43442 "2020-07-21T18:49:42Z")

</div>

I do not understand what is going on here: julia\> test(i,j) = println("i = $i , j = $j") i = 0 for j in 1:4 global i += 1 Threads.@spawn test(i,j) end i = 4 , j = 2 julia\> i = 4 …

---

## [Convert project code to a package (and maintain git commit history)](https://discourse.julialang.org/t/convert-project-code-to-a-package-and-maintain-git-commit-history/43438)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 2\
**Last updated:** [July 21, 2020, 5:25pm UTC](https://discourse.julialang.org/t/convert-project-code-to-a-package-and-maintain-git-commit-history/43438 "2020-07-21T17:25:20Z")

</div>

I have some code in a project directory that is being tracked by git. The project directory looks like this: MyProj/ ├── .gitignore ├── .git │ └── # .git folder ├── Manifest.toml ├── Project.toml ├── examples │ ├── …

---

## [Meaning of copy for arrays](https://discourse.julialang.org/t/meaning-of-copy-for-arrays/43420)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 11\
**Last updated:** [July 21, 2020, 5:15pm UTC](https://discourse.julialang.org/t/meaning-of-copy-for-arrays/43420 "2020-07-21T17:15:45Z")

</div>

Is there a clear description of what “contract” copy(::AbstractArray) should implement? The docs are not very precise. We have the following examples: julia\> copy(1:6) # just returns the same immutable type 1:6 julia\> …

---

## [Getting info from CPLEX output](https://discourse.julialang.org/t/getting-info-from-cplex-output/42582)

<div class="topic-metadata">

**Author:** [@Codzilla](https://discourse.julialang.org/u/Codzilla)\
**Replies:** 6\
**Last updated:** [July 21, 2020, 9:39am UTC](https://discourse.julialang.org/t/getting-info-from-cplex-output/42582 "2020-07-21T09:39:15Z")

</div>

I’m using JuMP to solve a large number of instancies with CPLEX and I would like to use the information output by CPLEX such as the number of Flow cuts applied or time spent during branch & bound. Is there any elegant wa…

---

## [Error: create a column from an existing array](https://discourse.julialang.org/t/error-create-a-column-from-an-existing-array/43411)

<div class="topic-metadata">

**Author:** [@PabloGalaz](https://discourse.julialang.org/u/PabloGalaz)\
**Replies:** 2\
**Last updated:** [July 21, 2020, 4:17pm UTC](https://discourse.julialang.org/t/error-create-a-column-from-an-existing-array/43411 "2020-07-21T16:17:13Z")

</div>

Hello everyone, I’m trying to add a new column (in the first position) to an existing DataFrame (df) from an existing array (members) but when I run insertcols!(df,1, :Members =\>members), it show me following error: Ar…

---

## [Help using @btime correctly](https://discourse.julialang.org/t/help-using-btime-correctly/43433)

<div class="topic-metadata">

**Author:** [@jackf](https://discourse.julialang.org/u/jackf)\
**Replies:** 5\
**Last updated:** [July 21, 2020, 3:44pm UTC](https://discourse.julialang.org/t/help-using-btime-correctly/43433 "2020-07-21T15:44:40Z")

</div>

https://github.com/JuliaLang/julia/issues/36751#issuecomment-661883249 I’ve been told I’m not using @btime correctly. Can someone please explain how to profile the allocations of this function without allocating the out…

---

## [UndefVarError: Distributions not defined](https://discourse.julialang.org/t/undefvarerror-distributions-not-defined/43428)

<div class="topic-metadata">

**Author:** [@Juby\_Ruby](https://discourse.julialang.org/u/Juby_Ruby)\
**Replies:** 6\
**Last updated:** [July 21, 2020, 3:01pm UTC](https://discourse.julialang.org/t/undefvarerror-distributions-not-defined/43428 "2020-07-21T15:01:52Z")

</div>

Hi, I am very new to Julia but need it for numerical simulations for my master thesis. I am using the Distributions package, since I have to sample from a von Mises Distribution with parameter \\kappa. Generally sampli…

---

## [How do I find \`m\` and \`b\` such that \`some\_function((x) -\> m\*x + b)\` is maximized?](https://discourse.julialang.org/t/how-do-i-find-m-and-b-such-that-some-function-x-m-x-b-is-maximized/43429)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 3\
**Last updated:** [July 21, 2020, 2:51pm UTC](https://discourse.julialang.org/t/how-do-i-find-m-and-b-such-that-some-function-x-m-x-b-is-maximized/43429 "2020-07-21T14:51:51Z")

</div>

I have the following Julia function which calculates the expected mean of some model. I want to find m and b such that EBuy(4, (x) -\> m\*x + b) is maximized. using Distributions function EBuy(λ, buy ; limDefault=10^2) …

---

## [ML feature importance in julia](https://discourse.julialang.org/t/ml-feature-importance-in-julia/17196)

<div class="topic-metadata">

**Author:** [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Replies:** 15\
**Last updated:** [July 21, 2020, 2:41pm UTC](https://discourse.julialang.org/t/ml-feature-importance-in-julia/17196 "2020-07-21T14:41:43Z")

</div>

I am trying to fit decision tree and random forest classsifers in julia. Wanted to know what is the python equivalent of classifier.feature\_importance\_ in Julia.

---

## [Weird ldexp performance](https://discourse.julialang.org/t/weird-ldexp-performance/43416)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 4\
**Last updated:** [July 21, 2020, 2:12pm UTC](https://discourse.julialang.org/t/weird-ldexp-performance/43416 "2020-07-21T14:12:24Z")

</div>

I’m trying to write a faster implimentation of exp, and along the way, I noticed that I have no idea how fast ldexp is, and my efforts to benchmark it result in madness. My code is function myexp(x::Float64) # Redu…

---

## [Search for functions whose first argument can be a specific type](https://discourse.julialang.org/t/search-for-functions-whose-first-argument-can-be-a-specific-type/38318)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 4\
**Last updated:** [July 21, 2020, 1:06pm UTC](https://discourse.julialang.org/t/search-for-functions-whose-first-argument-can-be-a-specific-type/38318 "2020-07-21T13:06:38Z")

</div>

In object-oriented languages, it is easy to see what methods a type has. For example, to find a replace command for strings, I just need to search in the methods that a string object exposes (using, e.g., \_\_dict\_\_ in pyt…

---

## [Fixed degrees between two subgraphs](https://discourse.julialang.org/t/fixed-degrees-between-two-subgraphs/43430)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 0\
**Last updated:** [July 21, 2020, 12:45pm UTC](https://discourse.julialang.org/t/fixed-degrees-between-two-subgraphs/43430 "2020-07-21T12:45:42Z")

</div>

I have a graph of N nodes, no edges. I partition the graph pinto two subgraphs with N1 and N2 nodes. I would like to create edges between the two graphs such that the degree distribution in each graph is as close as pos…

---

## [Don't let Pkg downgrade packages automatically](https://discourse.julialang.org/t/dont-let-pkg-downgrade-packages-automatically/43424)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 10\
**Last updated:** [July 21, 2020, 12:16pm UTC](https://discourse.julialang.org/t/dont-let-pkg-downgrade-packages-automatically/43424 "2020-07-21T12:16:53Z")

</div>

I just installed Polynomials, which downgraded a bunch of my packages, and broke a lot of stuff. ERROR: LoadError: LoadError: UndefVarError: tostr\_sizehint not defined Stacktrace: \[1\] getproperty(::Module, ::Symbol) at…

---

## [Flux master is incompatible with GeometricFlux](https://discourse.julialang.org/t/flux-master-is-incompatible-with-geometricflux/43404)

<div class="topic-metadata">

**Author:** [@Naba7](https://discourse.julialang.org/u/Naba7)\
**Replies:** 6\
**Last updated:** [July 21, 2020, 12:14pm UTC](https://discourse.julialang.org/t/flux-master-is-incompatible-with-geometricflux/43404 "2020-07-21T12:14:33Z")

</div>

Since I need the Flux#master version for my testing of package FluxModels.jl, I am facing trouble in updating/adding it. I updated GeometricFlux.jl but still there is some error I can’t resolve. ERROR: Unsatisfiable req…

---

## [Handling Correlated shocks in HMM](https://discourse.julialang.org/t/handling-correlated-shocks-in-hmm/43355)

<div class="topic-metadata">

**Author:** [@balaji1975](https://discourse.julialang.org/u/balaji1975)\
**Replies:** 4\
**Last updated:** [July 21, 2020, 11:43am UTC](https://discourse.julialang.org/t/handling-correlated-shocks-in-hmm/43355 "2020-07-21T11:43:13Z")

</div>

Is there a way to handle the below in Turing? y(t) = f(y(t-1), s(t)) + g(y(t-1), s(t)) \* e1(t) s(t) = p(s(t-1)) + q(s(t-1)) \* e2(t) y(t) is the data (Tx1) and s(t) is the (hidden) state variable. e1 & e2 are correlate…

---

## [Export of SymPy symbol from module gives ReadOnlyMemoryError](https://discourse.julialang.org/t/export-of-sympy-symbol-from-module-gives-readonlymemoryerror/43426)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 0\
**Last updated:** [July 21, 2020, 10:36am UTC](https://discourse.julialang.org/t/export-of-sympy-symbol-from-module-gives-readonlymemoryerror/43426 "2020-07-21T10:36:53Z")

</div>

When I import the following module module MyMod using SymPy: symbols export b b = symbols("b") end and I try to access b from the REPL, I get: julia\> using MyMod; b Error showing value of type SymPy.Sym: ERROR: ReadOn…

---

## [Type problem](https://discourse.julialang.org/t/type-problem/43421)

<div class="topic-metadata">

**Author:** [@janrpeters](https://discourse.julialang.org/u/janrpeters)\
**Replies:** 1\
**Last updated:** [July 21, 2020, 10:25am UTC](https://discourse.julialang.org/t/type-problem/43421 "2020-07-21T10:25:44Z")

</div>

I have the method plotCDFComparison(p::Union{Type{Gumbel}, Type{Laplace}, Type{Logistic}, Type{Normal}}) ... end but when I run it as plotCDFComparison(Normal(μ,σ)); I get an error MethodError: no method matchin…

---

## [Distributed Arrays](https://discourse.julialang.org/t/distributed-arrays/43402)

<div class="topic-metadata">

**Author:** [@hyacykcharel](https://discourse.julialang.org/u/hyacykcharel)\
**Replies:** 3\
**Last updated:** [July 21, 2020, 8:14am UTC](https://discourse.julialang.org/t/distributed-arrays/43402 "2020-07-21T08:14:42Z")

</div>

hello how can I divide DistributedArrays A=drand(5,5) B=drand(5,1) C=A\\B Im doing this but still getting Error

---

## [Are Julia internals documented in depth somewhere or we need to read source code?](https://discourse.julialang.org/t/are-julia-internals-documented-in-depth-somewhere-or-we-need-to-read-source-code/43379)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 4\
**Last updated:** [July 21, 2020, 5:57am UTC](https://discourse.julialang.org/t/are-julia-internals-documented-in-depth-somewhere-or-we-need-to-read-source-code/43379 "2020-07-21T05:57:48Z")

</div>

Recently I need to check some properties of functions from Julia Base that was not mentioned in documentation. In such situation I know that few possible way to find answer. Read blog post/watch JuliaCon talk about thi…

---

## [Test Reports with JUnit XML or Cucumber JSON](https://discourse.julialang.org/t/test-reports-with-junit-xml-or-cucumber-json/34194)

<div class="topic-metadata">

**Author:** [@mopg](https://discourse.julialang.org/u/mopg)\
**Replies:** 1\
**Last updated:** [July 21, 2020, 5:13am UTC](https://discourse.julialang.org/t/test-reports-with-junit-xml-or-cucumber-json/34194 "2020-07-21T05:13:41Z")

</div>

Is anyone aware of a package that allows for creating JUnit XML or Cucumber JSON code test reports to be used in Jenkins and the like? I found TestReports.jl, but that doesn’t seem to be maintained. I believe it is als…

---

## [Looking for elegant cartesian grid array assignment](https://discourse.julialang.org/t/looking-for-elegant-cartesian-grid-array-assignment/43360)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 7\
**Last updated:** [July 21, 2020, 4:15am UTC](https://discourse.julialang.org/t/looking-for-elegant-cartesian-grid-array-assignment/43360 "2020-07-21T04:15:40Z")

</div>

I’m building an array of cube centers for a 3-D cartesion grid, something like (ignore for the moment, for simplicity, that the cube centers are actually located at an offset of dx/2, dy/2, dz/2). for i=1:nx for j=1:n…

---

## [Unable load WebIO](https://discourse.julialang.org/t/unable-load-webio/43412)

<div class="topic-metadata">

**Author:** [@stv1314](https://discourse.julialang.org/u/stv1314)\
**Replies:** 1\
**Last updated:** [July 21, 2020, 3:58am UTC](https://discourse.julialang.org/t/unable-load-webio/43412 "2020-07-21T03:58:48Z")

</div>

When I using Interact,it shows that Unable to load WeBIO,can anybody tell me what I should do

---

## [Convert a VariableRef in JuMP objective function or constraint](https://discourse.julialang.org/t/convert-a-variableref-in-jump-objective-function-or-constraint/43408)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 1\
**Last updated:** [July 21, 2020, 1:08am UTC](https://discourse.julialang.org/t/convert-a-variableref-in-jump-objective-function-or-constraint/43408 "2020-07-21T01:08:42Z")

</div>

I have a model with decision variables like this model = Model(Cbc.Optimizer) @variable(model, x\[1:num\_groups, 1:size(data, 1)\], Bin) and I need to be able to use the values of x to return a submatrix from another mat…

---

## [Debugging workflows](https://discourse.julialang.org/t/debugging-workflows/39487)

<div class="topic-metadata">

**Author:** [@ElectronicTeaCup](https://discourse.julialang.org/u/ElectronicTeaCup)\
**Replies:** 6\
**Last updated:** [July 20, 2020, 11:48pm UTC](https://discourse.julialang.org/t/debugging-workflows/39487 "2020-07-20T23:48:11Z")

</div>

I am unsure how to ask this but here goes: I am having difficulty debugging my code. Coming from a MATLAB background, I am used to a very smooth debugging experience. But with Julia, I’ve tried using the Juno debugger an…

---

## [Update a value in DataFrames.jl](https://discourse.julialang.org/t/update-a-value-in-dataframes-jl/43307)

<div class="topic-metadata">

**Author:** [@PabloGalaz](https://discourse.julialang.org/u/PabloGalaz)\
**Replies:** 2\
**Last updated:** [July 20, 2020, 10:54pm UTC](https://discourse.julialang.org/t/update-a-value-in-dataframes-jl/43307 "2020-07-20T22:54:04Z")

</div>

Hello everyone, Im using Julia 1.4.2 and DataFrames.jl 0.21.2 and I have the follow problem. I have an Dict with values that I want to replace in the column of certain DataFrame. The keys is a name and the value a Int.…

---

## [Cholesky Factorization of Transpose Matrix using LinearAlgebra raises Error](https://discourse.julialang.org/t/cholesky-factorization-of-transpose-matrix-using-linearalgebra-raises-error/43392)

<div class="topic-metadata">

**Author:** [@nil](https://discourse.julialang.org/u/nil)\
**Replies:** 2\
**Last updated:** [July 20, 2020, 9:49pm UTC](https://discourse.julialang.org/t/cholesky-factorization-of-transpose-matrix-using-linearalgebra-raises-error/43392 "2020-07-20T21:49:16Z")

</div>

\>versioninfo() Julia Version 1.4.2 Commit 44fa15b150\* (2020-05-23 18:35 UTC) Platform Info: OS: Linux (x86\_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz WORD\_SIZE: 64 LIBM: libopenlibm LLVM: li…

---

## [Scope of variable](https://discourse.julialang.org/t/scope-of-variable/43396)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 7\
**Last updated:** [July 20, 2020, 7:59pm UTC](https://discourse.julialang.org/t/scope-of-variable/43396 "2020-07-20T19:59:16Z")

</div>

This code runs as expected when let block is uncommented: using AbstractPlotting, GLMakie using GLMakie.GLFW using GLMakie: to\_native # let npoints = 10 points = Node(Point3f0.(rand(npoints), rand(npoints), rand(n…

---

## [Add lines of code in a struct definition](https://discourse.julialang.org/t/add-lines-of-code-in-a-struct-definition/43297)

<div class="topic-metadata">

**Author:** [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Replies:** 18\
**Last updated:** [July 20, 2020, 7:45pm UTC](https://discourse.julialang.org/t/add-lines-of-code-in-a-struct-definition/43297 "2020-07-20T19:45:29Z")

</div>

I have a way to generate a list of strings of lines of code I want to add in a struct. For example, let us say I generated a vector of strings: FieldDefinitions = \["A :: Float64", "B :: Int64"\] How would I go about add…

---

## [Copying struct fields to another struct](https://discourse.julialang.org/t/copying-struct-fields-to-another-struct/22493)

<div class="topic-metadata">

**Author:** [@aditya](https://discourse.julialang.org/u/aditya)\
**Replies:** 3\
**Last updated:** [July 20, 2020, 7:14pm UTC](https://discourse.julialang.org/t/copying-struct-fields-to-another-struct/22493 "2020-07-20T19:14:42Z")

</div>

For example I have an - abstract type A abstract type B \<: A struct C \<: B fields end Now, I want another struct D which has all fields of C but is a subtype of A i.e, struct D \<: A C fields end Is there a way…

---

## [Extending the \`@formula\` syntax to generate functions](https://discourse.julialang.org/t/extending-the-formula-syntax-to-generate-functions/42882)

<div class="topic-metadata">

**Author:** [@BrendonChau](https://discourse.julialang.org/u/BrendonChau)\
**Replies:** 3\
**Last updated:** [July 20, 2020, 6:23pm UTC](https://discourse.julialang.org/t/extending-the-formula-syntax-to-generate-functions/42882 "2020-07-20T18:23:42Z")

</div>

I’m working on a project trying to use @formula in a fairly novel way, for example, if I wanted to use GLM.jl to fit a linear model with two predictors and their interaction I would use something like this: f = @formula…

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

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