# Latest

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

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

**Page:** 917

---

## [Error in the Sparsity section of the SumofSquare package](https://discourse.julialang.org/t/error-in-the-sparsity-section-of-the-sumofsquare-package/87597)

<div class="topic-metadata">

**Author:** [@Khashayar-Neshat](https://discourse.julialang.org/u/Khashayar-Neshat)\
**Replies:** 12\
**Last updated:** [September 23, 2022, 1:36am UTC](https://discourse.julialang.org/t/error-in-the-sparsity-section-of-the-sumofsquare-package/87597 "2022-09-23T01:36:17Z")

</div>

Hi, I am using Julia 1.8.0 in windows 10, and I have updated all my packages. I want to implement the example in the sparsity section of the SumofSquare package (Term sparsity · SumOfSquares). when I run the following …

---

## [Can dicts be threadsafe?](https://discourse.julialang.org/t/can-dicts-be-threadsafe/27172)

<div class="topic-metadata">

**Author:** [@subunit](https://discourse.julialang.org/u/subunit)\
**Replies:** 17\
**Last updated:** [September 22, 2022, 10:58pm UTC](https://discourse.julialang.org/t/can-dicts-be-threadsafe/27172 "2022-09-22T22:58:45Z")

</div>

dict = Dict{Int64,Vector{Float64}}() nentries = 5e5 Threads.@threads for n in 1:nentries dict\[n\] = \[rand() for i in 1:100\] end @assert length(dict) == nentries The assertion fails for me in Julia 1.1.0, as the dic…

---

## [How to use my CPU's](https://discourse.julialang.org/t/how-to-use-my-cpus/87390)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 13\
**Last updated:** [September 22, 2022, 10:50pm UTC](https://discourse.julialang.org/t/how-to-use-my-cpus/87390 "2022-09-22T22:50:32Z")

</div>

I instantiated an environment and watched for 533 seconds as it compiled over 100 packages. During this time julia cpu useage maxed at 12%, i.e., one of the 8 cores I have. What is the best way to use more of my cores?…

---

## [Failed prediction from BetaML DecisionTreeClassifier](https://discourse.julialang.org/t/failed-prediction-from-betaml-decisiontreeclassifier/87327)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 10\
**Last updated:** [September 22, 2022, 9:16pm UTC](https://discourse.julialang.org/t/failed-prediction-from-betaml-decisiontreeclassifier/87327 "2022-09-22T21:16:41Z")

</div>

I am trying to do inference on the Adult dataset, which has a binary response variable (income below or above $50k/year). Seemingly I am able to train a Decision Tree using the dataset (as loaded using Fairness.jl), but …

---

## [MvNorm for several vectors at once](https://discourse.julialang.org/t/mvnorm-for-several-vectors-at-once/87673)

<div class="topic-metadata">

**Author:** [@laurar1891](https://discourse.julialang.org/u/laurar1891)\
**Replies:** 3\
**Last updated:** [September 22, 2022, 8:58pm UTC](https://discourse.julialang.org/t/mvnorm-for-several-vectors-at-once/87673 "2022-09-22T20:58:50Z")

</div>

I’m trying to calculate some probabilities using MvNorm. For a univariate case I would do the following to get the probabilities for a vector, all at once: Norm\_uni = Normal(2,1) #Creates the Normal dist xvect = \[2,…

---

## [Dreaded CuArray only supports element types that are stored inline](https://discourse.julialang.org/t/dreaded-cuarray-only-supports-element-types-that-are-stored-inline/87100)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 10\
**Last updated:** [September 22, 2022, 8:37pm UTC](https://discourse.julialang.org/t/dreaded-cuarray-only-supports-element-types-that-are-stored-inline/87100 "2022-09-22T20:37:33Z")

</div>

GPU noob. I’ve simplified my problem here. I have a compression type which basically has information that yields the correct phase adjustment. But it is an abstract composite type which could have various memory footp…

---

## [Failed to compile PTX code when using NSight on Win11](https://discourse.julialang.org/t/failed-to-compile-ptx-code-when-using-nsight-on-win11/87607)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 1\
**Last updated:** [September 22, 2022, 8:33pm UTC](https://discourse.julialang.org/t/failed-to-compile-ptx-code-when-using-nsight-on-win11/87607 "2022-09-22T20:33:22Z")

</div>

A = CUDA.rand(100,100) sin.(A) works for normally started Julia process but errors when started in NVIDIA NSight 22.4.1 on Windows 11 julia\> sin.(A) ERROR: Failed to compile PTX code (ptxas exited with code 3221225477)…

---

## [Writing Mat Files to Disk](https://discourse.julialang.org/t/writing-mat-files-to-disk/87532)

<div class="topic-metadata">

**Author:** [@yoshi](https://discourse.julialang.org/u/yoshi)\
**Replies:** 8\
**Last updated:** [September 22, 2022, 8:31pm UTC](https://discourse.julialang.org/t/writing-mat-files-to-disk/87532 "2022-09-22T20:31:10Z")

</div>

I’m trying to save the outputs for my ODE simulations into a file I can open in MATLAB for analysis. I’m using the MAT library. I’m obtaining the following error (with stacktrace). The code that produce the error follows…

---

## [Flux on GPU too slow](https://discourse.julialang.org/t/flux-on-gpu-too-slow/87621)

<div class="topic-metadata">

**Author:** [@vkarystinos](https://discourse.julialang.org/u/vkarystinos)\
**Replies:** 5\
**Last updated:** [September 22, 2022, 8:10pm UTC](https://discourse.julialang.org/t/flux-on-gpu-too-slow/87621 "2022-09-22T20:10:51Z")

</div>

Hi, I am training a number of NNs with Flux and Cuda. However, the training procedure is not accelerated as expected on GPU. I used the CuIterator as described in the docs for GPU training. Any ideas on how can I acceler…

---

## [GPU Kernel Compilation Error](https://discourse.julialang.org/t/gpu-kernel-compilation-error/87670)

<div class="topic-metadata">

**Author:** [@yoshi](https://discourse.julialang.org/u/yoshi)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 7:55pm UTC](https://discourse.julialang.org/t/gpu-kernel-compilation-error/87670 "2022-09-22T19:55:11Z")

</div>

I’m porting some code from my CPU to GPU. I’m obtaining the error that I’ve copied below. The only thing I can think is the problem that my array of initial conditions are scoped incorrectly for problem func. But this is…

---

## [While loop iteration](https://discourse.julialang.org/t/while-loop-iteration/87667)

<div class="topic-metadata">

**Author:** [@Eric.O](https://discourse.julialang.org/u/Eric.O)\
**Replies:** 4\
**Last updated:** [September 22, 2022, 7:30pm UTC](https://discourse.julialang.org/t/while-loop-iteration/87667 "2022-09-22T19:30:24Z")

</div>

I think there is a problem with my while loop in this code. My aim is to find new values of (S\_0 and z\_0) in my code if the condition in the while loop holds. I keep getting just one iteration count thou I expect more th…

---

## [Breakpoint in Julia?](https://discourse.julialang.org/t/breakpoint-in-julia/87668)

<div class="topic-metadata">

**Author:** [@Muhammad\_Nadeem](https://discourse.julialang.org/u/Muhammad_Nadeem)\
**Replies:** 2\
**Last updated:** [September 22, 2022, 6:55pm UTC](https://discourse.julialang.org/t/breakpoint-in-julia/87668 "2022-09-22T18:55:22Z")

</div>

Hello all, I am shifting from MATLAB to julia and still learning the basics. I was curious to know that is there a way to add a breakpoint in Julia? Like in MATLAB if we put a breakpoint and in the code then MATALB will…

---

## [Basic questions when migrating from matlab to julia](https://discourse.julialang.org/t/basic-questions-when-migrating-from-matlab-to-julia/87658)

<div class="topic-metadata">

**Author:** [@Muhammad\_Nadeem](https://discourse.julialang.org/u/Muhammad_Nadeem)\
**Replies:** 8\
**Last updated:** [September 22, 2022, 6:47pm UTC](https://discourse.julialang.org/t/basic-questions-when-migrating-from-matlab-to-julia/87658 "2022-09-22T18:47:56Z")

</div>

Hello all, I have a Matrix M = \[1 2 3; 3 2 1\] In julia if i want to extract the first row of the matrix then i am using M1 = M\[1, :\] But since i am extracting 1st row then M1 should remain a row vector 1x3, but it i…

---

## [Allocations due to Boolean keyword arguments - how to avoid them?](https://discourse.julialang.org/t/allocations-due-to-boolean-keyword-arguments-how-to-avoid-them/87654)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 9\
**Last updated:** [September 22, 2022, 6:00pm UTC](https://discourse.julialang.org/t/allocations-due-to-boolean-keyword-arguments-how-to-avoid-them/87654 "2022-09-22T18:00:08Z")

</div>

Deep in one of my projects I have a function that slightly changes behavior depending on a boolean keyword. It seems if the keyword is Val{Bool} there are no allocations but if it is Bool, then it allocates. Here is a co…

---

## [ImageFeatures.hough\_circle\_gradient example is broken](https://discourse.julialang.org/t/imagefeatures-hough-circle-gradient-example-is-broken/87636)

<div class="topic-metadata">

**Author:** [@Ondo](https://discourse.julialang.org/u/Ondo)\
**Replies:** 2\
**Last updated:** [September 22, 2022, 5:49pm UTC](https://discourse.julialang.org/t/imagefeatures-hough-circle-gradient-example-is-broken/87636 "2022-09-22T17:49:27Z")

</div>

I really want to build something on the “find all circles in image” example seen near the bottom of this web-page: Function reference · ImageFeatures Initially it worked with the provided image but gave rise to errors w…

---

## [Call back with matrix](https://discourse.julialang.org/t/call-back-with-matrix/87584)

<div class="topic-metadata">

**Author:** [@Fabrizio](https://discourse.julialang.org/u/Fabrizio)\
**Replies:** 4\
**Last updated:** [September 22, 2022, 4:28pm UTC](https://discourse.julialang.org/t/call-back-with-matrix/87584 "2022-09-22T16:28:05Z")

</div>

Hi, the following code fom Jump manual works a scalar value, x and x\_val x\_val = callback\_value(cb\_data, x) status = MOI.submit( model, MOI.HeuristicSolution(cb\_data), \[x\], \[floor(Int, x\_val)\] ) how about submit …

---

## [Questions of vector](https://discourse.julialang.org/t/questions-of-vector/87652)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 9\
**Last updated:** [September 22, 2022, 3:58pm UTC](https://discourse.julialang.org/t/questions-of-vector/87652 "2022-09-22T15:58:56Z")

</div>

julia\> a=\[(1,1),(1,2),(1,3),(1,4),(2,1),(2,2)\] 6-element Vector{Tuple{Int64, Int64}}: (1, 1) (1, 2) (1, 3) (1, 4) (2, 1) (2, 2) There is a vector called a.If i input 1,I want to return \[1,2,3.4\].Also if I input 2,…

---

## [Np.select equivalent to deal with multiple conditions](https://discourse.julialang.org/t/np-select-equivalent-to-deal-with-multiple-conditions/87639)

<div class="topic-metadata">

**Author:** [@CompulsoryCoffee](https://discourse.julialang.org/u/CompulsoryCoffee)\
**Replies:** 6\
**Last updated:** [September 22, 2022, 3:05pm UTC](https://discourse.julialang.org/t/np-select-equivalent-to-deal-with-multiple-conditions/87639 "2022-09-22T15:05:35Z")

</div>

Hi, I am looking for an equivalent to np.select. How would you reproduce the following python code in Julia so it would work with n conditions? x = np.arange(6) condlist = \[x\<3, x\>3\] choicelist = \[x, x\*\*2\] np.select(c…

---

## [Two types of blocked updates/upgrades of packages in 1.8](https://discourse.julialang.org/t/two-types-of-blocked-updates-upgrades-of-packages-in-1-8/85474)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 7\
**Last updated:** [September 22, 2022, 2:31pm UTC](https://discourse.julialang.org/t/two-types-of-blocked-updates-upgrades-of-packages-in-1-8/85474 "2022-09-22T14:31:54Z")

</div>

In the latest release candidate (v1.8.0-rc3) I can notice a new feature of the package manager, namely, after listing all packages in the given environment with status, I get this as the final line: Info Packages marked…

---

## [Pmap suddenly after running for some time gives Load Error](https://discourse.julialang.org/t/pmap-suddenly-after-running-for-some-time-gives-load-error/87646)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 2:08pm UTC](https://discourse.julialang.org/t/pmap-suddenly-after-running-for-some-time-gives-load-error/87646 "2022-09-22T14:08:46Z")

</div>

I am paralellizing, with the library Distributed (pmap method), calling the JuMP solver Ipopt across different agents (“utilities”). The results for each agent are then vertically concatenated into a DataFrame. The code …

---

## [How best to debug a Pluto notebook?](https://discourse.julialang.org/t/how-best-to-debug-a-pluto-notebook/87643)

<div class="topic-metadata">

**Author:** [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 1:31pm UTC](https://discourse.julialang.org/t/how-best-to-debug-a-pluto-notebook/87643 "2022-09-22T13:31:46Z")

</div>

A lot of times when I write julia in a Pluto notebook, I run into the following problem. Let’s say I’m trying to change the name of variable. When I first change it, everything breaks. Because Pluto is reactive, I woul…

---

## [How to run two tasks on parallel?](https://discourse.julialang.org/t/how-to-run-two-tasks-on-parallel/86902)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 30\
**Last updated:** [September 22, 2022, 1:29pm UTC](https://discourse.julialang.org/t/how-to-run-two-tasks-on-parallel/86902 "2022-09-22T13:29:07Z")

</div>

if I have two tasks and I need to them on parallel. What is the organization to do that in Julia? For example the following using LinearAlgebra, SparseArrays, n = 1000; d = 10; A1 = sprand(n,n,d/n); x1 = rand(n); A2 = s…

---

## [Trouble Defining Variable](https://discourse.julialang.org/t/trouble-defining-variable/87603)

<div class="topic-metadata">

**Author:** [@mhbw](https://discourse.julialang.org/u/mhbw)\
**Replies:** 5\
**Last updated:** [September 22, 2022, 1:21pm UTC](https://discourse.julialang.org/t/trouble-defining-variable/87603 "2022-09-22T13:21:18Z")

</div>

I’ve been working to create an updated version of this repo, which uses JuMP, GLPK and Julia to perform a linear optimization. I think I’ve correctly updated the bulk of it (replacing @setObjective with objective type th…

---

## [TeeLogger and stdout/stderr redirection](https://discourse.julialang.org/t/teelogger-and-stdout-stderr-redirection/87641)

<div class="topic-metadata">

**Author:** [@dapz](https://discourse.julialang.org/u/dapz)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 12:59pm UTC](https://discourse.julialang.org/t/teelogger-and-stdout-stderr-redirection/87641 "2022-09-22T12:59:17Z")

</div>

Hi, I would like to run some code and get all the outputs: (1) either on the console or (2) redirected to a file or (3) both at the same time. I have been using Logging utilities and LoggingExtras to define a TeeLogger t…

---

## [Raylib language bindings](https://discourse.julialang.org/t/raylib-language-bindings/75478)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 5\
**Last updated:** [September 22, 2022, 1:03pm UTC](https://discourse.julialang.org/t/raylib-language-bindings/75478 "2022-09-22T13:03:17Z")

</div>

The thread below was about raylib, but it was really meant to be questions about Clang vs CBindingGen with raylib as the concrete example. I thought it might be useful to start a raylib binding specific thread, that w…

---

## [Using modelling toolkitize to generate sparse jacobian - error](https://discourse.julialang.org/t/using-modelling-toolkitize-to-generate-sparse-jacobian-error/87633)

<div class="topic-metadata">

**Author:** [@hbooth](https://discourse.julialang.org/u/hbooth)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 10:01am UTC](https://discourse.julialang.org/t/using-modelling-toolkitize-to-generate-sparse-jacobian-error/87633 "2022-09-22T10:01:00Z")

</div>

Hi everyone, I am trying to use modelingtoolkitize to regenerate an ODEProblem with the analytical solution to the sparse Jacobian , as in this tutorial: Automated Sparse Analytical Jacobians · ModelingToolkit.jl I am m…

---

## [Zygote @adjoint usage for covariance matrix calculation](https://discourse.julialang.org/t/zygote-adjoint-usage-for-covariance-matrix-calculation/87352)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 4\
**Last updated:** [September 22, 2022, 10:01am UTC](https://discourse.julialang.org/t/zygote-adjoint-usage-for-covariance-matrix-calculation/87352 "2022-09-22T10:01:46Z")

</div>

Hello, I implemented Fréchet distance for using it as a loss function in Flux. But Zygote is not happy because it does not recognize the covariance calculation. The documentation of Zygote package has a custom adjoint …

---

## [Orbit diagram from the sum of two variables DynamicalSystems.jl](https://discourse.julialang.org/t/orbit-diagram-from-the-sum-of-two-variables-dynamicalsystems-jl/87620)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 4\
**Last updated:** [September 22, 2022, 9:57am UTC](https://discourse.julialang.org/t/orbit-diagram-from-the-sum-of-two-variables-dynamicalsystems-jl/87620 "2022-09-22T09:57:12Z")

</div>

Hello, I need to repeat the following orbit diagram, where 𝑥||𝑚𝑎𝑥 is maximums from 𝑥|| = x1 + x2. I know how calculate him from two variable but i don’t know how ploting him, examples in documentation only for one varia…

---

## [How to have "Go to definition" in VSCODE find functions defined in src folder of current environment?](https://discourse.julialang.org/t/how-to-have-go-to-definition-in-vscode-find-functions-defined-in-src-folder-of-current-environment/87631)

<div class="topic-metadata">

**Author:** [@Shane\_Kelly](https://discourse.julialang.org/u/Shane_Kelly)\
**Replies:** 0\
**Last updated:** [September 22, 2022, 9:56am UTC](https://discourse.julialang.org/t/how-to-have-go-to-definition-in-vscode-find-functions-defined-in-src-folder-of-current-environment/87631 "2022-09-22T09:56:20Z")

</div>

I am developing a project with a stardard folder structure: base/ base/Project.toml base/src/ base/src/file.jl When specify in vscode that I should use the environment defined with the base/Project.toml then I can “…

---

## [Is it possible to display html in vscode?](https://discourse.julialang.org/t/is-it-possible-to-display-html-in-vscode/87571)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [September 22, 2022, 9:06am UTC](https://discourse.julialang.org/t/is-it-possible-to-display-html-in-vscode/87571 "2022-09-22T09:06:46Z")

</div>

I have the following code: julia\> show(stdout, "text/html", res) \<p\> \<h3\>Charger log(s):\</h3\> \<span style="font-family: monospace; color: #270"\>Message: "No buffer space" not found!\</span\>\<br\> \<span style="f…

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

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