# Latest

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

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

**Page:** 1037

---

## [How To Broadcast "in" to Compare Two Arrays?](https://discourse.julialang.org/t/how-to-broadcast-in-to-compare-two-arrays/81280)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 6\
**Last updated:** [May 19, 2022, 2:42am UTC](https://discourse.julialang.org/t/how-to-broadcast-in-to-compare-two-arrays/81280 "2022-05-19T02:42:19Z")

</div>

Hi all, I was doing some googling today and stumbled across this interesting syntax for an “in” broadcast where I want to check to see if any element from the first array is present in the second array: in(\[1, 2\]).(\[1,…

---

## [PSA: Glossary for beginners (WIP)](https://discourse.julialang.org/t/psa-glossary-for-beginners-wip/50340)

<div class="topic-metadata">

**Author:** [@miguelraz](https://discourse.julialang.org/u/miguelraz)\
**Replies:** 10\
**Last updated:** [May 19, 2022, 2:28am UTC](https://discourse.julialang.org/t/psa-glossary-for-beginners-wip/50340 "2022-05-19T02:28:23Z")

</div>

Hello, I have started this document as a handy glossary to point to for beginners. Generally intended for English as a Second Language Speakers or new users of online forums and the Julia Community in general. Suggestio…

---

## [Array{Float32} literal?](https://discourse.julialang.org/t/array-float32-literal/81195)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 10\
**Last updated:** [May 19, 2022, 2:11am UTC](https://discourse.julialang.org/t/array-float32-literal/81195 "2022-05-19T02:11:02Z")

</div>

We can get a Vector{Float32} literal with a = \[1.0f0, 2.0f0, 3.0f0, 4.0f0\] but it’s a bit tedious. I can think of a = map(i-\>Float32(i), \[1,2,3,4\]) Is there a better way? I imagine that something like this a = \[1,…

---

## [How does push!() work within accumulate()?](https://discourse.julialang.org/t/how-does-push-work-within-accumulate/81286)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 11:32pm UTC](https://discourse.julialang.org/t/how-does-push-work-within-accumulate/81286 "2022-05-18T23:32:58Z")

</div>

why are the two formulations of accumulate() different? accumulate((s,c)-\>push!(s,c),1:3,init=\[\]) != accumulate((s,c)-\>\[s;c\],1:3,init=\[\]) #true push!(\[1,2\],3)==\[\[1,2\];3\] # true

---

## [Fetch from remote machine produces "TypeError: non-boolean (Nothing) used in boolean context" for differing Julia versions](https://discourse.julialang.org/t/fetch-from-remote-machine-produces-typeerror-non-boolean-nothing-used-in-boolean-context-for-differing-julia-versions/81271)

<div class="topic-metadata">

**Author:** [@daharn](https://discourse.julialang.org/u/daharn)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 10:57pm UTC](https://discourse.julialang.org/t/fetch-from-remote-machine-produces-typeerror-non-boolean-nothing-used-in-boolean-context-for-differing-julia-versions/81271 "2022-05-18T22:57:57Z")

</div>

I know it used to work before, but currently I can’t get distributed computing on remote machines working again. If I simply run using Distributed addprocs(\["\<remotename\>"\], exename="\<pathToRemoteJuliaExe\>", dir="\<path…

---

## [Bivariate normal in Turing](https://discourse.julialang.org/t/bivariate-normal-in-turing/53446)

<div class="topic-metadata">

**Author:** [@drbenvincent](https://discourse.julialang.org/u/drbenvincent)\
**Replies:** 5\
**Last updated:** [May 18, 2022, 10:07pm UTC](https://discourse.julialang.org/t/bivariate-normal-in-turing/53446 "2022-05-18T22:07:23Z")

</div>

I’m just starting to get to grips with Turing, and enjoying it very much so far. But I’ve run up against a problem with a bivariate normal prior. using Turing, StatsPlots @model function pearson\_correlation(x) rows…

---

## [Efficient "parent" reference for structs](https://discourse.julialang.org/t/efficient-parent-reference-for-structs/81194)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 7\
**Last updated:** [May 18, 2022, 9:03pm UTC](https://discourse.julialang.org/t/efficient-parent-reference-for-structs/81194 "2022-05-18T21:03:18Z")

</div>

I have got the following two structs abstract type \_MyType end mutable struct Type1 \<: \_MyType a::Int end mutable struct Type2 \<: \_MyType a::Int end Furthermore there is some sort of “parent” / “global” cont…

---

## [Badge for generic-safe/OffsetArray-safe packages](https://discourse.julialang.org/t/badge-for-generic-safe-offsetarray-safe-packages/81270)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 0\
**Last updated:** [May 18, 2022, 4:33pm UTC](https://discourse.julialang.org/t/badge-for-generic-safe-offsetarray-safe-packages/81270 "2022-05-18T16:33:39Z")

</div>

Most packages are safe (with or without @inbounds) when used with regular arrays. I do not want to get people to alarmed, but most packages are likely unsafe when the user uses OffsetArray.jl and passes such an array in…

---

## [Eachindex for individual axes of multidimensional arrays?](https://discourse.julialang.org/t/eachindex-for-individual-axes-of-multidimensional-arrays/81264)

<div class="topic-metadata">

**Author:** [@gjm](https://discourse.julialang.org/u/gjm)\
**Replies:** 7\
**Last updated:** [May 18, 2022, 4:16pm UTC](https://discourse.julialang.org/t/eachindex-for-individual-axes-of-multidimensional-arrays/81264 "2022-05-18T16:16:12Z")

</div>

Because arrays’ indices don’t generally start from 1, best practice is to avoid anything like “for i in 1:size()” and instead use eachindex. But for multidimensional arrays, eachindex iterates over all elements of the ar…

---

## [Fastest way to turn table into Array?](https://discourse.julialang.org/t/fastest-way-to-turn-table-into-array/81255)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 5\
**Last updated:** [May 18, 2022, 3:51pm UTC](https://discourse.julialang.org/t/fastest-way-to-turn-table-into-array/81255 "2022-05-18T15:51:54Z")

</div>

Hi all. One if the main parts of my daily workflow makes me turn large tables to matrixes and or n-dims-arrays. For example: For a X Y Z Property table with 1 million+ lines, I do: Lat=-90:1:90 Long=-180:1:180 Zi=\[…

---

## [How to track down multi-threading issues?](https://discourse.julialang.org/t/how-to-track-down-multi-threading-issues/81248)

<div class="topic-metadata">

**Author:** [@ChrisJefferson](https://discourse.julialang.org/u/ChrisJefferson)\
**Replies:** 2\
**Last updated:** [May 18, 2022, 3:44pm UTC](https://discourse.julialang.org/t/how-to-track-down-multi-threading-issues/81248 "2022-05-18T15:44:18Z")

</div>

I have some multithreaded code which is crashing Julia – I suspect the problem is changing the same variable in multiple threads without appropriate locks. Are there any tools which can help me track down the problem? F…

---

## [Implementation of householder/reflection matrices with efficient multiplication?](https://discourse.julialang.org/t/implementation-of-householder-reflection-matrices-with-efficient-multiplication/81257)

<div class="topic-metadata">

**Author:** [@ptonner](https://discourse.julialang.org/u/ptonner)\
**Replies:** 5\
**Last updated:** [May 18, 2022, 3:09pm UTC](https://discourse.julialang.org/t/implementation-of-householder-reflection-matrices-with-efficient-multiplication/81257 "2022-05-18T15:09:02Z")

</div>

Is there a standard implementation of reflector/householder matrices and their efficient multiplication with vectors (e.g. O(n) cost)? I don’t think this would be hard to implement for my specific purposes, but for that…

---

## [Anonymous functions in for loops](https://discourse.julialang.org/t/anonymous-functions-in-for-loops/81259)

<div class="topic-metadata">

**Author:** [@domien96](https://discourse.julialang.org/u/domien96)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 2:01pm UTC](https://discourse.julialang.org/t/anonymous-functions-in-for-loops/81259 "2022-05-18T14:01:56Z")

</div>

Why does this code snippet print 2 instead of 1? anon = Array{Any}(undef, 2) for i = 1:2 anon\[i\] = ()-\> println(i) i += 1 end anon\[1\]()

---

## [Get a Symbol vector of all variable names in an Expr?](https://discourse.julialang.org/t/get-a-symbol-vector-of-all-variable-names-in-an-expr/39391)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 2\
**Last updated:** [May 18, 2022, 1:38pm UTC](https://discourse.julialang.org/t/get-a-symbol-vector-of-all-variable-names-in-an-expr/39391 "2022-05-18T13:38:38Z")

</div>

Is there a simple and type stable way to do this? julia\> f(:(x^2+sum(x,y-3,z))) 4-element Array{Symbol,1}: :x :x :y :z

---

## [Mutating array workaround for reverse AD?](https://discourse.julialang.org/t/mutating-array-workaround-for-reverse-ad/81009)

<div class="topic-metadata">

**Author:** [@beryl](https://discourse.julialang.org/u/beryl)\
**Replies:** 5\
**Last updated:** [May 18, 2022, 12:00pm UTC](https://discourse.julialang.org/t/mutating-array-workaround-for-reverse-ad/81009 "2022-05-18T12:00:18Z")

</div>

Hi, I have yet another unsolved problem for reverse mode AD (or I think, this is the same problem as the one I posted previously: LoadError: ArgumentError: Converting an instance of ReverseDiff.TrackedReal{Float64, Floa…

---

## [Unable to get a normalized density plot!](https://discourse.julialang.org/t/unable-to-get-a-normalized-density-plot/81251)

<div class="topic-metadata">

**Author:** [@devanshu](https://discourse.julialang.org/u/devanshu)\
**Replies:** 8\
**Last updated:** [May 18, 2022, 11:47am UTC](https://discourse.julialang.org/t/unable-to-get-a-normalized-density-plot/81251 "2022-05-18T11:47:44Z")

</div>

Hi, I am trying to get the density plot of a data set. I am using the StatsPlots package for this. My code looks like this density(data, fill=(0, 0.5), normalize=true). But I still don’t get a normalized plot. I wonde…

---

## [HTTP: Login to MediaWiki API with post fails (works with python)](https://discourse.julialang.org/t/http-login-to-mediawiki-api-with-post-fails-works-with-python/41657)

<div class="topic-metadata">

**Author:** [@zweiglimmergneis](https://discourse.julialang.org/u/zweiglimmergneis)\
**Replies:** 5\
**Last updated:** [May 18, 2022, 10:48am UTC](https://discourse.julialang.org/t/http-login-to-mediawiki-api-with-post-fails-works-with-python/41657 "2022-05-18T10:48:49Z")

</div>

Why can I login with python (module requests), but not with HTTP.jl? The MediaWiki API requires a login token, a bot user name and password. See python-code example. Bot user name looks like “user@juliahttp”. The passwo…

---

## [Does program interruption close open files automatically?](https://discourse.julialang.org/t/does-program-interruption-close-open-files-automatically/79774)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 9:47am UTC](https://discourse.julialang.org/t/does-program-interruption-close-open-files-automatically/79774 "2022-05-18T09:47:16Z")

</div>

This post talks about not closing a file on purpose. What about unintentionally exiting the program? Will my files be blocked (I’m on Windows)? I seem to remember having some problems with MATLAB years ago, and I had t…

---

## [Candlestick plots issue : Julia showing candlestick plots with just one colour](https://discourse.julialang.org/t/candlestick-plots-issue-julia-showing-candlestick-plots-with-just-one-colour/81224)

<div class="topic-metadata">

**Author:** [@ashishgourav](https://discourse.julialang.org/u/ashishgourav)\
**Replies:** 2\
**Last updated:** [May 18, 2022, 9:41am UTC](https://discourse.julialang.org/t/candlestick-plots-issue-julia-showing-candlestick-plots-with-just-one-colour/81224 "2022-05-18T09:41:18Z")

</div>

I am unable to plot candlestick in Julia properly. Here is a sample code: using Plots using Dates using MarketData using TimeSeries gr() ta = yahoo(:GOOG, YahooOpt(period1 = now() - Month(1))) display(plot(ta, se…

---

## [(LTS) version support badges](https://discourse.julialang.org/t/lts-version-support-badges/73730)

<div class="topic-metadata">

**Author:** [@Crown421](https://discourse.julialang.org/u/Crown421)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 9:17am UTC](https://discourse.julialang.org/t/lts-version-support-badges/73730 "2022-05-18T09:17:51Z")

</div>

I am not sure if this is strictly the right place to raise this, but I had a (potentially half-baked) idea and wanted to see what other people thought. Now that Julia 1.6 is the LTS, there is movement in various package…

---

## [Batch\_gcd in Julia](https://discourse.julialang.org/t/batch-gcd-in-julia/81204)

<div class="topic-metadata">

**Author:** [@AntoineHus](https://discourse.julialang.org/u/AntoineHus)\
**Replies:** 3\
**Last updated:** [May 18, 2022, 8:31am UTC](https://discourse.julialang.org/t/batch-gcd-in-julia/81204 "2022-05-18T08:31:53Z")

</div>

Hello everybody, On a recent project I was working on, I had to implement the Batch\_GCD algorithm from Bernstein. This algorithm could be use to check Weak keys in RSA. In which package should I ask the integration of…

---

## [Repeating simulations](https://discourse.julialang.org/t/repeating-simulations/81236)

<div class="topic-metadata">

**Author:** [@vamp](https://discourse.julialang.org/u/vamp)\
**Replies:** 2\
**Last updated:** [May 18, 2022, 7:44am UTC](https://discourse.julialang.org/t/repeating-simulations/81236 "2022-05-18T07:44:10Z")

</div>

Hello, I am using Julia for reinfocement learning and to repeat my simulations I would like to know if I can use a seed? I tried Random.seed!(1) But it does not repeat the same simulations.

---

## [How to extract weights from SimpleWeightedEdge (from kruskal\_mst)](https://discourse.julialang.org/t/how-to-extract-weights-from-simpleweightededge-from-kruskal-mst/81192)

<div class="topic-metadata">

**Author:** [@JedPhillips](https://discourse.julialang.org/u/JedPhillips)\
**Replies:** 5\
**Last updated:** [May 18, 2022, 7:19am UTC](https://discourse.julialang.org/t/how-to-extract-weights-from-simpleweightededge-from-kruskal-mst/81192 "2022-05-18T07:19:34Z")

</div>

I’m trying to figure out how to interact with a minimal spanning tree object returned by Graphs.kruskal\_mst(). I just can’t figure out how to extract the resulting edge wights (or the edges). Here’s a minimal code to sh…

---

## [Catching deprecated keyword arguments (with Parameters.jl)](https://discourse.julialang.org/t/catching-deprecated-keyword-arguments-with-parameters-jl/81235)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 0\
**Last updated:** [May 18, 2022, 7:00am UTC](https://discourse.julialang.org/t/catching-deprecated-keyword-arguments-with-parameters-jl/81235 "2022-05-18T07:00:08Z")

</div>

Consider a struct like @with\_kw struct MyStruct a::Int = 3 b::Int = 5 end b is no longer needed, so I am looking to deprecate it in the future, changing to @with\_kw struct MyStruct a::Int = 3 end Now, if …

---

## [Annotated heatmaps in Gadfly do not fully show the annotations in the first and last column](https://discourse.julialang.org/t/annotated-heatmaps-in-gadfly-do-not-fully-show-the-annotations-in-the-first-and-last-column/81217)

<div class="topic-metadata">

**Author:** [@Brinkhuis](https://discourse.julialang.org/u/Brinkhuis)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 6:18am UTC](https://discourse.julialang.org/t/annotated-heatmaps-in-gadfly-do-not-fully-show-the-annotations-in-the-first-and-last-column/81217 "2022-05-18T06:18:59Z")

</div>

Coming from Python I tried to reproduce this Seaborn heatmap using Gadfly. The (only) issue I have is that the first and last columns appear smaller than the other columns. As a result the annotations are not fully reada…

---

## [How to set different linestyles in Makie Series plot](https://discourse.julialang.org/t/how-to-set-different-linestyles-in-makie-series-plot/75818)

<div class="topic-metadata">

**Author:** [@bgctw](https://discourse.julialang.org/u/bgctw)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 6:04am UTC](https://discourse.julialang.org/t/how-to-set-different-linestyles-in-makie-series-plot/75818 "2022-05-18T06:04:11Z")

</div>

The Makie series command can be used to plot several lines of a matrix. I found an documentation example that shows how to set different labels and colors for the different lines. Could someone hint me to documentatio…

---

## [Garbage collection: More manual control](https://discourse.julialang.org/t/garbage-collection-more-manual-control/17951)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 3\
**Last updated:** [May 18, 2022, 1:55am UTC](https://discourse.julialang.org/t/garbage-collection-more-manual-control/17951 "2022-05-18T01:55:27Z")

</div>

I’ll first describe how I understand julia’s garbage collection from a high level. Then, my first question is whether I got this right. The next questions are about some manual control to improve performance. So, how do…

---

## [Symbolic propositional and predicate reasoning](https://discourse.julialang.org/t/symbolic-propositional-and-predicate-reasoning/80506)

<div class="topic-metadata">

**Author:** [@davidstreader](https://discourse.julialang.org/u/davidstreader)\
**Replies:** 1\
**Last updated:** [May 18, 2022, 1:26am UTC](https://discourse.julialang.org/t/symbolic-propositional-and-predicate-reasoning/80506 "2022-05-18T01:26:14Z")

</div>

Hi (big picture I am interested in reasoning about symbolic event based systems. Hence I am trying to build a Domain Specific Language similar to both TLA+ and CSP) I have found how to perform symbolic substitution and…

---

## [Fixing the value of some variables when defining it, not in the constraints](https://discourse.julialang.org/t/fixing-the-value-of-some-variables-when-defining-it-not-in-the-constraints/81218)

<div class="topic-metadata">

**Author:** [@CactusHamster](https://discourse.julialang.org/u/CactusHamster)\
**Replies:** 2\
**Last updated:** [May 17, 2022, 11:07pm UTC](https://discourse.julialang.org/t/fixing-the-value-of-some-variables-when-defining-it-not-in-the-constraints/81218 "2022-05-17T23:07:22Z")

</div>

I’m very new to JuMP so this might be a trivial question. We have a binary variable x\_{ij}. We would like to set x\_{ij} to be zero for some i and some j. So for example, nodes 1:10 cannot be assigned to nodes 1:5. So he…

---

## [A good way of building neural networks in both Julia and Python](https://discourse.julialang.org/t/a-good-way-of-building-neural-networks-in-both-julia-and-python/72064)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 4\
**Last updated:** [May 17, 2022, 10:46pm UTC](https://discourse.julialang.org/t/a-good-way-of-building-neural-networks-in-both-julia-and-python/72064 "2022-05-17T22:46:14Z")

</div>

Hi, I’ve built some custom neural networks in Julia (especially, Flux.jl). However, for some reason, I wanna use the same neural networks in Python. In this case, it may be possible to rewrite the neural networks code…

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

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