# Latest

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

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

**Page:** 989

---

## [Unable to add PyCall to any environment](https://discourse.julialang.org/t/unable-to-add-pycall-to-any-environment/83867)

<div class="topic-metadata">

**Author:** [@peter.wolf](https://discourse.julialang.org/u/peter.wolf)\
**Replies:** 6\
**Last updated:** [July 8, 2022, 1:04am UTC](https://discourse.julialang.org/t/unable-to-add-pycall-to-any-environment/83867 "2022-07-08T01:04:20Z")

</div>

I added an issue to PyCall.jl but I think it is more likely that something has become messed up on my laptop https://github.com/JuliaPy/PyCall.jl/issues/994 Basically, if I try to add PyCall to any environment, it fail…

---

## [How can I close files for writing within a loop](https://discourse.julialang.org/t/how-can-i-close-files-for-writing-within-a-loop/83923)

<div class="topic-metadata">

**Author:** [@thehalfspace](https://discourse.julialang.org/u/thehalfspace)\
**Replies:** 5\
**Last updated:** [July 8, 2022, 12:53am UTC](https://discourse.julialang.org/t/how-can-i-close-files-for-writing-within-a-loop/83923 "2022-07-08T00:53:13Z")

</div>

I want to store output for a simulation. I want to be able to change the number of output files the code creates based on user input. Here is what I have so far, everything is inside main: function main() out\_loc = \[5…

---

## [Why is this ternary operator not returning an error?](https://discourse.julialang.org/t/why-is-this-ternary-operator-not-returning-an-error/83924)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 11:59pm UTC](https://discourse.julialang.org/t/why-is-this-ternary-operator-not-returning-an-error/83924 "2022-07-07T23:59:38Z")

</div>

Kind of a silly question but I have the following formula f(x,y)= x+y \>0 ? x = y : 0 Where I incorrectly typed x==y as x=y However now when Input f(5,7) Julia just returns the y value, i.e. 7 julia\> f(5,7) 7 as opp…

---

## [Can't run simple JuMP example](https://discourse.julialang.org/t/cant-run-simple-jump-example/67938)

<div class="topic-metadata">

**Author:** [@Dan.phi](https://discourse.julialang.org/u/Dan.phi)\
**Replies:** 12\
**Last updated:** [July 7, 2022, 9:27pm UTC](https://discourse.julialang.org/t/cant-run-simple-jump-example/67938 "2022-07-07T21:27:22Z")

</div>

I am learning the basics of JuMP and tried running the code below, which computes the MLE of the parameters of a Gaussian distribution (mean and variance, source): using JuMP, Ipopt, Random, Statistics Random.seed!(12…

---

## [Morris Vs Sobol Method Global Sensitivity analysis](https://discourse.julialang.org/t/morris-vs-sobol-method-global-sensitivity-analysis/83571)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 25\
**Last updated:** [July 7, 2022, 7:46pm UTC](https://discourse.julialang.org/t/morris-vs-sobol-method-global-sensitivity-analysis/83571 "2022-07-07T19:46:23Z")

</div>

I am comparing a sensitivity analysis using both the Morris and Sobol method for the most part the methods agree. However 2 parameters appear to have low influence according to the Sobol method. But, when using the Morr…

---

## [Sort vector by frequency](https://discourse.julialang.org/t/sort-vector-by-frequency/14946)

<div class="topic-metadata">

**Author:** [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Replies:** 8\
**Last updated:** [July 7, 2022, 5:42pm UTC](https://discourse.julialang.org/t/sort-vector-by-frequency/14946 "2022-07-07T17:42:13Z")

</div>

I am trying to sort a vector of strings by the frequency of tis values. For instance: x = \["a", "b", "b", "c", "c", "c"\] Since there are 3 "c", 2 "b" and 1 "a", I would like to get a vector of uniques in that order: …

---

## [How to generate normalized random floats in range (0;1)](https://discourse.julialang.org/t/how-to-generate-normalized-random-floats-in-range-0-1/83852)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 4\
**Last updated:** [July 7, 2022, 5:22pm UTC](https://discourse.julialang.org/t/how-to-generate-normalized-random-floats-in-range-0-1/83852 "2022-07-07T17:22:38Z")

</div>

I need to generate normal random floats in range \[0;1\], but randn(Float64) uses a different range. How to fix it?

---

## [Warnings on importing BifurcationKit with Julia 1.5.3](https://discourse.julialang.org/t/warnings-on-importing-bifurcationkit-with-julia-1-5-3/83755)

<div class="topic-metadata">

**Author:** [@BThomas](https://discourse.julialang.org/u/BThomas)\
**Replies:** 4\
**Last updated:** [July 7, 2022, 3:39pm UTC](https://discourse.julialang.org/t/warnings-on-importing-bifurcationkit-with-julia-1-5-3/83755 "2022-07-07T15:39:36Z")

</div>

I have the following packages installed for Julia 1.5.3 that ships with Debian/stable. (@v1.5) pkg\> status Status \`~/.julia/environments/v1.5/Project.toml\` \[aae01518\] BandedMatrices v0.16.13 \[0f109fa4\] BifurcationKi…

---

## [Questions on NeuralPDE.jl](https://discourse.julialang.org/t/questions-on-neuralpde-jl/83846)

<div class="topic-metadata">

**Author:** [@marcofrancis](https://discourse.julialang.org/u/marcofrancis)\
**Replies:** 5\
**Last updated:** [July 7, 2022, 3:31pm UTC](https://discourse.julialang.org/t/questions-on-neuralpde-jl/83846 "2022-07-07T15:31:17Z")

</div>

Hi, I’m quite new to Julia and I discovered this amazing package. I have a couple of questions regarding it: 1 - Should I use Lux or Flux? It seems that Lux is used in almost all examples, but when using the gpu one sho…

---

## [Error saving plots in Makie](https://discourse.julialang.org/t/error-saving-plots-in-makie/83853)

<div class="topic-metadata">

**Author:** [@Adi\_Rai](https://discourse.julialang.org/u/Adi_Rai)\
**Replies:** 3\
**Last updated:** [July 7, 2022, 2:35pm UTC](https://discourse.julialang.org/t/error-saving-plots-in-makie/83853 "2022-07-07T14:35:05Z")

</div>

Hello Everyone, I was trying to save my plot as png images using Makie.jl in a for loop which constantly updates the plot. Here is my code snippet which saves the plot: where file\_no is the iterable variable in the …

---

## [WGLMakie with Jupyter on server](https://discourse.julialang.org/t/wglmakie-with-jupyter-on-server/83903)

<div class="topic-metadata">

**Author:** [@Sonicious](https://discourse.julialang.org/u/Sonicious)\
**Replies:** 0\
**Last updated:** [July 7, 2022, 2:31pm UTC](https://discourse.julialang.org/t/wglmakie-with-jupyter-on-server/83903 "2022-07-07T14:31:20Z")

</div>

Hello Julia Community, I struggle to get WGLMakie working on a Jupyter Lab. I have a notebook with the following cells: # Cell 1 using Pkg; Pkg.activate(;temp=true) Pkg.add(\["JSServe","WGLMakie"\]); #using JSServe; #JSS…

---

## [Lacking documentation about non-types as type parameters](https://discourse.julialang.org/t/lacking-documentation-about-non-types-as-type-parameters/83893)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [July 7, 2022, 1:31pm UTC](https://discourse.julialang.org/t/lacking-documentation-about-non-types-as-type-parameters/83893 "2022-07-07T13:31:24Z")

</div>

Type parameters can be non-types that are isbits (see 3rd bullet point in Types · The Julia Language): julia\> struct A{T} end julia\> A{1.2} A{1.2} julia\> A{'a'} A{'a'} julia\> A{π} A{π} julia\> A{1//2} A{1//2} julia\> …

---

## [Controling figure sizes in Jupyter's VSC extension](https://discourse.julialang.org/t/controling-figure-sizes-in-jupyters-vsc-extension/83889)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 0\
**Last updated:** [July 7, 2022, 12:04pm UTC](https://discourse.julialang.org/t/controling-figure-sizes-in-jupyters-vsc-extension/83889 "2022-07-07T12:04:38Z")

</div>

Hi, I started using the Jupyter VSC extension and I must say I’m very well impressed. But there is one issue that is a bit annoying, which is the figure sizes. When we have a command that generates a figure, that figure…

---

## [Clipping a mesh to a ball](https://discourse.julialang.org/t/clipping-a-mesh-to-a-ball/83833)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 18\
**Last updated:** [July 7, 2022, 11:42am UTC](https://discourse.julialang.org/t/clipping-a-mesh-to-a-ball/83833 "2022-07-07T11:42:00Z")

</div>

Hello, It looks like Makie has no functionality to clip a 3d mesh to a ball (i.e. to discard the part of the mesh which is outside the ball). Is there another package to achieve that? Motivation. This is possible with t…

---

## [How to make a function 120 times faster](https://discourse.julialang.org/t/how-to-make-a-function-120-times-faster/83848)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 15\
**Last updated:** [July 7, 2022, 10:15am UTC](https://discourse.julialang.org/t/how-to-make-a-function-120-times-faster/83848 "2022-07-07T10:15:39Z")

</div>

The function has the purpose of labeling the groups of “interconnected” cells \[two cells are connected if have a 1 and are side by side or one above the other\]. I had tried a first crude algorithm that did the job aroun…

---

## [Julia VS Code Extension on Apple Silicon](https://discourse.julialang.org/t/julia-vs-code-extension-on-apple-silicon/83772)

<div class="topic-metadata">

**Author:** [@Yue-Zhengyuan](https://discourse.julialang.org/u/Yue-Zhengyuan)\
**Replies:** 5\
**Last updated:** [July 7, 2022, 9:57am UTC](https://discourse.julialang.org/t/julia-vs-code-extension-on-apple-silicon/83772 "2022-07-07T09:57:29Z")

</div>

Is the latest Julia VS Code extension (version 1.6.24) able to run natively on Apple Silicon with the native build of VS Code (not the universal build)? I don’t have a Mac with Apple Silicon at hand so I cannot test now. …

---

## [Canvas in Stipple.jl](https://discourse.julialang.org/t/canvas-in-stipple-jl/83887)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 0\
**Last updated:** [July 7, 2022, 9:38am UTC](https://discourse.julialang.org/t/canvas-in-stipple-jl/83887 "2022-07-07T09:38:39Z")

</div>

Is there a canvas in Stipple.jl where programatically generated reactive SVGs can be displayed like konvajs? Similar to GtkReactive.jl?

---

## [Inconsistent UndefVarError](https://discourse.julialang.org/t/inconsistent-undefvarerror/83831)

<div class="topic-metadata">

**Author:** [@fsmith001](https://discourse.julialang.org/u/fsmith001)\
**Replies:** 12\
**Last updated:** [July 7, 2022, 9:18am UTC](https://discourse.julialang.org/t/inconsistent-undefvarerror/83831 "2022-07-07T09:18:47Z")

</div>

Hello everyone. I have a Julia project I have been working with in VSCode and it has been running just fine. I closed VSCode, reopened the project, and tried to run one of my files without making any changes and the foll…

---

## [Duplicated function documentation](https://discourse.julialang.org/t/duplicated-function-documentation/83882)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 9:05am UTC](https://discourse.julialang.org/t/duplicated-function-documentation/83882 "2022-07-07T09:05:24Z")

</div>

The documentation of a function with multiple methods is duplicated. """ doc of f """ f(m::AbstractMatrix) = g(m) f(r::AbstractVector) = g(h(r)) searching for the doc of the function help?\> f results in doc of f …

---

## [How to broadcast a value over functions instead of a function over values?](https://discourse.julialang.org/t/how-to-broadcast-a-value-over-functions-instead-of-a-function-over-values/83877)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 6\
**Last updated:** [July 7, 2022, 8:35am UTC](https://discourse.julialang.org/t/how-to-broadcast-a-value-over-functions-instead-of-a-function-over-values/83877 "2022-07-07T08:35:11Z")

</div>

This is a somewhat unusual usage, but I’m wondering if given julia\> M = \[sin cos; cos sin\] 2×2 Matrix{Function}: sin cos cos sin is there an easy way to broadcast the function evaluation over the elements for one s…

---

## [Improving performance of solving ODESystem (Catalyst.jl)](https://discourse.julialang.org/t/improving-performance-of-solving-odesystem-catalyst-jl/83568)

<div class="topic-metadata">

**Author:** [@SiddhantDeshmukh](https://discourse.julialang.org/u/SiddhantDeshmukh)\
**Replies:** 8\
**Last updated:** [July 7, 2022, 8:28am UTC](https://discourse.julialang.org/t/improving-performance-of-solving-odesystem-catalyst-jl/83568 "2022-07-07T08:28:19Z")

</div>

Hello, I have an ODESystem that I evolve using DifferentialEquations.jl and would like to improve the performance. Essentially, I create a reaction network using Catalyst.jl and iterate over many (density, temperature) …

---

## [Folds error in VSCode](https://discourse.julialang.org/t/folds-error-in-vscode/83880)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 1\
**Last updated:** [July 7, 2022, 7:30am UTC](https://discourse.julialang.org/t/folds-error-in-vscode/83880 "2022-07-07T07:30:58Z")

</div>

I’m seeing this error when trying to load Folds in VSCode: julia\> using Folds ERROR: InitError: UndefVarError: Implementations not defined Stacktrace: \[1\] parse\_pkg\_files(id::Base.PkgId) @ Revise ~/.julia/packages…

---

## [PackageCompiler.jl: packages(s) {MyCustomModules...} not in project](https://discourse.julialang.org/t/packagecompiler-jl-packages-s-mycustommodules-not-in-project/58080)

<div class="topic-metadata">

**Author:** [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 7:48am UTC](https://discourse.julialang.org/t/packagecompiler-jl-packages-s-mycustommodules-not-in-project/58080 "2022-07-07T07:48:55Z")

</div>

I’m trying to use PackageCompiler.jl to reduce the startup time for a server that uses some custom modules (CreditScoreEstimation, WalletOptimization, UserProfiles). approvalPath = joinpath(@\_\_DIR\_\_, "Algorithms-Approva…

---

## [Convert a matrix to a dictionary](https://discourse.julialang.org/t/convert-a-matrix-to-a-dictionary/83872)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 7:11am UTC](https://discourse.julialang.org/t/convert-a-matrix-to-a-dictionary/83872 "2022-07-07T07:11:34Z")

</div>

Suppose I have a 40122 matrix, and a 122-element vector. I want to convert the matrix to a dictionary, in which keys are the elements of the 122-element vector, values are vectors of the 40122 matrix. How can I get that?…

---

## [\[ANN\] Bokeh.jl, another plotting library!](https://discourse.julialang.org/t/ann-bokeh-jl-another-plotting-library/81070)

<div class="topic-metadata">

**Author:** [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Replies:** 12\
**Last updated:** [July 7, 2022, 6:29am UTC](https://discourse.julialang.org/t/ann-bokeh-jl-another-plotting-library/81070 "2022-07-07T06:29:24Z")

</div>

Bokeh.jl Because there just aren’t enough plotting libraries for Julia, I made another one. This one wraps BokehJS, which is the JavaScript component of the python Bokeh package (though it doesn’t actually call Python).…

---

## [Subplot function in Julia](https://discourse.julialang.org/t/subplot-function-in-julia/83810)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 14\
**Last updated:** [July 7, 2022, 2:17am UTC](https://discourse.julialang.org/t/subplot-function-in-julia/83810 "2022-07-07T02:17:12Z")

</div>

Hi, I’m trying to get a plot function in Julia. This is my code function split(pt1,pt2::Number) x = \[\] y = \[\] for i in 1:122 if matrix\[1,i\] \> pt1 & matrix\[1,i\] \< pt2 push!(x, matrix\[1,i\])…

---

## [Flux/Lux - Combining two neural networks](https://discourse.julialang.org/t/flux-lux-combining-two-neural-networks/83868)

<div class="topic-metadata">

**Author:** [@raphaelchinchilla](https://discourse.julialang.org/u/raphaelchinchilla)\
**Replies:** 1\
**Last updated:** [July 7, 2022, 1:21am UTC](https://discourse.julialang.org/t/flux-lux-combining-two-neural-networks/83868 "2022-07-07T01:21:51Z")

</div>

I want to design a neural network whose output is the combination of the outputs of two neural networks; a very simple example would be the output of two Dense layers. Intuitively, I would want to write something like m…

---

## [Creating Generators](https://discourse.julialang.org/t/creating-generators/3962)

<div class="topic-metadata">

**Author:** [@rokkuran](https://discourse.julialang.org/u/rokkuran)\
**Replies:** 32\
**Last updated:** [July 6, 2022, 8:34pm UTC](https://discourse.julialang.org/t/creating-generators/3962 "2022-07-06T20:34:58Z")

</div>

I’ve been playing around with Julia lately and have been enjoying it. I have come from python and as a learning exercise was looking at re-writing some code I had written to do least significant bit embedding. I’m wonde…

---

## [Optimization: How to make sure XOR is performed in chunks](https://discourse.julialang.org/t/optimization-how-to-make-sure-xor-is-performed-in-chunks/33947)

<div class="topic-metadata">

**Author:** [@lesshaste](https://discourse.julialang.org/u/lesshaste)\
**Replies:** 33\
**Last updated:** [July 6, 2022, 7:18pm UTC](https://discourse.julialang.org/t/optimization-how-to-make-sure-xor-is-performed-in-chunks/33947 "2022-07-06T19:18:06Z")

</div>

I have written my first complete piece of Julia code as follows: using Random: bitrand function hamming(bits1, bits2) return count(bits1 .⊻ bits2) end function random\_strings(n, N) return \[bitrand(n) for i in …

---

## [Looping in multiple dimensions extremely slow](https://discourse.julialang.org/t/looping-in-multiple-dimensions-extremely-slow/83793)

<div class="topic-metadata">

**Author:** [@dforero0896](https://discourse.julialang.org/u/dforero0896)\
**Replies:** 6\
**Last updated:** [July 6, 2022, 6:04pm UTC](https://discourse.julialang.org/t/looping-in-multiple-dimensions-extremely-slow/83793 "2022-07-06T18:04:32Z")

</div>

Hi all, I am quite new to julia and I have been rewriting some old code in Julia as practice. I am currently writing a code to compute the power spectrum of a 3D field. The code consists basically of these two functions: …

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

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