# Latest

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

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

**Page:** 975

---

## [Sorting in vscode workspace view](https://discourse.julialang.org/t/sorting-in-vscode-workspace-view/84624)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 0\
**Last updated:** [July 22, 2022, 6:30am UTC](https://discourse.julialang.org/t/sorting-in-vscode-workspace-view/84624 "2022-07-22T06:30:09Z")

</div>

Dear All, is there any way how to sort the workspace in julia view (in vscode julia extension)? Normally there is mix of variables, modules, etc. I would like to have variables and modules in separated subsections.

---

## [Julia 1.7.3 returns incorrect result in compiled mode, not in interpreted mode](https://discourse.julialang.org/t/julia-1-7-3-returns-incorrect-result-in-compiled-mode-not-in-interpreted-mode/84572)

<div class="topic-metadata">

**Author:** [@dleather](https://discourse.julialang.org/u/dleather)\
**Replies:** 2\
**Last updated:** [July 22, 2022, 4:39am UTC](https://discourse.julialang.org/t/julia-1-7-3-returns-incorrect-result-in-compiled-mode-not-in-interpreted-mode/84572 "2022-07-22T04:39:55Z")

</div>

I’ve written up a numeric function that computes the log-likelihood of a discrete-time hidden Markov model, which involves Gauss quadrature and an optimization step. The function using Julia 1.6.2 gives the same exact re…

---

## [Seeking assistance to INSERT data into Postgres DB using LibPQ.jl](https://discourse.julialang.org/t/seeking-assistance-to-insert-data-into-postgres-db-using-libpq-jl/84510)

<div class="topic-metadata">

**Author:** [@adenoz](https://discourse.julialang.org/u/adenoz)\
**Replies:** 5\
**Last updated:** [July 22, 2022, 4:26am UTC](https://discourse.julialang.org/t/seeking-assistance-to-insert-data-into-postgres-db-using-libpq-jl/84510 "2022-07-22T04:26:22Z")

</div>

Hi, Firstly, I am still learning Julia and my recent attempts to expand into Julia is through testing how to write data into a PostgreSQL database. I have been able to successfully connect to and query data in a PG data…

---

## [Binary Caching and Pre-compilation .. again](https://discourse.julialang.org/t/binary-caching-and-pre-compilation-again/19589)

<div class="topic-metadata">

**Author:** [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Replies:** 7\
**Last updated:** [July 22, 2022, 3:31am UTC](https://discourse.julialang.org/t/binary-caching-and-pre-compilation-again/19589 "2022-07-22T03:31:35Z")

</div>

I want to present here again and perhaps more clearly, the concept of context dispatch , or more precisely resolving multiple dispatch based on some context. I believe this can contribute to precompilation and load time…

---

## [Nexus/Sonatype Support for Julia Package Manager](https://discourse.julialang.org/t/nexus-sonatype-support-for-julia-package-manager/84616)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 0\
**Last updated:** [July 22, 2022, 1:46am UTC](https://discourse.julialang.org/t/nexus-sonatype-support-for-julia-package-manager/84616 "2022-07-22T01:46:45Z")

</div>

Our corporation uses Nexus/Sonatype for some of its open source repository management. Those of us trying to drag Julia into our mainstream processes fight the Free-Open-Source-Software battle which is a nightmare with …

---

## [Allocation help - preforming computations over loops](https://discourse.julialang.org/t/allocation-help-preforming-computations-over-loops/84607)

<div class="topic-metadata">

**Author:** [@cosmia](https://discourse.julialang.org/u/cosmia)\
**Replies:** 7\
**Last updated:** [July 21, 2022, 10:33pm UTC](https://discourse.julialang.org/t/allocation-help-preforming-computations-over-loops/84607 "2022-07-21T22:33:19Z")

</div>

I am trying to optimize my code and I’ve tried to follow all performance tips in the manual and browsing the forum. I’ve avoided slicing arrays with @views, made sure to pre-allocate arrays, etc. However, I don’t really …

---

## [Is there a matrix/array equivalent of \[a,b,c\]?](https://discourse.julialang.org/t/is-there-a-matrix-array-equivalent-of-a-b-c/84597)

<div class="topic-metadata">

**Author:** [@JonasWickman](https://discourse.julialang.org/u/JonasWickman)\
**Replies:** 7\
**Last updated:** [July 21, 2022, 9:31pm UTC](https://discourse.julialang.org/t/is-there-a-matrix-array-equivalent-of-a-b-c/84597 "2022-07-21T21:31:57Z")

</div>

I often find myself in a situation where it is convenient to create matrices or arrays with various objects in them. For vectors, the syntax \[a,b,c\] will create a vector that holds variables a, b, and c, no matter what t…

---

## [Generating a sysimage from running julia system](https://discourse.julialang.org/t/generating-a-sysimage-from-running-julia-system/84464)

<div class="topic-metadata">

**Author:** [@aleReimondo](https://discourse.julialang.org/u/aleReimondo)\
**Replies:** 6\
**Last updated:** [July 21, 2022, 8:57pm UTC](https://discourse.julialang.org/t/generating-a-sysimage-from-running-julia-system/84464 "2022-07-21T20:57:01Z")

</div>

My system is running, some of the functions has run many times (are actually optimized), there are functions that has been added/overwritten by humman interaction during runtime. I want to generate a sysimage with all f…

---

## [ReinforcementLearning.jl weird behavior on custom environment, reset! is in Schrödingers namespace](https://discourse.julialang.org/t/reinforcementlearning-jl-weird-behavior-on-custom-environment-reset-is-in-schrodingers-namespace/84605)

<div class="topic-metadata">

**Author:** [@bileamScheuvens](https://discourse.julialang.org/u/bileamScheuvens)\
**Replies:** 0\
**Last updated:** [July 21, 2022, 8:43pm UTC](https://discourse.julialang.org/t/reinforcementlearning-jl-weird-behavior-on-custom-environment-reset-is-in-schrodingers-namespace/84605 "2022-07-21T20:43:19Z")

</div>

After implementing the RLBase.reset! method for my environment im being told the method doesn’t exist. When checking in help mode, Julia asks whether i meant ‘reset!’ instead of ‘reset!’. Does anyone have a clue where …

---

## [Pass information between optimization iteration](https://discourse.julialang.org/t/pass-information-between-optimization-iteration/84598)

<div class="topic-metadata">

**Author:** [@emurrayl](https://discourse.julialang.org/u/emurrayl)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 7:06pm UTC](https://discourse.julialang.org/t/pass-information-between-optimization-iteration/84598 "2022-07-21T19:06:32Z")

</div>

Hi everyone, I am trying to optimize a likelihood function. However, for each guess of the parameter value, I need to solve a value function iteration (VFI) problem to compute the likelihood. To speed up the process, I …

---

## [Everything precompiling when opening new notebook](https://discourse.julialang.org/t/everything-precompiling-when-opening-new-notebook/84581)

<div class="topic-metadata">

**Author:** [@Andy2K11](https://discourse.julialang.org/u/Andy2K11)\
**Replies:** 8\
**Last updated:** [July 21, 2022, 4:52pm UTC](https://discourse.julialang.org/t/everything-precompiling-when-opening-new-notebook/84581 "2022-07-21T16:52:32Z")

</div>

Yesterday I was in the machine learning workshop and following along having successfully followed all the setup instructions. At some point we were asked to open a new notebook and it took over 11 minutes before I’d done…

---

## [Indexing (relatively) large nested list causes unintended mutation; doesn't occur after deepcopy](https://discourse.julialang.org/t/indexing-relatively-large-nested-list-causes-unintended-mutation-doesnt-occur-after-deepcopy/84582)

<div class="topic-metadata">

**Author:** [@johnabs](https://discourse.julialang.org/u/johnabs)\
**Replies:** 3\
**Last updated:** [July 21, 2022, 4:10pm UTC](https://discourse.julialang.org/t/indexing-relatively-large-nested-list-causes-unintended-mutation-doesnt-occur-after-deepcopy/84582 "2022-07-21T16:10:55Z")

</div>

I generated a large amount of data from a simulation I’m working on, and was extracting values from the final list of structs via map. It only behaves after making a deepcopy, as you’ll see. Basically: My function gener…

---

## [Sensitivity of a SDE w.r.t tspan](https://discourse.julialang.org/t/sensitivity-of-a-sde-w-r-t-tspan/83998)

<div class="topic-metadata">

**Author:** [@stochasticguy](https://discourse.julialang.org/u/stochasticguy)\
**Replies:** 3\
**Last updated:** [July 21, 2022, 3:51pm UTC](https://discourse.julialang.org/t/sensitivity-of-a-sde-w-r-t-tspan/83998 "2022-07-21T15:51:44Z")

</div>

Hi all, I’m using SciMLSensitivity.jl to get the sensitivities of the transformation defined by: f(S\_T) = exp(- r \* T) \* max(S(T) - K, 0.0), where S\_T is the solution at time T of a SDE system of the form: dS\_t = \\mu…

---

## [RandomForestRegressor in Julia](https://discourse.julialang.org/t/randomforestregressor-in-julia/84425)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 9\
**Last updated:** [July 21, 2022, 3:30pm UTC](https://discourse.julialang.org/t/randomforestregressor-in-julia/84425 "2022-07-21T15:30:53Z")

</div>

I’m trying to train a RandomForestRegressor using DecisionTree.jl and RandomizedSearchCV (contained in ScikitLearn.jl) in Julia. Primary datasets like x\_train and y\_train etc. are provided in my google drive as well, So…

---

## [Plotting different markers with legend per marker](https://discourse.julialang.org/t/plotting-different-markers-with-legend-per-marker/40989)

<div class="topic-metadata">

**Author:** [@stej](https://discourse.julialang.org/u/stej)\
**Replies:** 6\
**Last updated:** [July 21, 2022, 2:57pm UTC](https://discourse.julialang.org/t/plotting-different-markers-with-legend-per-marker/40989 "2022-07-21T14:57:53Z")

</div>

Hi all, my MWE is this one using Plots rows = Matrix(\[ "s" "tokyo" 8918018 "s" "delhi" 2605537 "b" "shanghai" 705818 "a" "sao paulo" 580568 "a" "mexico…

---

## [Braindancer project is looking for Julia programmer/s - remote work](https://discourse.julialang.org/t/braindancer-project-is-looking-for-julia-programmer-s-remote-work/84591)

<div class="topic-metadata">

**Author:** [@hstrey](https://discourse.julialang.org/u/hstrey)\
**Replies:** 1\
**Last updated:** [July 21, 2022, 2:11pm UTC](https://discourse.julialang.org/t/braindancer-project-is-looking-for-julia-programmer-s-remote-work/84591 "2022-07-21T14:11:19Z")

</div>

We are looking for a Julia programmer who can port our Braindancer (BrainDancer® - fMRI Dynamic Phantom - ALA Scientific) analysis software (GitHub - RajatKGupta/fMRI\_BrainDancer: This repository provides code for dynami…

---

## [Using a \`new\` constructor with Parameters.jl \`@with\_kw\`](https://discourse.julialang.org/t/using-a-new-constructor-with-parameters-jl-with-kw/84588)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 3\
**Last updated:** [July 21, 2022, 1:41pm UTC](https://discourse.julialang.org/t/using-a-new-constructor-with-parameters-jl-with-kw/84588 "2022-07-21T13:41:10Z")

</div>

I’d like to do something like this. using Parameters struct Cat breed colour age weight name end @with\_kw struct Pet name kind age function Pet(cat::Cat) new(name= cat.name,…

---

## [Share colormap for Plotly Stacked Heatmaps](https://discourse.julialang.org/t/share-colormap-for-plotly-stacked-heatmaps/84547)

<div class="topic-metadata">

**Author:** [@KaiserDan37](https://discourse.julialang.org/u/KaiserDan37)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 1:39pm UTC](https://discourse.julialang.org/t/share-colormap-for-plotly-stacked-heatmaps/84547 "2022-07-21T13:39:21Z")

</div>

Hello everyone, I am creating a faceted plot using the Plotly backend and and having trouble with stacking subplots of heatmaps. Specifically, the colorbars appear to overlap and I would prefer if they shared a single c…

---

## [Operators and functions](https://discourse.julialang.org/t/operators-and-functions/84502)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 7\
**Last updated:** [July 21, 2022, 12:57pm UTC](https://discourse.julialang.org/t/operators-and-functions/84502 "2022-07-21T12:57:31Z")

</div>

How come these work ==(2).(1:5) ≠(2).(1:5) \>(2).(1:5) and these don’t ? +(2).(1:5) \*(2).(1:5) ^(2).(1:5)

---

## [StaticArrays 1.5, StaticArraysCore and BSON.jl](https://discourse.julialang.org/t/staticarrays-1-5-staticarrayscore-and-bson-jl/84473)

<div class="topic-metadata">

**Author:** [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 12:46pm UTC](https://discourse.julialang.org/t/staticarrays-1-5-staticarrayscore-and-bson-jl/84473 "2022-07-21T12:46:55Z")

</div>

What is the correct way to save and load StaticArrays in package version 1.5? Basically, I used to be able to import using StaticArrays using BSON and storing/loading worked fine. Now the code above works for storing…

---

## [Constructor with Varargs](https://discourse.julialang.org/t/constructor-with-varargs/84568)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 12:09pm UTC](https://discourse.julialang.org/t/constructor-with-varargs/84568 "2022-07-21T12:09:15Z")

</div>

This works using Pipe, Parameters @with\_kw struct X A B end x = (A=1, B=2 ) X( x... ) but this fails x = (A=1, B=2, C=3 ) X( x... ) unless you manually filter x to only contain the fields of X. or manually…

---

## [Error accessing elements within constraint matrix](https://discourse.julialang.org/t/error-accessing-elements-within-constraint-matrix/84565)

<div class="topic-metadata">

**Author:** [@brett\_d](https://discourse.julialang.org/u/brett_d)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 10:55am UTC](https://discourse.julialang.org/t/error-accessing-elements-within-constraint-matrix/84565 "2022-07-21T10:55:54Z")

</div>

I am trying to write a constraint that sums the process times for each row of a matrix, Z\[a,p\] where Z is a binary decision variable = 1 if a is assigned p; = 0 otherwise. I am trying to multiply the 1’s in the row by t…

---

## [Emacs wrong indentation after \`import Base: \*\`. Here's a workaround](https://discourse.julialang.org/t/emacs-wrong-indentation-after-import-base-heres-a-workaround/84585)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 0\
**Last updated:** [July 21, 2022, 10:45am UTC](https://discourse.julialang.org/t/emacs-wrong-indentation-after-import-base-heres-a-workaround/84585 "2022-07-21T10:45:11Z")

</div>

There is a known issue with the indentation of julia-mode in Emacs, giving your code formatted like this import Base: \* a = 1 This is because Emacs believes the first line ends with a hanging operator \*, so conside…

---

## [Optimising switching algorithms based on value of struct field](https://discourse.julialang.org/t/optimising-switching-algorithms-based-on-value-of-struct-field/84404)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 19\
**Last updated:** [July 21, 2022, 9:46am UTC](https://discourse.julialang.org/t/optimising-switching-algorithms-based-on-value-of-struct-field/84404 "2022-07-21T09:46:23Z")

</div>

I’m working on a simulation in Julia, where the “centrepiece” is some struct, which can have a few boolean properties associated with it. mutable struct Sim """ data """ prop\_a::Bool prop\_b::Bool ... en…

---

## [What is the difference between map(f, v) and \[f(x) for x in v\]?](https://discourse.julialang.org/t/what-is-the-difference-between-map-f-v-and-f-x-for-x-in-v/84580)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 7:59am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-map-f-v-and-f-x-for-x-in-v/84580 "2022-07-21T07:59:25Z")

</div>

Hi, Take a look at the following code: using BenchmarkTools s = \["$n" for n in 1:10000\]; @btime map(x-\>parse(Int, x), s); # 174.666 μs (3 allocations: 78.19 KiB) @btime \[x-\>parse(Int, x) for x in s\]; # 3.401 μs (2 allo…

---

## [Calculate the number of values greater than a certain value](https://discourse.julialang.org/t/calculate-the-number-of-values-greater-than-a-certain-value/84578)

<div class="topic-metadata">

**Author:** [@chenr86](https://discourse.julialang.org/u/chenr86)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 7:57am UTC](https://discourse.julialang.org/t/calculate-the-number-of-values-greater-than-a-certain-value/84578 "2022-07-21T07:57:36Z")

</div>

Hello, I’m solving a MINLP problem. In my case, there is an objective function max(sum(time60\[time\_slice\])) indicating the number of time slices in which the expression Q\[time\_slice\] is greater than 60. That is to say: …

---

## [Performance of PencilFFTs with CuArray](https://discourse.julialang.org/t/performance-of-pencilffts-with-cuarray/84569)

<div class="topic-metadata">

**Author:** [@Lightup1](https://discourse.julialang.org/u/Lightup1)\
**Replies:** 1\
**Last updated:** [July 21, 2022, 6:49am UTC](https://discourse.julialang.org/t/performance-of-pencilffts-with-cuarray/84569 "2022-07-21T06:49:54Z")

</div>

Performance issue on PencilFFTs with CuArray CuArray Performance · Issue #56 · jipolanco/PencilFFTs.jl (github.com) Post here to find more tests. Code example: CUFFT: using CUDA using FFTW using BenchmarkTools prin…

---

## [Is there an interface to concatenate Dicts(or Set, OrderedDict etc.)?](https://discourse.julialang.org/t/is-there-an-interface-to-concatenate-dicts-or-set-ordereddict-etc/84577)

<div class="topic-metadata">

**Author:** [@acsofie](https://discourse.julialang.org/u/acsofie)\
**Replies:** 4\
**Last updated:** [July 21, 2022, 6:22am UTC](https://discourse.julialang.org/t/is-there-an-interface-to-concatenate-dicts-or-set-ordereddict-etc/84577 "2022-07-21T06:22:14Z")

</div>

A Vector usually been concatenated by append! or vcat. But there don’t work on Dict(or Set, OrderedDict etc.). Of cause we can use for-loop to add each element into a new dict. I want to know is there an interface like…

---

## [Julia 1.8: How do I upgrade packages with new versions available?](https://discourse.julialang.org/t/julia-1-8-how-do-i-upgrade-packages-with-new-versions-available/84573)

<div class="topic-metadata">

**Author:** [@islent](https://discourse.julialang.org/u/islent)\
**Replies:** 1\
**Last updated:** [July 21, 2022, 4:41am UTC](https://discourse.julialang.org/t/julia-1-8-how-do-i-upgrade-packages-with-new-versions-available/84573 "2022-07-21T04:41:07Z")

</div>

Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ cannot be upgraded. To see why use \`status --outdated\` ⌃ \[13f3f980\] CairoMakie v0.7.5 (\<v0.8.10) (@v1.8) pkg\> up CairoMakie Updating r…

---

## [Can the result of @time measure the spatial complexity of the algorithm?](https://discourse.julialang.org/t/can-the-result-of-time-measure-the-spatial-complexity-of-the-algorithm/84509)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 10\
**Last updated:** [July 21, 2022, 3:16am UTC](https://discourse.julialang.org/t/can-the-result-of-time-measure-the-spatial-complexity-of-the-algorithm/84509 "2022-07-21T03:16:24Z")

</div>

julia\> function myfunc(n::Int64) D=20 a=rand(D,D) for i in 1:n a\*a end end myfunc (generic function with 1 method) julia\> @time myfunc(100) 0.000193 se…

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

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