# Latest

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

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

**Page:** 696

---

## [Working with MCMCChains?](https://discourse.julialang.org/t/working-with-mcmcchains/99014)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 9\
**Last updated:** [May 18, 2023, 6:52pm UTC](https://discourse.julialang.org/t/working-with-mcmcchains/99014 "2023-05-18T18:52:58Z")

</div>

Suppose I’ve fit a model with Turing and I have a “Chains” object. Suppose my model has a bunch of nuisance parameters, and I’m just interested in looking at several particular parameters. I want to extract a chains obje…

---

## [Runtime initializaion of parametric type in package from input](https://discourse.julialang.org/t/runtime-initializaion-of-parametric-type-in-package-from-input/99080)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 0\
**Last updated:** [May 18, 2023, 6:33pm UTC](https://discourse.julialang.org/t/runtime-initializaion-of-parametric-type-in-package-from-input/99080 "2023-05-18T18:33:37Z")

</div>

Hi, I have a package, where I want to define MyStaticVectorType type, as an alias to SVector{MEM\_SIZE,Int} (from StaticArrays.jl). Where MEM\_SIZE is loaded from environment variable when the program runs, so it’s avail…

---

## [Removing specific Type from Union](https://discourse.julialang.org/t/removing-specific-type-from-union/98943)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 13\
**Last updated:** [May 18, 2023, 6:15pm UTC](https://discourse.julialang.org/t/removing-specific-type-from-union/98943 "2023-05-18T18:15:54Z")

</div>

I am trying to find a way to remove a specific type from a Union of types. In the code below, I would like to inherit from AbtractArray{T,N} if R is Nothing but otherwise inherit from the Union{T,R}: julia\> struct MyT{T…

---

## [How to stick a colorbar to a scaled axis in Makie](https://discourse.julialang.org/t/how-to-stick-a-colorbar-to-a-scaled-axis-in-makie/70358)

<div class="topic-metadata">

**Author:** [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Replies:** 12\
**Last updated:** [May 18, 2023, 4:43pm UTC](https://discourse.julialang.org/t/how-to-stick-a-colorbar-to-a-scaled-axis-in-makie/70358 "2023-05-18T16:43:30Z")

</div>

Here is a MWE of a Makie plot with a wide figure with one square axis and a colorbar “attached” to it: f = Figure(resolution=(900,300)) Axis(f\[1, 1\], aspect = AxisAspect(1)) Box(f\[1, 1\], color = (:blue, 0.2), strokecolo…

---

## [Improving snippets highlight of forum](https://discourse.julialang.org/t/improving-snippets-highlight-of-forum/99070)

<div class="topic-metadata">

**Author:** [@math4mad](https://discourse.julialang.org/u/math4mad)\
**Replies:** 0\
**Last updated:** [May 18, 2023, 3:19pm UTC](https://discourse.julialang.org/t/improving-snippets-highlight-of-forum/99070 "2023-05-18T15:19:20Z")

</div>

For. discourse.julialang.org seems improve a little. need inject a js script if your browser are chrome or edge , you can use tampermonkey if you use Safari , you can use use Userscripts copy this snippet…

---

## [Type check conventions](https://discourse.julialang.org/t/type-check-conventions/99047)

<div class="topic-metadata">

**Author:** [@gxyau](https://discourse.julialang.org/u/gxyau)\
**Replies:** 1\
**Last updated:** [May 18, 2023, 2:37pm UTC](https://discourse.julialang.org/t/type-check-conventions/99047 "2023-05-18T14:37:12Z")

</div>

I recently just discovered how to do type check in Julia, and I was just wondering what the convention is, and what differences are the two methods. Say I have a variable vec1 of type Vector{\<:Number}. If I understand i…

---

## [Programmatically use dependency from alternate registry](https://discourse.julialang.org/t/programmatically-use-dependency-from-alternate-registry/99066)

<div class="topic-metadata">

**Author:** [@cpaniaguam](https://discourse.julialang.org/u/cpaniaguam)\
**Replies:** 0\
**Last updated:** [May 18, 2023, 2:36pm UTC](https://discourse.julialang.org/t/programmatically-use-dependency-from-alternate-registry/99066 "2023-05-18T14:36:47Z")

</div>

I am writing a package MyPkg that has some dependencies from a third party registry. If I try to naively install MyPkg I get hit with an error of the following sort: (@v1.9) pkg\> add https://github.com/myusername/MyPkg.…

---

## [Trying to understand parametric args in functions](https://discourse.julialang.org/t/trying-to-understand-parametric-args-in-functions/99052)

<div class="topic-metadata">

**Author:** [@brombo](https://discourse.julialang.org/u/brombo)\
**Replies:** 9\
**Last updated:** [May 18, 2023, 2:34pm UTC](https://discourse.julialang.org/t/trying-to-understand-parametric-args-in-functions/99052 "2023-05-18T14:34:11Z")

</div>

I have looked at the docs for parametric args in functions and cannot understand how to apply it to what I want to program. I have a function function ga(s::String,g::T) where ::T can be a ::String or a ::Array{Num} and…

---

## [Geodata Science Hands-on at JuliaEO 2023](https://discourse.julialang.org/t/geodata-science-hands-on-at-juliaeo-2023/93405)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 1\
**Last updated:** [January 23, 2023, 4:08pm UTC](https://discourse.julialang.org/t/geodata-science-hands-on-at-juliaeo-2023/93405 "2023-01-23T16:08:34Z")

</div>

Geodata Science Hands-on with GeoStats.jl at JuliaEO 2023: Starts at around 28:00.

---

## [Struct with Conv](https://discourse.julialang.org/t/struct-with-conv/99061)

<div class="topic-metadata">

**Author:** [@Helectus](https://discourse.julialang.org/u/Helectus)\
**Replies:** 1\
**Last updated:** [May 18, 2023, 2:19pm UTC](https://discourse.julialang.org/t/struct-with-conv/99061 "2023-05-18T14:19:09Z")

</div>

I tried to create a struct that has just one Conv layer. struct Conv1D2 conv1::Conv function Conv1D2(input\_len::Int, output\_len::Int) conv1 = Conv((1, 3), input\_len=\>output\_len) new(…

---

## [Help converting Jags.jl example to Turing](https://discourse.julialang.org/t/help-converting-jags-jl-example-to-turing/98718)

<div class="topic-metadata">

**Author:** [@mkaut](https://discourse.julialang.org/u/mkaut)\
**Replies:** 1\
**Last updated:** [May 18, 2023, 12:57pm UTC](https://discourse.julialang.org/t/help-converting-jags-jl-example-to-turing/98718 "2023-05-18T12:57:28Z")

</div>

I want to start using Turing and decided to learn it by converting an example from Jags.jl (which I have used before). I have selected the ‘rats’ example from Jags.jl for the test. I have a working code, but 2 issues th…

---

## [How do I parallelize a while loop?](https://discourse.julialang.org/t/how-do-i-parallelize-a-while-loop/99053)

<div class="topic-metadata">

**Author:** [@user\_231578](https://discourse.julialang.org/u/user_231578)\
**Replies:** 3\
**Last updated:** [May 18, 2023, 12:37pm UTC](https://discourse.julialang.org/t/how-do-i-parallelize-a-while-loop/99053 "2023-05-18T12:37:49Z")

</div>

I am trying to parallelize a while loop in Julia but I am not sure where to start. For example, suppose I have the following loop: A = \[\] i = 0 while i \< 5000000 j = rand(1:5000000) if j == i push!(A,i) i = 0 …

---

## [Constructor functionality within Struct](https://discourse.julialang.org/t/constructor-functionality-within-struct/99040)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 2\
**Last updated:** [May 18, 2023, 8:36am UTC](https://discourse.julialang.org/t/constructor-functionality-within-struct/99040 "2023-05-18T08:36:53Z")

</div>

Is this bad coding? @with\_kw struct X @deftype Float64 a; b; c; d; e; f; g xv::Vector{Float64} yv = map(xv) do x # 10 lines of calculation using struct variables a - g. end end The do block c…

---

## [How to include the iteration number of a loop in variable names?](https://discourse.julialang.org/t/how-to-include-the-iteration-number-of-a-loop-in-variable-names/90840)

<div class="topic-metadata">

**Author:** [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Replies:** 4\
**Last updated:** [May 18, 2023, 7:19am UTC](https://discourse.julialang.org/t/how-to-include-the-iteration-number-of-a-loop-in-variable-names/90840 "2023-05-18T07:19:29Z")

</div>

I have a loop iterating on r and want to define the variable x^r in every iteration. I know one possibility is defining an anonymous variable, but it is not what I need. m=Model() for r in 1:4 x = @variable(m, \[r…

---

## [Different outputs after adding x-axis coordinates of data in Makie.jl](https://discourse.julialang.org/t/different-outputs-after-adding-x-axis-coordinates-of-data-in-makie-jl/99037)

<div class="topic-metadata">

**Author:** [@nebula](https://discourse.julialang.org/u/nebula)\
**Replies:** 4\
**Last updated:** [May 18, 2023, 6:11am UTC](https://discourse.julialang.org/t/different-outputs-after-adding-x-axis-coordinates-of-data-in-makie-jl/99037 "2023-05-18T06:11:43Z")

</div>

The outputs are different for the codes below: f = Figure() ax1 = Axis(f\[1, 1\], xgridvisible=false, ygridvisible=false) scatter!(ax1, 0:1e-3:1, ones(1001), markersize=1) f f = Figure() ax1 = Axis(f\[1, 1\], xgridvisib…

---

## [Calling a function to change a struct?](https://discourse.julialang.org/t/calling-a-function-to-change-a-struct/98846)

<div class="topic-metadata">

**Author:** [@hshackle](https://discourse.julialang.org/u/hshackle)\
**Replies:** 8\
**Last updated:** [May 18, 2023, 4:49am UTC](https://discourse.julialang.org/t/calling-a-function-to-change-a-struct/98846 "2023-05-18T04:49:00Z")

</div>

I am trying to use a function in order to modify a struct that is passed to it as a variable. Below is a minimal bit of code I have put together to illustrate my confusion. struct a x::Int y::Int end function s…

---

## [Type annotating captured variables](https://discourse.julialang.org/t/type-annotating-captured-variables/99007)

<div class="topic-metadata">

**Author:** [@zalky](https://discourse.julialang.org/u/zalky)\
**Replies:** 12\
**Last updated:** [May 18, 2023, 4:12am UTC](https://discourse.julialang.org/t/type-annotating-captured-variables/99007 "2023-05-18T04:12:01Z")

</div>

Hi all, In the performance tips section of the officials docs, when it comes to captured variables it suggests that: … if it is known that a captured variable does not change its type, then this can be declared explic…

---

## [JuliaPro v1.5.3-1 and Julia v.1.5.4 quarantined by Cisco AMP as ransomware](https://discourse.julialang.org/t/juliapro-v1-5-3-1-and-julia-v-1-5-4-quarantined-by-cisco-amp-as-ransomware/57233)

<div class="topic-metadata">

**Author:** [@elbert5770](https://discourse.julialang.org/u/elbert5770)\
**Replies:** 2\
**Last updated:** [May 18, 2023, 3:37am UTC](https://discourse.julialang.org/t/juliapro-v1-5-3-1-and-julia-v-1-5-4-quarantined-by-cisco-amp-as-ransomware/57233 "2023-05-18T03:37:26Z")

</div>

Event Type: Threat Detected Computer:XXX Hostname: XXX IP: XXX Detection: W32.MAP.Ransomware.rewrite File: julia.exe File path: \\?\\C:\\Users\\XXX\\AppData\\Local\\JuliaPro-1.5.3-1\\Julia-1.5.3\\bin\\julia.exe Detection SH…

---

## [Julia crashes with new installation on installing a package](https://discourse.julialang.org/t/julia-crashes-with-new-installation-on-installing-a-package/79150)

<div class="topic-metadata">

**Author:** [@amca01](https://discourse.julialang.org/u/amca01)\
**Replies:** 3\
**Last updated:** [May 18, 2023, 3:36am UTC](https://discourse.julialang.org/t/julia-crashes-with-new-installation-on-installing-a-package/79150 "2023-05-18T03:36:07Z")

</div>

I’ve had troubles with Julia 1.7.1 on Windows 10, so just now I downloaded and installed 1.7.2 - as a user, and checked “Add Julia to PATH” as recommended. The first thing was to add a package or two: Pkg\> add "Linear…

---

## [Julia.exe just disappeared, when packages were installing](https://discourse.julialang.org/t/julia-exe-just-disappeared-when-packages-were-installing/75387)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 8\
**Last updated:** [May 18, 2023, 3:33am UTC](https://discourse.julialang.org/t/julia-exe-just-disappeared-when-packages-were-installing/75387 "2023-05-18T03:33:34Z")

</div>

I’ve got a new laptop from the university. (win10) I’ve installed Julia. (ver 1.7.1) Open in a terminal, it works. Using Pkg; Pkg.update(); - it works. (there is no packages) Pkg.add(“DataFrames”) - started to instal p…

---

## [Error Running Simple Gaussian Demo - Turing.jl](https://discourse.julialang.org/t/error-running-simple-gaussian-demo-turing-jl/97553)

<div class="topic-metadata">

**Author:** [@joshuaderekwhite](https://discourse.julialang.org/u/joshuaderekwhite)\
**Replies:** 4\
**Last updated:** [May 18, 2023, 3:21am UTC](https://discourse.julialang.org/t/error-running-simple-gaussian-demo-turing-jl/97553 "2023-05-18T03:21:08Z")

</div>

Hello, I am trying to run the Simple Gaussian Demo found here: https://turing.ml/v0.22/docs/using-turing/guide. I have copied the gdemo model as written as well as c1-c6. c1 and c2 run without any errors, however for c3…

---

## [Workflow for MCMC parameter estimation](https://discourse.julialang.org/t/workflow-for-mcmc-parameter-estimation/98960)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 3\
**Last updated:** [May 18, 2023, 3:04am UTC](https://discourse.julialang.org/t/workflow-for-mcmc-parameter-estimation/98960 "2023-05-18T03:04:20Z")

</div>

Hi, I would like to use Julia for the parameter estimation of an ODE system using MCMC. I have empirical data sets and ODE model that I can successfully solve using DifferentialEquations.jl. What packages/ workflow I …

---

## [Why is \`1/5\` not equal to \`1//5\`?](https://discourse.julialang.org/t/why-is-1-5-not-equal-to-1-5/98881)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 15\
**Last updated:** [May 18, 2023, 2:49am UTC](https://discourse.julialang.org/t/why-is-1-5-not-equal-to-1-5/98881 "2023-05-18T02:49:30Z")

</div>

I am curious about the decision to have 1/5 == 1//5 return false. I’m assuming there is a rationale (pun intended) and would like to understand why. Note that 1/2 == 1//2 returns true. This make sense in so far as some …

---

## [Function to string](https://discourse.julialang.org/t/function-to-string/99018)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 17\
**Last updated:** [May 18, 2023, 2:24am UTC](https://discourse.julialang.org/t/function-to-string/99018 "2023-05-18T02:24:58Z")

</div>

I have a function ω = 2 f(t) = cos(3 ω + t) I would like a function, say, my\_string(fct) that would return “cos(3 ω + t)”. Is this possible? A simple example would be great. Alternatively, given a string: strg = …

---

## [Trouble understanding @turbo and passing kwargs](https://discourse.julialang.org/t/trouble-understanding-turbo-and-passing-kwargs/99023)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 1\
**Last updated:** [May 18, 2023, 2:27am UTC](https://discourse.julialang.org/t/trouble-understanding-turbo-and-passing-kwargs/99023 "2023-05-18T02:27:15Z")

</div>

After searching for awhile I’m stuck trying to understand why This works fine using LoopVectorization x = rand(10) y = rand(10) function turbofun(x,y) return x\*y end @turbo turbofun.(x, y) and so does this func…

---

## [Calculating Hessians of loss w.r.t parameters of a system of ODEs](https://discourse.julialang.org/t/calculating-hessians-of-loss-w-r-t-parameters-of-a-system-of-odes/99025)

<div class="topic-metadata">

**Author:** [@KK\_JuliaNoob](https://discourse.julialang.org/u/KK_JuliaNoob)\
**Replies:** 1\
**Last updated:** [May 18, 2023, 12:30am UTC](https://discourse.julialang.org/t/calculating-hessians-of-loss-w-r-t-parameters-of-a-system-of-odes/99025 "2023-05-18T00:30:09Z")

</div>

I have a system of ~10 ODEs with ~20 parameters and a loss function (e.g. MSE) that is evaluated on the trace of the ODE solution. What’s an efficient way to calculate the Hessian matrix of the loss w.r.t the parameters?…

---

## [How to vectorize a JuMP solver](https://discourse.julialang.org/t/how-to-vectorize-a-jump-solver/99010)

<div class="topic-metadata">

**Author:** [@Longblackcoffee](https://discourse.julialang.org/u/Longblackcoffee)\
**Replies:** 2\
**Last updated:** [May 18, 2023, 12:16am UTC](https://discourse.julialang.org/t/how-to-vectorize-a-jump-solver/99010 "2023-05-18T00:16:07Z")

</div>

Hi everyone, Is it possible to vectorize a JuMP solver? I want to solve a maximization problem for different draws of a random variable (X in the example below, drawn from a log-normal distribution). So for a vector of …

---

## [Using DifffEqBayes.jl for fitting y(x) instead of time series](https://discourse.julialang.org/t/using-difffeqbayes-jl-for-fitting-y-x-instead-of-time-series/99026)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 0\
**Last updated:** [May 17, 2023, 11:32pm UTC](https://discourse.julialang.org/t/using-difffeqbayes-jl-for-fitting-y-x-instead-of-time-series/99026 "2023-05-17T23:32:09Z")

</div>

I was wondering if there is an option in DiffEqBayes.jl or another package to make MCMC parameter estimation that fits one of the variables as a function of the other, rather than the time series of each. Let’s say I ha…

---

## [What is it like being a (Julia) research software engineer?](https://discourse.julialang.org/t/what-is-it-like-being-a-julia-research-software-engineer/98922)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 13\
**Last updated:** [May 17, 2023, 10:55pm UTC](https://discourse.julialang.org/t/what-is-it-like-being-a-julia-research-software-engineer/98922 "2023-05-17T22:55:25Z")

</div>

Context After defending my PhD in machine learning & optimization last December, I started a rather theoretical postdoc on similar topics. Now I’m wondering what to do next, whether inside or outside of the academic wor…

---

## [Package management via conda?](https://discourse.julialang.org/t/package-management-via-conda/60806)

<div class="topic-metadata">

**Author:** [@nick-youngblut](https://discourse.julialang.org/u/nick-youngblut)\
**Replies:** 41\
**Last updated:** [May 17, 2023, 10:07pm UTC](https://discourse.julialang.org/t/package-management-via-conda/60806 "2023-05-17T22:07:56Z")

</div>

I currently use python and R for data science tasks. I’m considering trying out Julia, but I’d like to manage all packages (python, R, and Julia) via conda. Is that possible? I see that Julia can be easily installed via …

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

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