# Latest

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

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

**Page:** 1083

---

## [Size-limited vector type](https://discourse.julialang.org/t/size-limited-vector-type/78697)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [March 30, 2022, 5:39am UTC](https://discourse.julialang.org/t/size-limited-vector-type/78697 "2022-03-30T05:39:13Z")

</div>

I want to make a Dict whose keys are view(MVector{5,UInt8}, 1:m) for some m\<=5 and , such as julia\> let d = Dict{MVector{5,UInt8}, Int}() d\[@view((@MVector \[1,2,3,4,5\])\[1:2\])\] = 1 end ERROR: Dimens…

---

## [Get NamedTuple element with String key. Why is this slow?](https://discourse.julialang.org/t/get-namedtuple-element-with-string-key-why-is-this-slow/78704)

<div class="topic-metadata">

**Author:** [@jocklawrie](https://discourse.julialang.org/u/jocklawrie)\
**Replies:** 3\
**Last updated:** [March 30, 2022, 5:26am UTC](https://discourse.julialang.org/t/get-namedtuple-element-with-string-key-why-is-this-slow/78704 "2022-03-30T05:26:47Z")

</div>

Hi there, I’m attempting to get a value from a NamedTuple using a String key, ideally using x\[k\] syntax. In the example below, why is x\["a"\] so slow compared to x\[Symbol("a")\]? using BenchmarkTools import Base: getinde…

---

## [Named Jacobian](https://discourse.julialang.org/t/named-jacobian/73572)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 3\
**Last updated:** [March 30, 2022, 3:34am UTC](https://discourse.julialang.org/t/named-jacobian/73572 "2022-03-30T03:34:42Z")

</div>

For a function that maps a named tuple to another named tuple, is it possible to get a named Jacobian? Either as a named range or a DataFrame with 3 columns: Input\_Var, Output\_Var, Derivative I could take the …

---

## [Symbolic derivation of complex valued functions with Symbolics.jl](https://discourse.julialang.org/t/symbolic-derivation-of-complex-valued-functions-with-symbolics-jl/78230)

<div class="topic-metadata">

**Author:** [@Vahid\_Hosseinzadeh](https://discourse.julialang.org/u/Vahid_Hosseinzadeh)\
**Replies:** 12\
**Last updated:** [March 30, 2022, 2:19am UTC](https://discourse.julialang.org/t/symbolic-derivation-of-complex-valued-functions-with-symbolics-jl/78230 "2022-03-30T02:19:57Z")

</div>

when there is im (the imaginery number i) in the function I get zero for the derivative which is obviously wrong. We can replace im with a symbol like I and then differentiate, but I was wondering maybe there is a bette…

---

## [Why I am not getting anything in REPL while trying to use Nsight Systems for profiling?](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 12\
**Last updated:** [March 30, 2022, 2:17am UTC](https://discourse.julialang.org/t/why-i-am-not-getting-anything-in-repl-while-trying-to-use-nsight-systems-for-profiling/50667 "2022-03-30T02:17:11Z")

</div>

Hi, I am trying to profile cuda program using Nsight systems. I tried the following command in command window to launch the julia REPL. nsys launch "C:\\Users\\manoos\\AppData\\Local\\Programs\\Julia 1.5.0\\bin\\julia.exe" RE…

---

## [@distributed retry](https://discourse.julialang.org/t/distributed-retry/78703)

<div class="topic-metadata">

**Author:** [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Replies:** 3\
**Last updated:** [March 29, 2022, 10:28pm UTC](https://discourse.julialang.org/t/distributed-retry/78703 "2022-03-29T22:28:25Z")

</div>

I have code that looks roughly like this: using Distributed @everywhere using MyModule @sync @distributed for x in xs my\_function!(x) end Which I launch using julia -p 4 --threads=auto myscript.jl. my\_function writ…

---

## [Question on jl\_alloc\_array\_2d seg fault](https://discourse.julialang.org/t/question-on-jl-alloc-array-2d-seg-fault/78698)

<div class="topic-metadata">

**Author:** [@sdeoras](https://discourse.julialang.org/u/sdeoras)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 9:07pm UTC](https://discourse.julialang.org/t/question-on-jl-alloc-array-2d-seg-fault/78698 "2022-03-29T21:07:35Z")

</div>

Hi, I am interested in building a Go interface to Julia (for simple data passing and function evals) and having issues with jl\_alloc\_array\_2d. In particular, repeated use of this function seems to intermittently lead to …

---

## [Random123 reproducible independent and multithreaded](https://discourse.julialang.org/t/random123-reproducible-independent-and-multithreaded/78699)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 0\
**Last updated:** [March 29, 2022, 8:13pm UTC](https://discourse.julialang.org/t/random123-reproducible-independent-and-multithreaded/78699 "2022-03-29T20:13:57Z")

</div>

I wish to generate random numbers with multithreading that are independent, both within and across threads, and are reproducible in the sense that every time I run my code I get the same results. My intention is to use …

---

## [Compiling with package environments?](https://discourse.julialang.org/t/compiling-with-package-environments/78693)

<div class="topic-metadata">

**Author:** [@SubTer](https://discourse.julialang.org/u/SubTer)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 7:47pm UTC](https://discourse.julialang.org/t/compiling-with-package-environments/78693 "2022-03-29T19:47:40Z")

</div>

hi all, after digging around with documentation, I still don’t quite understand how Julia handles project/environments. So to describe what I am trying to do - I’ve created a new folder to house julia files related to …

---

## [Reading xpress problem from .lp file into Julia](https://discourse.julialang.org/t/reading-xpress-problem-from-lp-file-into-julia/78664)

<div class="topic-metadata">

**Author:** [@Marie](https://discourse.julialang.org/u/Marie)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 7:07pm UTC](https://discourse.julialang.org/t/reading-xpress-problem-from-lp-file-into-julia/78664 "2022-03-29T19:07:26Z")

</div>

I’m reading a problem from .lp into Julia. I’ve tried various xpress.optimizer params - the problem is infeasible. The reason is b/c the model isn’t read exactly as it’s defined in the .lp file - some constraints get mod…

---

## [In-place map of vector functions across slices of multidimensional arrays](https://discourse.julialang.org/t/in-place-map-of-vector-functions-across-slices-of-multidimensional-arrays/78684)

<div class="topic-metadata">

**Author:** [@tianrluo](https://discourse.julialang.org/u/tianrluo)\
**Replies:** 8\
**Last updated:** [March 29, 2022, 5:59pm UTC](https://discourse.julialang.org/t/in-place-map-of-vector-functions-across-slices-of-multidimensional-arrays/78684 "2022-03-29T17:59:37Z")

</div>

Hi, I am trying to in-place map some vector functions across slices of multidimensional arrays For instance, given three matrices: A, B, C = rand(4, 3), rand(4, 3), rand(4, 3) I wish to efficiently compute the cross …

---

## [Replacing \*missing\* and \*NaN\* values in dataframe](https://discourse.julialang.org/t/replacing-missing-and-nan-values-in-dataframe/78687)

<div class="topic-metadata">

**Author:** [@janilin](https://discourse.julialang.org/u/janilin)\
**Replies:** 6\
**Last updated:** [March 29, 2022, 5:09pm UTC](https://discourse.julialang.org/t/replacing-missing-and-nan-values-in-dataframe/78687 "2022-03-29T17:09:07Z")

</div>

Hi! I was trying trying to change all missing and NaN values into 0. Firstly, created a dataframe using DataFrames df\_i = DataFrame( id =\[101, 102, 103, 104, 105\], name = \["A", "B", "C", NaN, "E"\], age = \[28, 3…

---

## [Macro, loops and variables](https://discourse.julialang.org/t/macro-loops-and-variables/78669)

<div class="topic-metadata">

**Author:** [@FedeClaudi](https://discourse.julialang.org/u/FedeClaudi)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 4:49pm UTC](https://discourse.julialang.org/t/macro-loops-and-variables/78669 "2022-03-29T16:49:17Z")

</div>

Hi everyone, I have a macro question. It’s probably something about variables hygene as mentioned in this other topic, but I can’t quite figure out, any help would be appreciated I’m trying to do a macro that wraps aro…

---

## [\[ANN\] eigshow.jl, a demonstrator for EVD/SVD intuition](https://discourse.julialang.org/t/ann-eigshow-jl-a-demonstrator-for-evd-svd-intuition/70340)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 9\
**Last updated:** [March 29, 2022, 3:26pm UTC](https://discourse.julialang.org/t/ann-eigshow-jl-a-demonstrator-for-evd-svd-intuition/70340 "2022-03-29T15:26:52Z")

</div>

A long-time favorite linear algebra teaching widget of mine is matlab’s EIGSHOW, which lets you demonstrate the geometric intuition behind the EVD and the SVD in two dimensions. It was pulled from core matlab quite a whi…

---

## [\`break\` with a threaded loop?](https://discourse.julialang.org/t/break-with-a-threaded-loop/78487)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 11\
**Last updated:** [March 29, 2022, 3:09pm UTC](https://discourse.julialang.org/t/break-with-a-threaded-loop/78487 "2022-03-29T15:09:00Z")

</div>

Is there any simple way to break from a threaded for loop (actually I want an infinite while loop, but that doesn’t work with @threads)? Or would I need to use something like channels for synchronization? Trivial examp…

---

## [Combining ODE and SDE](https://discourse.julialang.org/t/combining-ode-and-sde/78674)

<div class="topic-metadata">

**Author:** [@Pitaevskii](https://discourse.julialang.org/u/Pitaevskii)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 3:06pm UTC](https://discourse.julialang.org/t/combining-ode-and-sde/78674 "2022-03-29T15:06:30Z")

</div>

Hi everyone, I’m working on a problem where I have a large set of differential equations. Noise is added to the system in two ways, by sampling the initial condition for many simulations and by explicitly adding noise i…

---

## [Understanding how nested defaultdict works](https://discourse.julialang.org/t/understanding-how-nested-defaultdict-works/78679)

<div class="topic-metadata">

**Author:** [@spragud2](https://discourse.julialang.org/u/spragud2)\
**Replies:** 1\
**Last updated:** [March 29, 2022, 3:04pm UTC](https://discourse.julialang.org/t/understanding-how-nested-defaultdict-works/78679 "2022-03-29T15:04:39Z")

</div>

Hi, I wrote some code to recursively create nested defaultdicts to mimic a tree structure. Normally one would have to write something like function tree() return DefaultDict(tree) end x = tree() x\[1\]\[2\]\[3\] To cr…

---

## [Column types in DataFrames vs. InMemoryDatasets](https://discourse.julialang.org/t/column-types-in-dataframes-vs-inmemorydatasets/78682)

<div class="topic-metadata">

**Author:** [@monopolynomial](https://discourse.julialang.org/u/monopolynomial)\
**Replies:** 6\
**Last updated:** [March 29, 2022, 2:55pm UTC](https://discourse.julialang.org/t/column-types-in-dataframes-vs-inmemorydatasets/78682 "2022-03-29T14:55:23Z")

</div>

it’s very interesting, because it seems the following point is more about DataFrames.jl after all. because using InMemoryDatasets using NamedArrays initial = NamedArray(\[5748.61\], \["AUT-A01"\]) df\_initial = Dataset(:…

---

## [Random numbers and threads](https://discourse.julialang.org/t/random-numbers-and-threads/77364)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 30\
**Last updated:** [March 29, 2022, 2:31pm UTC](https://discourse.julialang.org/t/random-numbers-and-threads/77364 "2022-03-29T14:31:53Z")

</div>

How to use random numbers in conjunction with threads? In the past I used the following pattern: using Random function simulation(rngs) Threads.@threads for i in 1:1000000 rng = rngs\[Threads.threadid()\] …

---

## [JuMP Model Syntax](https://discourse.julialang.org/t/jump-model-syntax/78668)

<div class="topic-metadata">

**Author:** [@iAnkiit](https://discourse.julialang.org/u/iAnkiit)\
**Replies:** 1\
**Last updated:** [March 29, 2022, 1:50pm UTC](https://discourse.julialang.org/t/jump-model-syntax/78668 "2022-03-29T13:50:03Z")

</div>

Do we need to write expression with jump macros only ? like @variable, @constraint, @Objective Or we can write it as plain text like model = ax+by^2 If yes, can we write in combination Example : model = Model(Optimize…

---

## [Poisson Equation example of NeuralPDE.jl throws hash error](https://discourse.julialang.org/t/poisson-equation-example-of-neuralpde-jl-throws-hash-error/78071)

<div class="topic-metadata">

**Author:** [@FrootLoops](https://discourse.julialang.org/u/FrootLoops)\
**Replies:** 17\
**Last updated:** [March 29, 2022, 1:24pm UTC](https://discourse.julialang.org/t/poisson-equation-example-of-neuralpde-jl-throws-hash-error/78071 "2022-03-29T13:24:21Z")

</div>

I am new to the PINN topic and therefore I just wanted to study through the tutorial of NeuralPDE.jl. I tried several examples from the tutorial. Sadly none of it works and I get the same error for each example. I am us…

---

## [Tutor for Julia](https://discourse.julialang.org/t/tutor-for-julia/78610)

<div class="topic-metadata">

**Author:** [@iAnkiit](https://discourse.julialang.org/u/iAnkiit)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 1:22pm UTC](https://discourse.julialang.org/t/tutor-for-julia/78610 "2022-03-29T13:22:14Z")

</div>

I am learning Julia for my masters project work. There is a model written in Julia which I am referring. Though, I have cleared my basics in Julia, there is alot in JuMP , which I am unable to decode. I was thinking, if…

---

## [Replicating a Julia example](https://discourse.julialang.org/t/replicating-a-julia-example/78646)

<div class="topic-metadata">

**Author:** [@djturizo](https://discourse.julialang.org/u/djturizo)\
**Replies:** 2\
**Last updated:** [March 29, 2022, 1:18pm UTC](https://discourse.julialang.org/t/replicating-a-julia-example/78646 "2022-03-29T13:18:29Z")

</div>

I am trying to learn Julia and I read this article about the quick success of Julia. In the last page of the article the author works a small example showing the benefits of multiple dispatch. They define a custom class S…

---

## [JLD2 Error: "type DataType has no field mutable"](https://discourse.julialang.org/t/jld2-error-type-datatype-has-no-field-mutable/78651)

<div class="topic-metadata">

**Author:** [@poopsilon](https://discourse.julialang.org/u/poopsilon)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 12:56pm UTC](https://discourse.julialang.org/t/jld2-error-type-datatype-has-no-field-mutable/78651 "2022-03-29T12:56:29Z")

</div>

I’d like to save variables for later. To do this, I installed the JLD2 package. But when I try to save, I get the following error: Error Detailsjulia\> using JLD2 julia\> hello = "world" "world"…

---

## [Empirical density contours from an MCMC sample](https://discourse.julialang.org/t/empirical-density-contours-from-an-mcmc-sample/78629)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 2\
**Last updated:** [March 29, 2022, 11:52am UTC](https://discourse.julialang.org/t/empirical-density-contours-from-an-mcmc-sample/78629 "2022-03-29T11:52:42Z")

</div>

I have a recollection of seeing two-dimensional empirical density contours from an MCMC (Markov-chain Monte Carlo) sample but I didn’t record the information on the package. Was I remembering correctly and, if so, could…

---

## [Opening a file in VS Code](https://discourse.julialang.org/t/opening-a-file-in-vs-code/78642)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 3\
**Last updated:** [March 29, 2022, 11:09am UTC](https://discourse.julialang.org/t/opening-a-file-in-vs-code/78642 "2022-03-29T11:09:24Z")

</div>

I’ve just installed a Julia package, and now I’d like to open one of its functions to see how it works. In Matlab, if a function is anywhere in the file path, I could open it via open myfunction.m or I could specify t…

---

## [Diffusion by using CUDA.jl, DifferentialEquations and DiffEqGPU](https://discourse.julialang.org/t/diffusion-by-using-cuda-jl-differentialequations-and-diffeqgpu/78310)

<div class="topic-metadata">

**Author:** [@eslam\_abdelfatah](https://discourse.julialang.org/u/eslam_abdelfatah)\
**Replies:** 6\
**Last updated:** [March 29, 2022, 10:44am UTC](https://discourse.julialang.org/t/diffusion-by-using-cuda-jl-differentialequations-and-diffeqgpu/78310 "2022-03-29T10:44:42Z")

</div>

I want to apply a difusion for a two- dimensional plat using the DiffEqGPU package. when I used the Euler method as a for loop it worked. My code looks like this module Playground using CUDA using CairoMakie using C…

---

## [Simple IDE](https://discourse.julialang.org/t/simple-ide/78638)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 7\
**Last updated:** [March 29, 2022, 10:34am UTC](https://discourse.julialang.org/t/simple-ide/78638 "2022-03-29T10:34:54Z")

</div>

Hi, I am curently using Julia on windows. I am looking for a very simple IDE that just runs a line of code and move to the next line. That is all I need. No need for debugger, language server, real time “feedback”…etc. …

---

## [Construct Dict same as NamedTuple](https://discourse.julialang.org/t/construct-dict-same-as-namedtuple/78663)

<div class="topic-metadata">

**Author:** [@yuvalw](https://discourse.julialang.org/u/yuvalw)\
**Replies:** 1\
**Last updated:** [March 29, 2022, 9:56am UTC](https://discourse.julialang.org/t/construct-dict-same-as-namedtuple/78663 "2022-03-29T09:56:21Z")

</div>

Is there a reason that I’m currently not seeing against using this? mainly for the sake of laziness. julia\> Base.Dict(;kwargs...) = Dict(kwargs) julia\> Dict(a=1,b=2) Dict{Symbol, Int64} with 2 entries: :a =\> 1 :b =\>…

---

## [In function runs really slow](https://discourse.julialang.org/t/in-function-runs-really-slow/78661)

<div class="topic-metadata">

**Author:** [@Frankiewaang](https://discourse.julialang.org/u/Frankiewaang)\
**Replies:** 3\
**Last updated:** [March 29, 2022, 9:35am UTC](https://discourse.julialang.org/t/in-function-runs-really-slow/78661 "2022-03-29T09:35:32Z")

</div>

I got 2 DataFrames tran and articles and I want to filter those rows in tran that tran.article\_id in articles.article\_id, the function I use is: trans = transactions\[in.(transactions.article\_id, Ref(articles.article\_id…

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

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