# Latest

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

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

**Page:** 795

---

## [How to add gaussian noise with different standard deviations to different elements of an array?](https://discourse.julialang.org/t/how-to-add-gaussian-noise-with-different-standard-deviations-to-different-elements-of-an-array/93906)

<div class="topic-metadata">

**Author:** [@CurioMath](https://discourse.julialang.org/u/CurioMath)\
**Replies:** 1\
**Last updated:** [February 2, 2023, 6:18am UTC](https://discourse.julialang.org/t/how-to-add-gaussian-noise-with-different-standard-deviations-to-different-elements-of-an-array/93906 "2023-02-02T06:18:04Z")

</div>

Hi, I have an array of measurements of different variables, of varying magnitude, to which I have to add gaussian noise. But note that I have to add noise with different standard deviation to each measurement(i.e. to ea…

---

## [Introduction to Julia for Data Science Short course @ MIT](https://discourse.julialang.org/t/introduction-to-julia-for-data-science-short-course-mit/90062)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 5\
**Last updated:** [February 2, 2023, 9:44am UTC](https://discourse.julialang.org/t/introduction-to-julia-for-data-science-short-course-mit/90062 "2023-02-02T09:44:03Z")

</div>

For anyone interested, there is a 4-day “Introduction to Julia for Data Science” short course organized at MIT on Jan 17-20, 2023. You can find a PDF with the schedule here. The course instructors are be both from acade…

---

## [Is there a way to limit memory as reported by Sys.total\_memory()?](https://discourse.julialang.org/t/is-there-a-way-to-limit-memory-as-reported-by-sys-total-memory/93909)

<div class="topic-metadata">

**Author:** [@evanderveer](https://discourse.julialang.org/u/evanderveer)\
**Replies:** 2\
**Last updated:** [February 2, 2023, 9:29am UTC](https://discourse.julialang.org/t/is-there-a-way-to-limit-memory-as-reported-by-sys-total-memory/93909 "2023-02-02T09:29:32Z")

</div>

I am trying to run my Julia code on a computing cluster running SLURM. It runs just fine on my own pc, but whenever I try to run it on the cluster (even when I give it the same amount of total memory), my job gets cancel…

---

## [Solving linear equations in Laplacians and SDD matrices](https://discourse.julialang.org/t/solving-linear-equations-in-laplacians-and-sdd-matrices/93911)

<div class="topic-metadata">

**Author:** [@ahmad88](https://discourse.julialang.org/u/ahmad88)\
**Replies:** 0\
**Last updated:** [February 2, 2023, 9:13am UTC](https://discourse.julialang.org/t/solving-linear-equations-in-laplacians-and-sdd-matrices/93911 "2023-02-02T09:13:31Z")

</div>

I am trying to solve linear equations for SDD matrix as follows a= ring\_graph(5) la=lap(a) b = randn(size(la,1)) sddm = copy(la); # doing it with a SDDM matrix sddm\[1,1\] += 1; sol = approxchol\_sddm(sddm,verbose=true) x …

---

## [Unevenly spaced x in a plot (automatic plotting of functions)](https://discourse.julialang.org/t/unevenly-spaced-x-in-a-plot-automatic-plotting-of-functions/93903)

<div class="topic-metadata">

**Author:** [@nari](https://discourse.julialang.org/u/nari)\
**Replies:** 4\
**Last updated:** [February 2, 2023, 8:57am UTC](https://discourse.julialang.org/t/unevenly-spaced-x-in-a-plot-automatic-plotting-of-functions/93903 "2023-02-02T08:57:25Z")

</div>

I recently learned that I can plot a function f(x) as follows. using Plots f(x) = 1/(1+exp(-x)) scatter(f, (-10.0,10.0)...) And, I noticed that the plot is not evenly spaced with respect to the x-axis when plotted with…

---

## [Understanding in-place broadcasting syntax (.=)](https://discourse.julialang.org/t/understanding-in-place-broadcasting-syntax/93888)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 10\
**Last updated:** [February 2, 2023, 8:27am UTC](https://discourse.julialang.org/t/understanding-in-place-broadcasting-syntax/93888 "2023-02-02T08:27:50Z")

</div>

I guess the dot in front of the equal sign is a typo?

---

## [Multi-threading on a 2 CPU system](https://discourse.julialang.org/t/multi-threading-on-a-2-cpu-system/93785)

<div class="topic-metadata">

**Author:** [@ReWoP](https://discourse.julialang.org/u/ReWoP)\
**Replies:** 15\
**Last updated:** [February 2, 2023, 8:21am UTC](https://discourse.julialang.org/t/multi-threading-on-a-2-cpu-system/93785 "2023-02-02T08:21:13Z")

</div>

Hi all, As a new Julia programmer, I’m fascinated by its syntax, code examples availability, its community, and, more importantly, its performance! Now that I’m having my first experience on Thread Parallelism, I foun…

---

## [Integrating MLUtils.DataLoader and image augmentation pipeline on custom dataset](https://discourse.julialang.org/t/integrating-mlutils-dataloader-and-image-augmentation-pipeline-on-custom-dataset/93887)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 5\
**Last updated:** [February 2, 2023, 7:05am UTC](https://discourse.julialang.org/t/integrating-mlutils-dataloader-and-image-augmentation-pipeline-on-custom-dataset/93887 "2023-02-02T07:05:08Z")

</div>

Hi, I’m trying to create a custom dataset where getobs performs random image augmentations. The DataLoader docs suggest that my dataset has to have custom numobs and getobs calls. So this is my code: struct my\_datase…

---

## [How do I see errors encountered in async coroutines/tasks?](https://discourse.julialang.org/t/how-do-i-see-errors-encountered-in-async-coroutines-tasks/44134)

<div class="topic-metadata">

**Author:** [@coldinjection](https://discourse.julialang.org/u/coldinjection)\
**Replies:** 3\
**Last updated:** [February 2, 2023, 5:48am UTC](https://discourse.julialang.org/t/how-do-i-see-errors-encountered-in-async-coroutines-tasks/44134 "2023-02-02T05:48:27Z")

</div>

There will be no error message in the RPEL if an error is encountered in an async task, unless you check the state of the task. I find it super difficult to detect errors in async tasks when the tasks are not in the top …

---

## [Defining a JuMP binary variable](https://discourse.julialang.org/t/defining-a-jump-binary-variable/93904)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 1\
**Last updated:** [February 2, 2023, 4:44am UTC](https://discourse.julialang.org/t/defining-a-jump-binary-variable/93904 "2023-02-02T04:44:44Z")

</div>

Is there a difference in performance within JuMP, MOI, and/or the third-party MILP solver between the two possible ways of defining a binary variable given below? @variable(m, b, Int, lower\_bound = 0, upper\_bound = 1) …

---

## [Makie | Figure(resolution = Makie.primary\_resolution()) deprecated?](https://discourse.julialang.org/t/makie-figure-resolution-makie-primary-resolution-deprecated/93854)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 4\
**Last updated:** [February 2, 2023, 4:44am UTC](https://discourse.julialang.org/t/makie-figure-resolution-makie-primary-resolution-deprecated/93854 "2023-02-02T04:44:41Z")

</div>

Makie.primary\_resolution() is \[was?\] a useful function for setting images to full screen size in GLMakie. However, after the release of Makie v0.19.2 a call to this function generates an error message stating that the…

---

## [Avoiding Allocations with User provided Closures](https://discourse.julialang.org/t/avoiding-allocations-with-user-provided-closures/31279)

<div class="topic-metadata">

**Author:** [@cshenton](https://discourse.julialang.org/u/cshenton)\
**Replies:** 12\
**Last updated:** [February 2, 2023, 3:29am UTC](https://discourse.julialang.org/t/avoiding-allocations-with-user-provided-closures/31279 "2023-02-02T03:29:41Z")

</div>

I’m writing a query API that allows a user to pass in a closure to be run on every entry satisfying the query, however this usually results in undesirable boxing. For example, here’s the kind of API I want to offer, with…

---

## [Saving output of ODE simulations](https://discourse.julialang.org/t/saving-output-of-ode-simulations/93884)

<div class="topic-metadata">

**Author:** [@yoshi](https://discourse.julialang.org/u/yoshi)\
**Replies:** 1\
**Last updated:** [February 2, 2023, 2:11am UTC](https://discourse.julialang.org/t/saving-output-of-ode-simulations/93884 "2023-02-02T02:11:01Z")

</div>

I’m trying to save the outputs of solve from the differentialEquations package. After running my simulation sim, I run load JLD. Then run save("temp.jld","sim",sim). However, when I load again (after I’ve loaded the r…

---

## [Subtype for UnionAll](https://discourse.julialang.org/t/subtype-for-unionall/93896)

<div class="topic-metadata">

**Author:** [@romatead](https://discourse.julialang.org/u/romatead)\
**Replies:** 1\
**Last updated:** [February 2, 2023, 1:10am UTC](https://discourse.julialang.org/t/subtype-for-unionall/93896 "2023-02-02T01:10:10Z")

</div>

Dear all, I would like to define ab abstract type T1{T} as a UnionAll and to be a subtype of an abstract type T0{T}. How can I define a type with the const syntax as a subtype of an abstract type ? The following does n…

---

## [How do you correctly align array memory when using unsafe\_store! to write a struct array to a c or fortran program?](https://discourse.julialang.org/t/how-do-you-correctly-align-array-memory-when-using-unsafe-store-to-write-a-struct-array-to-a-c-or-fortran-program/93868)

<div class="topic-metadata">

**Author:** [@dmmpie](https://discourse.julialang.org/u/dmmpie)\
**Replies:** 4\
**Last updated:** [February 2, 2023, 12:19am UTC](https://discourse.julialang.org/t/how-do-you-correctly-align-array-memory-when-using-unsafe-store-to-write-a-struct-array-to-a-c-or-fortran-program/93868 "2023-02-02T00:19:17Z")

</div>

I have a julia program, which opens a fortran shared object library, writes to a global type(struct) array and then calls a function, which accesses this variable. The problem is that the values entered in the julia str…

---

## [Space between subplots](https://discourse.julialang.org/t/space-between-subplots/93897)

<div class="topic-metadata">

**Author:** [@maxee](https://discourse.julialang.org/u/maxee)\
**Replies:** 1\
**Last updated:** [February 1, 2023, 11:54pm UTC](https://discourse.julialang.org/t/space-between-subplots/93897 "2023-02-01T23:54:38Z")

</div>

I can not get rid of the horizontal space between two subplots. The desired outcome is that the y-axis of the second plot is next to the far-right border of the first plot. Using margin=0mm does make the two plots close…

---

## [Is it correct as I defined my delays?](https://discourse.julialang.org/t/is-it-correct-as-i-defined-my-delays/90889)

<div class="topic-metadata">

**Author:** [@renesw](https://discourse.julialang.org/u/renesw)\
**Replies:** 2\
**Last updated:** [February 1, 2023, 10:33pm UTC](https://discourse.julialang.org/t/is-it-correct-as-i-defined-my-delays/90889 "2023-02-01T22:33:06Z")

</div>

I have been getting into Julia for a while now, however, sometimes I am left with some doubts. This time I am not 100% sure if this is the way to declare and use two different delays with DDE. I have a Metzler system wh…

---

## [Failing to precompile Plots due to LoadError (Mac edition)](https://discourse.julialang.org/t/failing-to-precompile-plots-due-to-loaderror-mac-edition/87911)

<div class="topic-metadata">

**Author:** [@jeffzwe](https://discourse.julialang.org/u/jeffzwe)\
**Replies:** 19\
**Last updated:** [February 1, 2023, 10:01pm UTC](https://discourse.julialang.org/t/failing-to-precompile-plots-due-to-loaderror-mac-edition/87911 "2023-02-01T22:01:17Z")

</div>

Hi! I’m trying to set up julia on my older Intel Macbook running macOS High Sierra (10.13.6). My julia version is: Julia Version 1.8.1 Commit afb6c60d69a (2022-09-06 15:09 UTC) Platform Info: OS: macOS (x86\_64-apple-…

---

## [Is there a function to clip an array to a maximum value? e.g. set values in an arr](https://discourse.julialang.org/t/is-there-a-function-to-clip-an-array-to-a-maximum-value-e-g-set-values-in-an-arr/56412)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 8\
**Last updated:** [February 1, 2023, 5:59pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-clip-an-array-to-a-maximum-value-e-g-set-values-in-an-arr/56412 "2023-02-01T17:59:38Z")

</div>

Is there a function to clip an array to a maximum value? e.g. set values in an array greater than 1.0 to 1.0 Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the a…

---

## [How can I make a HTTP Server in Julia?](https://discourse.julialang.org/t/how-can-i-make-a-http-server-in-julia/93883)

<div class="topic-metadata">

**Author:** [@Hugoonreplit](https://discourse.julialang.org/u/Hugoonreplit)\
**Replies:** 2\
**Last updated:** [February 1, 2023, 7:48pm UTC](https://discourse.julialang.org/t/how-can-i-make-a-http-server-in-julia/93883 "2023-02-01T19:48:16Z")

</div>

Hey people, It’s Hugoonreplit. I just started learning Julia, and now, I love it! But, I’m trying to do a project that requires an HTTP Server, I’ve seen some other HTTP Servers in Julia, but could anyone suggest a piec…

---

## [General use of GLMakie and Interact in Voilà](https://discourse.julialang.org/t/general-use-of-glmakie-and-interact-in-voila/93667)

<div class="topic-metadata">

**Author:** [@mmj](https://discourse.julialang.org/u/mmj)\
**Replies:** 5\
**Last updated:** [February 1, 2023, 7:25pm UTC](https://discourse.julialang.org/t/general-use-of-glmakie-and-interact-in-voila/93667 "2023-02-01T19:25:19Z")

</div>

Hello. I have many questions. Please be patient and forgive my ignorance, this is the first time I dive deep into Julia. I am attempting to use GLMakie to make interactive plots in a Jupyter Notebook. However, I have ha…

---

## [Can not run simple example with LIBSVM](https://discourse.julialang.org/t/can-not-run-simple-example-with-libsvm/93875)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 4\
**Last updated:** [February 1, 2023, 7:24pm UTC](https://discourse.julialang.org/t/can-not-run-simple-example-with-libsvm/93875 "2023-02-01T19:24:53Z")

</div>

I am trying to run this code: using LIBSVM x = randn(20, 2) labels = repeat(\[-1,1\], 10) model = svmtrain(x', labels) I tried to run it in JupyterLab, VSCode and REPL but it gives me a definitive error (the kernel di…

---

## [Batched Matrix solve in CUDA.jl](https://discourse.julialang.org/t/batched-matrix-solve-in-cuda-jl/52855)

<div class="topic-metadata">

**Author:** [@jpdoane](https://discourse.julialang.org/u/jpdoane)\
**Replies:** 3\
**Last updated:** [February 1, 2023, 7:00pm UTC](https://discourse.julialang.org/t/batched-matrix-solve-in-cuda-jl/52855 "2023-02-01T19:00:38Z")

</div>

Is there a way to perform batched matrix inversion/ldiv in CUDA.jl, ie: Yi = Ri \\ Xi where Ri is NxN, and Yi and Xi are NxM, with N and M small (~12). I need to solve a large number of these systems, e.g. 1 \< i \< 50k.…

---

## [The VS Code plot navigator and Makie](https://discourse.julialang.org/t/the-vs-code-plot-navigator-and-makie/67967)

<div class="topic-metadata">

**Author:** [@garrek](https://discourse.julialang.org/u/garrek)\
**Replies:** 13\
**Last updated:** [February 1, 2023, 7:00pm UTC](https://discourse.julialang.org/t/the-vs-code-plot-navigator-and-makie/67967 "2023-02-01T19:00:08Z")

</div>

I want to clarify something that confused me when using CairoMakie and GLMakie in Visual Studio Code. I couldn’t find an explanation in the Makie documentation, so I’ll make a topic here to help anyone else who runs into…

---

## [FemtoCleaner in 1.x (or even 0.6)](https://discourse.julialang.org/t/femtocleaner-in-1-x-or-even-0-6/93882)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 0\
**Last updated:** [February 1, 2023, 5:33pm UTC](https://discourse.julialang.org/t/femtocleaner-in-1-x-or-even-0-6/93882 "2023-02-01T17:33:23Z")

</div>

FemtoCleaner.jl isn’t registered, nor would install, so I tried to install it in Julia 0.6 that it’s made for. I wanted to migrate some Julia 0.6 code, and believe it’s for that (the only such tool?): julia\> Pkg.add("ht…

---

## ['BoundsError' on ODEProblem accelerated with ModelingToolkit.jl](https://discourse.julialang.org/t/boundserror-on-odeproblem-accelerated-with-modelingtoolkit-jl/86287)

<div class="topic-metadata">

**Author:** [@luismunozheinen](https://discourse.julialang.org/u/luismunozheinen)\
**Replies:** 16\
**Last updated:** [February 1, 2023, 5:37pm UTC](https://discourse.julialang.org/t/boundserror-on-odeproblem-accelerated-with-modelingtoolkit-jl/86287 "2023-02-01T17:37:36Z")

</div>

Hi, I have tried to update my ODE problem to run on the lastest versions of OrdinaryDiffEq and ModelingToolkit, however I now encounter a ‘ERROR: BoundsError’ within OrdinaryDiffEq… I have included a reduced version of…

---

## [Why doesn't empty call similar?](https://discourse.julialang.org/t/why-doesnt-empty-call-similar/93871)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [February 1, 2023, 4:29pm UTC](https://discourse.julialang.org/t/why-doesnt-empty-call-similar/93871 "2023-02-01T16:29:47Z")

</div>

The docstring for empty states that empty(v::AbstractVector, \[eltype\]) Create an empty vector similar to v, optionally changing the eltype. The method, though, is defined as empty(a::AbstractVector{T}, ::Type{U}…

---

## [Why are duplicate entries in sparse matrices allowed?](https://discourse.julialang.org/t/why-are-duplicate-entries-in-sparse-matrices-allowed/2159)

<div class="topic-metadata">

**Author:** [@mirestrepo](https://discourse.julialang.org/u/mirestrepo)\
**Replies:** 7\
**Last updated:** [February 1, 2023, 4:26pm UTC](https://discourse.julialang.org/t/why-are-duplicate-entries-in-sparse-matrices-allowed/2159 "2023-02-01T16:26:12Z")

</div>

Why does the representation of sparse matrices allow for duplicates? a = spzeros(2, 3) a\[\[1,1\],2\]=1 a\[\[1\],2\]=2 Leads to 2×3 sparse matrix with 2 Float64 nonzero entries: \[1, 2\] = 2.0 \[1, 2\] = 1.0 This behavior …

---

## [How to print rotating ◓-\>tick as progress bar in terminal?](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099)

<div class="topic-metadata">

**Author:** [@yingqiuz](https://discourse.julialang.org/u/yingqiuz)\
**Replies:** 7\
**Last updated:** [February 1, 2023, 3:27pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099 "2023-02-01T15:27:21Z")

</div>

Hi all I’m looking into progress bar options for Julia. Many packages, during installation, show a rotating ◓ becoming a tick when finished. Anyone can help how to print out this dynamic symbol? Thanks a lot!

---

## [Find position of Array elements in another Array](https://discourse.julialang.org/t/find-position-of-array-elements-in-another-array/39977)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 16\
**Last updated:** [February 1, 2023, 2:59pm UTC](https://discourse.julialang.org/t/find-position-of-array-elements-in-another-array/39977 "2023-02-01T14:59:16Z")

</div>

Suppose I have the Array a=\[0.5, 0.6, 0.5, 0.4, 0.5, 0.6\] and a reference Array b=\[0.4, 0.5, 0.6\]. I want to to find the position in b of each element of a. I want then to obtain the output \[2, 3, 2, 1, 2, 3\]. I tried …

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

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