# Latest

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

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

**Page:** 908

---

## [Static variable in a templated function or struct](https://discourse.julialang.org/t/static-variable-in-a-templated-function-or-struct/88093)

<div class="topic-metadata">

**Author:** [@DerongXu](https://discourse.julialang.org/u/DerongXu)\
**Replies:** 1\
**Last updated:** [October 1, 2022, 6:15pm UTC](https://discourse.julialang.org/t/static-variable-in-a-templated-function-or-struct/88093 "2022-10-01T18:15:39Z")

</div>

There are a lot of discussions to emulate local static variable in Julia. One is to use let block, let a = 0 global function f() a += 1 end end However, it is not work…

---

## [Meaning of \`GLM.lm\` results (\`t\` and \`Pr(\>|t|)\`)](https://discourse.julialang.org/t/meaning-of-glm-lm-results-t-and-pr-t/88042)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 9\
**Last updated:** [October 1, 2022, 4:30pm UTC](https://discourse.julialang.org/t/meaning-of-glm-lm-results-t-and-pr-t/88042 "2022-10-01T16:30:52Z")

</div>

Hi all! This is a very noobish question, I was uncertain if I should put it in “New to Julia” section, so sorry about it. Anyway, when I fit a linear model using the GLM package, like this: using DataFrames using CSV …

---

## [Nelder Mead tolerance vastly higher when I restart optimization with updated guess for initial parameters](https://discourse.julialang.org/t/nelder-mead-tolerance-vastly-higher-when-i-restart-optimization-with-updated-guess-for-initial-parameters/87939)

<div class="topic-metadata">

**Author:** [@structural](https://discourse.julialang.org/u/structural)\
**Replies:** 20\
**Last updated:** [October 1, 2022, 3:32pm UTC](https://discourse.julialang.org/t/nelder-mead-tolerance-vastly-higher-when-i-restart-optimization-with-updated-guess-for-initial-parameters/87939 "2022-10-01T15:32:40Z")

</div>

Is it normal for the tolerance to jump when you restart Optim with the parameters initialized to equal the parameters from the last iteration of the last Optim call? I am minimizing some function f(b, x) using Nelder-Me…

---

## [How to stop a file watching task in Julia 1.8? Possible regression?](https://discourse.julialang.org/t/how-to-stop-a-file-watching-task-in-julia-1-8-possible-regression/86448)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 12\
**Last updated:** [October 1, 2022, 1:50pm UTC](https://discourse.julialang.org/t/how-to-stop-a-file-watching-task-in-julia-1-8-possible-regression/86448 "2022-10-01T13:50:47Z")

</div>

Hello! I am using BetterFileWatching.jl and the following code snippet: watch\_task = @async watch\_folder(".") do event @info "Something changed!" event end sleep(5) # stop watching the folder schedule(watch\_task,…

---

## [Initialize an array (or other structure), add](https://discourse.julialang.org/t/initialize-an-array-or-other-structure-add/88064)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 4\
**Last updated:** [October 1, 2022, 12:05pm UTC](https://discourse.julialang.org/t/initialize-an-array-or-other-structure-add/88064 "2022-10-01T12:05:03Z")

</div>

I’m looking to create something like this: array = \[(0,0) (0,0) ;(0,0) (0,0) ; (0,0) (0,0)\] To store the results of a loop where the first iteration returns an array of pairs that I use to overwrite column 1 \[(m,n); (…

---

## [Filtering list from a list](https://discourse.julialang.org/t/filtering-list-from-a-list/88074)

<div class="topic-metadata">

**Author:** [@Phuntsho](https://discourse.julialang.org/u/Phuntsho)\
**Replies:** 4\
**Last updated:** [October 1, 2022, 11:59am UTC](https://discourse.julialang.org/t/filtering-list-from-a-list/88074 "2022-10-01T11:59:26Z")

</div>

I have two lists: one containing a list of tuples (numbers) and the other the list of numbers. For instance, L = \[(2,3),(5,6), (4,6),…\] and E = \[2,5,7,3…\]. Now, are there any other better ways to do similar to the follow…

---

## [Recreate a random number series when not using Random.seed!(my\_seed)](https://discourse.julialang.org/t/recreate-a-random-number-series-when-not-using-random-seed-my-seed/88038)

<div class="topic-metadata">

**Author:** [@ArchieCall](https://discourse.julialang.org/u/ArchieCall)\
**Replies:** 12\
**Last updated:** [October 1, 2022, 9:45am UTC](https://discourse.julialang.org/t/recreate-a-random-number-series-when-not-using-random-seed-my-seed/88038 "2022-10-01T09:45:11Z")

</div>

Is there a way to get back a random number series when Random.seed!(my\_seed) was not used to create the series. One thought I had was to randomly generate my\_seed and then use that to gen the series in the Random.seed! …

---

## [PlotlyJS plot configuration settings in VSCode](https://discourse.julialang.org/t/plotlyjs-plot-configuration-settings-in-vscode/74312)

<div class="topic-metadata">

**Author:** [@Timothy](https://discourse.julialang.org/u/Timothy)\
**Replies:** 1\
**Last updated:** [October 1, 2022, 8:10am UTC](https://discourse.julialang.org/t/plotlyjs-plot-configuration-settings-in-vscode/74312 "2022-10-01T08:10:34Z")

</div>

How can I change the plot configuration settings for PlotlyJS when I plot from VSCode (either notebook or editor)? In VSCode, the configuration settings always seem to be overwritten. For example, the code below should …

---

## [Relation of coroutines, threads, and Tasks](https://discourse.julialang.org/t/relation-of-coroutines-threads-and-tasks/87735)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 4\
**Last updated:** [October 1, 2022, 7:35am UTC](https://discourse.julialang.org/t/relation-of-coroutines-threads-and-tasks/87735 "2022-10-01T07:35:04Z")

</div>

A simple version of my question is “How can Tasks and Channels, which are coroutine-related, be used safely with threads?” The “how” here is more in these sense of “how is it possible” than “how do I code it”, since the…

---

## [How to appreciate Expr(:meta, args...)](https://discourse.julialang.org/t/how-to-appreciate-expr-meta-args/88071)

<div class="topic-metadata">

**Author:** [@lionisxn](https://discourse.julialang.org/u/lionisxn)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 7:14am UTC](https://discourse.julialang.org/t/how-to-appreciate-expr-meta-args/88071 "2022-10-01T07:14:55Z")

</div>

The Julia domment exlaining the Expr type of ‘:meta’ is so concise to a newer like me. What is the manning of Expr(:meta, args…), and how to use it? Simple examples may be helpfull.

---

## [Distributed worker detect ip address via socket connection?](https://discourse.julialang.org/t/distributed-worker-detect-ip-address-via-socket-connection/88068)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 1\
**Last updated:** [October 1, 2022, 3:27am UTC](https://discourse.julialang.org/t/distributed-worker-detect-ip-address-via-socket-connection/88068 "2022-10-01T03:27:25Z")

</div>

Right now there’s this kinda dumb logic going on: submit jobs for worker nodes to launch julia --worker=\<cookie\> | nc \<hostip\> \<hostport\> the julia --worker=\<cookie\> would print out the julia\_worker:workerport#worker…

---

## [Make julia without repl precompile](https://discourse.julialang.org/t/make-julia-without-repl-precompile/88066)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 2:53am UTC](https://discourse.julialang.org/t/make-julia-without-repl-precompile/88066 "2022-10-01T02:53:46Z")

</div>

Making julia takes a while. Much of this time is spent generating and executing REPL precompile statements. Is there an option to make without precompile for faster development iterations?

---

## [Documentation for how macros handle keyword arguments](https://discourse.julialang.org/t/documentation-for-how-macros-handle-keyword-arguments/88009)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 2:51am UTC](https://discourse.julialang.org/t/documentation-for-how-macros-handle-keyword-arguments/88009 "2022-10-01T02:51:41Z")

</div>

Macros seem to have a pretty weird way of dealing with keyword arguments, especially keyword arguments that are passed with ;. It seems arguments after ; are moved to the front of the macro call, except if the macro is c…

---

## [Immediately executing closure as function barrier](https://discourse.julialang.org/t/immediately-executing-closure-as-function-barrier/87976)

<div class="topic-metadata">

**Author:** [@torrance](https://discourse.julialang.org/u/torrance)\
**Replies:** 16\
**Last updated:** [September 30, 2022, 10:08pm UTC](https://discourse.julialang.org/t/immediately-executing-closure-as-function-barrier/87976 "2022-09-30T22:08:50Z")

</div>

It’s common for code to do a bunch of allocations up front, that may or may not be type stable, and then call out to another function to do some actual work with those allocations. This ‘function barrier’ enables the ker…

---

## [Solve Simultaneous Algebraic Equations (x eqns and x unknowns)](https://discourse.julialang.org/t/solve-simultaneous-algebraic-equations-x-eqns-and-x-unknowns/88060)

<div class="topic-metadata">

**Author:** [@rwalters31](https://discourse.julialang.org/u/rwalters31)\
**Replies:** 2\
**Last updated:** [October 1, 2022, 1:55am UTC](https://discourse.julialang.org/t/solve-simultaneous-algebraic-equations-x-eqns-and-x-unknowns/88060 "2022-10-01T01:55:01Z")

</div>

I have been looking for a Julia package to solve simultaneous algebraic equations. A simple example for two equations and two unknowns might look like: x^{2}+y^{2}=5 y=\\frac{1}{2}x^{3}+3x^{2}-2x-3 Here is a plot of…

---

## [Surprising type inference failure for \`map\` on mid-size tuples](https://discourse.julialang.org/t/surprising-type-inference-failure-for-map-on-mid-size-tuples/88057)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [September 30, 2022, 10:48pm UTC](https://discourse.julialang.org/t/surprising-type-inference-failure-for-map-on-mid-size-tuples/88057 "2022-09-30T22:48:59Z")

</div>

This surprised me: using Test # for Test.@inferred g(::Val{n}) where {n} = ntuple(i -\> one(Rational{BigInt}), Val{n}()) # constructs an example tuple of specified length map(+, g(Val{30}()), g(Val{30}())); # warm up …

---

## [Assigned variables not working](https://discourse.julialang.org/t/assigned-variables-not-working/88014)

<div class="topic-metadata">

**Author:** [@Max\_Beez](https://discourse.julialang.org/u/Max_Beez)\
**Replies:** 11\
**Last updated:** [September 30, 2022, 9:31pm UTC](https://discourse.julialang.org/t/assigned-variables-not-working/88014 "2022-09-30T21:31:20Z")

</div>

I have multiple plots I am making of a given function that has modifications for each plot, and in each plot method I use the kwarg lw (line weight) so I have 6 plots so for each iteration of the function I have a differ…

---

## [Derivatives of B-Spline w.r.t their degrees of freedom](https://discourse.julialang.org/t/derivatives-of-b-spline-w-r-t-their-degrees-of-freedom/87997)

<div class="topic-metadata">

**Author:** [@touste](https://discourse.julialang.org/u/touste)\
**Replies:** 3\
**Last updated:** [September 30, 2022, 9:25pm UTC](https://discourse.julialang.org/t/derivatives-of-b-spline-w-r-t-their-degrees-of-freedom/87997 "2022-09-30T21:25:31Z")

</div>

Hi all, I’m trying to approximate a shape described by a set of 3D points with a smooth interpolant, I’ve settled on a parametric B-Spline. I’ve got a set of 3D points P\_i: using GeometryBasics P₁ = Point3(0.0, 0.0, 0…

---

## [Testing a different file than runtests.jl](https://discourse.julialang.org/t/testing-a-different-file-than-runtests-jl/87789)

<div class="topic-metadata">

**Author:** [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Replies:** 10\
**Last updated:** [September 30, 2022, 9:04pm UTC](https://discourse.julialang.org/t/testing-a-different-file-than-runtests-jl/87789 "2022-09-30T21:04:17Z")

</div>

Hello I would like to specify a different file than runtests.jl when runing test from Pkg. Something like: pkg\> test file=anotherfile.jl The file would still reside in the test directory. But that would allow me to av…

---

## [Extract from a cartesian index](https://discourse.julialang.org/t/extract-from-a-cartesian-index/88062)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 1\
**Last updated:** [September 30, 2022, 9:04pm UTC](https://discourse.julialang.org/t/extract-from-a-cartesian-index/88062 "2022-09-30T21:04:12Z")

</div>

Hello! I am looking to extract the coordinates from this array of cartesian indexes in the lokmax vector. lokmax = vec(findmax(bellman,dims=1)\[2\]) resulting in CartesianIndex{2}\[CartesianIndex(3, 1), CartesianIndex(…

---

## [Pure Julia HINT benchmark](https://discourse.julialang.org/t/pure-julia-hint-benchmark/88055)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 0\
**Last updated:** [September 30, 2022, 8:04pm UTC](https://discourse.julialang.org/t/pure-julia-hint-benchmark/88055 "2022-09-30T20:04:31Z")

</div>

Back in the day John Gustafson and friends invented a really great benchmark called HINT (Hierarchical INTegration). It measures quality improvements per second (quips) as a function of memory used… So produces a curve …

---

## [Key error when adding a complementarity condition](https://discourse.julialang.org/t/key-error-when-adding-a-complementarity-condition/87810)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 6\
**Last updated:** [September 30, 2022, 8:02pm UTC](https://discourse.julialang.org/t/key-error-when-adding-a-complementarity-condition/87810 "2022-09-30T20:02:22Z")

</div>

I’m working to translate some economics models from GAMS into Julia using the Complementarity package and I’m running into an issue where a variable is defined on a larger set than its complementary equation. Here is a s…

---

## [Get MIPGap in Gurobi callbacks JuMP 0.21](https://discourse.julialang.org/t/get-mipgap-in-gurobi-callbacks-jump-0-21/37232)

<div class="topic-metadata">

**Author:** [@bnarum](https://discourse.julialang.org/u/bnarum)\
**Replies:** 5\
**Last updated:** [September 30, 2022, 7:44pm UTC](https://discourse.julialang.org/t/get-mipgap-in-gurobi-callbacks-jump-0-21/37232 "2022-09-30T19:44:23Z")

</div>

Hi I’ve implemented a model with callbacks in Gurobi and experienced that cbget\_mipsol\_obj and cbget\_mipsol\_objbst returns the same value. Nodes | Current Node | Objective Bounds | Work Expl …

---

## [Best way to convert/collect/promote into a concrete struct?](https://discourse.julialang.org/t/best-way-to-convert-collect-promote-into-a-concrete-struct/87953)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 5\
**Last updated:** [September 30, 2022, 7:24pm UTC](https://discourse.julialang.org/t/best-way-to-convert-collect-promote-into-a-concrete-struct/87953 "2022-09-30T19:24:18Z")

</div>

I have the struct below that I am trying to make more flexible: struct PolyFit x::Vector{Float64} y::Vector{Float64} knots::Vector{Int64} segmentlengths::Vector{Float64} polys::Vector{Polynomial{Floa…

---

## [How do you preform multiple actions in a thread safe way?](https://discourse.julialang.org/t/how-do-you-preform-multiple-actions-in-a-thread-safe-way/88049)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [September 30, 2022, 5:50pm UTC](https://discourse.julialang.org/t/how-do-you-preform-multiple-actions-in-a-thread-safe-way/88049 "2022-09-30T17:50:31Z")

</div>

I need to check the sums of different combinations from a matrix, and get the biggest sum out. There are 20! combinations. I need to thread safely check if the loop’s current sum is bigger than the current sum and if it …

---

## [Italic string in a plot, how?](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036)

<div class="topic-metadata">

**Author:** [@fdamore](https://discourse.julialang.org/u/fdamore)\
**Replies:** 6\
**Last updated:** [September 30, 2022, 5:04pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036 "2022-09-30T17:04:55Z")

</div>

Hi, I’m trying to create a plot with Plots: without using Latex, how can one make an italic label for the axes? Thanks!

---

## [How to fix "ERROR: LoadError: ArgumentError: Package X does not have Y in its dependencies:..." when developing package](https://discourse.julialang.org/t/how-to-fix-error-loaderror-argumenterror-package-x-does-not-have-y-in-its-dependencies-when-developing-package/88040)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [September 30, 2022, 3:53pm UTC](https://discourse.julialang.org/t/how-to-fix-error-loaderror-argumenterror-package-x-does-not-have-y-in-its-dependencies-when-developing-package/88040 "2022-09-30T15:53:08Z")

</div>

I am trying to create a new PR for a package (Catalyst) that adds a dependency (MetaGraphs). I run \]dev Catalyst, and add some code under “.julia/dev/Catalyst/src”, this includes using MetaGraphs. I then create a new ju…

---

## [How to use all variable in @formula like R language?](https://discourse.julialang.org/t/how-to-use-all-variable-in-formula-like-r-language/88031)

<div class="topic-metadata">

**Author:** [@rmsmsgood](https://discourse.julialang.org/u/rmsmsgood)\
**Replies:** 4\
**Last updated:** [September 30, 2022, 3:34pm UTC](https://discourse.julialang.org/t/how-to-use-all-variable-in-formula-like-r-language/88031 "2022-09-30T15:34:46Z")

</div>

out \<- glm(y ~ . , family=binomial(),data=turnout) In R, above syntax works and i expected that’s similar to julia, but . is not a proper symbol in GLM.jl maybe. julia\> out = glm(@formula(y ~ .), train, Binomial()) ERR…

---

## [Julia startup speed cut in half. Was: (Unofficial) Julia 1.9 for lower latency (startup)](https://discourse.julialang.org/t/julia-startup-speed-cut-in-half-was-unofficial-julia-1-9-for-lower-latency-startup/83338)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 17\
**Last updated:** [September 30, 2022, 3:15pm UTC](https://discourse.julialang.org/t/julia-startup-speed-cut-in-half-was-unofficial-julia-1-9-for-lower-latency-startup/83338 "2022-09-30T15:15:40Z")

</div>

The timing for (not unofficial) 1.9 master shows 7.6% faster startup than for Julia 1.7.0: $ hyperfine '~/Downloads/julia-a60c76ea57/bin/julia -e ""' Benchmark 1: ~/Downloads/julia-a60c76ea57/bin/julia -e "" Time (mea…

---

## [Methods imported from submodules are overwritten, not extended](https://discourse.julialang.org/t/methods-imported-from-submodules-are-overwritten-not-extended/87995)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 3\
**Last updated:** [September 30, 2022, 2:00pm UTC](https://discourse.julialang.org/t/methods-imported-from-submodules-are-overwritten-not-extended/87995 "2022-09-30T14:00:06Z")

</div>

I assumed that by defining different argument requirements I would get different methods for an already imported function from a submodule, but it seems I am getting an overwrite instead of an extension. What’s the idiom…

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

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