# Latest

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

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

**Page:** 960

---

## [Mapping a value from one range to another](https://discourse.julialang.org/t/mapping-a-value-from-one-range-to-another/85423)

<div class="topic-metadata">

**Author:** [@GameDungeon](https://discourse.julialang.org/u/GameDungeon)\
**Replies:** 11\
**Last updated:** [August 7, 2022, 5:34pm UTC](https://discourse.julialang.org/t/mapping-a-value-from-one-range-to-another/85423 "2022-08-07T17:34:46Z")

</div>

I have two ranges a and b. a = 1:10 b = 1:100 I have a value from a, say 5. If I were to map it onto range b its equivalent would be 50. In python you can write a function that does this like this: def map\_range(range…

---

## [\[GeoMakie\] contourf animation changes color range for each update of "record"](https://discourse.julialang.org/t/geomakie-contourf-animation-changes-color-range-for-each-update-of-record/85403)

<div class="topic-metadata">

**Author:** [@ManuelFossa](https://discourse.julialang.org/u/ManuelFossa)\
**Replies:** 3\
**Last updated:** [August 7, 2022, 2:10pm UTC](https://discourse.julialang.org/t/geomakie-contourf-animation-changes-color-range-for-each-update-of-record/85403 "2022-08-07T14:10:37Z")

</div>

I have a simple GeoAxis contourf animation, that iterates over time. The problem is that at each update of the record function, the color range changes, which can be seen as the colorbar changes ticks constantly. I woul…

---

## [Type stability when using fields of structs](https://discourse.julialang.org/t/type-stability-when-using-fields-of-structs/85408)

<div class="topic-metadata">

**Author:** [@Jonas208](https://discourse.julialang.org/u/Jonas208)\
**Replies:** 12\
**Last updated:** [August 7, 2022, 12:43pm UTC](https://discourse.julialang.org/t/type-stability-when-using-fields-of-structs/85408 "2022-08-07T12:43:34Z")

</div>

I am trying to optimize a function which mainly operates on arrays that are (nearly all) fields of a given struct. Yet, the performance of the function is NOT really fast. My first idea was to check type stability and ty…

---

## [How to use elements of a N\*M elements Vector of Vector for a constraint](https://discourse.julialang.org/t/how-to-use-elements-of-a-n-m-elements-vector-of-vector-for-a-constraint/85295)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 5\
**Last updated:** [August 7, 2022, 12:28pm UTC](https://discourse.julialang.org/t/how-to-use-elements-of-a-n-m-elements-vector-of-vector-for-a-constraint/85295 "2022-08-07T12:28:50Z")

</div>

Hi, We have two sets A = \[1,2,...,N\] and B = \[1,2,...,M\]. There are two other sets SA, SB associated with A and Bwhich are N-elements and M-elemets vector of vector. A = \[1:N\] B = \[1:M\] SA = \[ \[some stuff for 1\] , \[s…

---

## [Why does this function change the input?](https://discourse.julialang.org/t/why-does-this-function-change-the-input/85433)

<div class="topic-metadata">

**Author:** [@mistamista](https://discourse.julialang.org/u/mistamista)\
**Replies:** 8\
**Last updated:** [August 7, 2022, 12:19pm UTC](https://discourse.julialang.org/t/why-does-this-function-change-the-input/85433 "2022-08-07T12:19:29Z")

</div>

State=\[\[1,2,3\],,\]; function move(State,m,n) if checkLegal(State,m,n)\>0 State\[n\]=\[State\[m\]\[1\];;State\[n\]\] State\[m\]=State\[m\]\[2:end\] end return State end I’m trying to get a new state newState=move(State,1,2) Thi…

---

## [Mutually-circular type declarations for Clang.jl](https://discourse.julialang.org/t/mutually-circular-type-declarations-for-clang-jl/29411)

<div class="topic-metadata">

**Author:** [@steveaccount](https://discourse.julialang.org/u/steveaccount)\
**Replies:** 0\
**Last updated:** [October 2, 2019, 2:37pm UTC](https://discourse.julialang.org/t/mutually-circular-type-declarations-for-clang-jl/29411 "2019-10-02T14:37:53Z")

</div>

Where is the latest info about mutually-circular type declarations (also called ‘mutually recursive type declarations’, also for structs). Open issue in Julia since 2011. Latest info? Maybe “recursive field types, the e…

---

## [How to precompile Makie?](https://discourse.julialang.org/t/how-to-precompile-makie/20345)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 6\
**Last updated:** [August 7, 2022, 10:45am UTC](https://discourse.julialang.org/t/how-to-precompile-makie/20345 "2022-08-07T10:45:01Z")

</div>

I tried to precompile Makie, because it seemed easy: # add PackageCompiler Pkg.add("PackageCompiler") using PackageCompiler # This is not well tested, so please be careful # The safe option: PackageCompiler.compile\_pa…

---

## [Is Pyplot backend able to draw vectors in 3D?](https://discourse.julialang.org/t/is-pyplot-backend-able-to-draw-vectors-in-3d/85389)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [August 7, 2022, 10:04am UTC](https://discourse.julialang.org/t/is-pyplot-backend-able-to-draw-vectors-in-3d/85389 "2022-08-07T10:04:27Z")

</div>

I am open to any backend besides PyPlot. But I am currently use Pyplot to plot vectors, but unable to, here are the codes: using Plots pyplot() xc = \[0,0,1\] yc = \[0,1,0\] zc = \[1,0,0\] plot(xc,yc,zc,st=:line,arrows=:tr…

---

## [Plot with ribbon in MonteCarloMeasurements.jl](https://discourse.julialang.org/t/plot-with-ribbon-in-montecarlomeasurements-jl/85360)

<div class="topic-metadata">

**Author:** [@Firstname\_Lastname](https://discourse.julialang.org/u/Firstname_Lastname)\
**Replies:** 4\
**Last updated:** [August 7, 2022, 9:24am UTC](https://discourse.julialang.org/t/plot-with-ribbon-in-montecarlomeasurements-jl/85360 "2022-08-07T09:24:18Z")

</div>

Given a function y = a \* x + b where a and b are of the type Particles. By using MonteCarloMeasurements.jl and Plots.jl, I can plot many sample function y(x) as follows using MonteCarloMeasurements using Plots p = Part…

---

## [Lux.jl Chain of Dense layers don't see speed up going from 32 bits -\> 16 bits](https://discourse.julialang.org/t/lux-jl-chain-of-dense-layers-dont-see-speed-up-going-from-32-bits-16-bits/85419)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 5\
**Last updated:** [August 7, 2022, 8:49am UTC](https://discourse.julialang.org/t/lux-jl-chain-of-dense-layers-dont-see-speed-up-going-from-32-bits-16-bits/85419 "2022-08-07T08:49:54Z")

</div>

using Lux, BenchmarkTools, Random const rng = Random.default\_rng() julia\> let model = Chain( Dense(23, 30, Lux.relu), Dense(30, 25, Lux.relu), Dense(25, 20, Lux.relu…

---

## [Check values on adding to Dict](https://discourse.julialang.org/t/check-values-on-adding-to-dict/85410)

<div class="topic-metadata">

**Author:** [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Replies:** 4\
**Last updated:** [August 7, 2022, 8:36am UTC](https://discourse.julialang.org/t/check-values-on-adding-to-dict/85410 "2022-08-07T08:36:15Z")

</div>

Apologies if this should have been obvious, but I could not find a discussion or documentation on the topic. Admittedly, its late, I’m tired, and I may just be overlooking things… The question I’m struggling with is ess…

---

## [Clang.jl doesn't work for netmap (problem #ifdefs)](https://discourse.julialang.org/t/clang-jl-doesnt-work-for-netmap-problem-ifdefs/28596)

<div class="topic-metadata">

**Author:** [@steveaccount](https://discourse.julialang.org/u/steveaccount)\
**Replies:** 2\
**Last updated:** [August 7, 2022, 8:12am UTC](https://discourse.julialang.org/t/clang-jl-doesnt-work-for-netmap-problem-ifdefs/28596 "2022-08-07T08:12:04Z")

</div>

There is a possible bug/problem with Clang.jl. I am an assistant prof working on an implementation of netmap in Julia (fast networks by bypassing the kernel for IO). Here is the example: This works only if I remove an…

---

## [Find Power Spectrum and Density](https://discourse.julialang.org/t/find-power-spectrum-and-density/85415)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 4\
**Last updated:** [August 7, 2022, 5:58am UTC](https://discourse.julialang.org/t/find-power-spectrum-and-density/85415 "2022-08-07T05:58:54Z")

</div>

Hi! I have a set of time-series data. I’d just like to ask, are there packages available to decompose the signal into the power spectrum and the density/amplitude? And also, I would like to ask if there is a way to do…

---

## [Inverting default \`collect\` behavior when iterator returns an array](https://discourse.julialang.org/t/inverting-default-collect-behavior-when-iterator-returns-an-array/85409)

<div class="topic-metadata">

**Author:** [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Replies:** 3\
**Last updated:** [August 7, 2022, 3:56am UTC](https://discourse.julialang.org/t/inverting-default-collect-behavior-when-iterator-returns-an-array/85409 "2022-08-07T03:56:54Z")

</div>

A MWE: struct MyIter n limit end function Base.iterate(m::MyIter) state = ones(m.n) return (state,state .+ 1) end function Base.iterate(m::MyIter,state) if first(state) \> m.limit return no…

---

## [Chicago based persons interested in julia](https://discourse.julialang.org/t/chicago-based-persons-interested-in-julia/85407)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 10\
**Last updated:** [August 6, 2022, 11:37pm UTC](https://discourse.julialang.org/t/chicago-based-persons-interested-in-julia/85407 "2022-08-06T23:37:46Z")

</div>

Hi there I’m retired and living in Chicago. I have been waiting for Julia to develop to the point it now is at ( Geniebuilder, Pluto, DataframeMeta) and would like to meet people who are interested in julia development. …

---

## [Numerical integration of vector-valued functions using Julia packages](https://discourse.julialang.org/t/numerical-integration-of-vector-valued-functions-using-julia-packages/85413)

<div class="topic-metadata">

**Author:** [@danrib07](https://discourse.julialang.org/u/danrib07)\
**Replies:** 3\
**Last updated:** [August 6, 2022, 10:26pm UTC](https://discourse.julialang.org/t/numerical-integration-of-vector-valued-functions-using-julia-packages/85413 "2022-08-06T22:26:32Z")

</div>

Hi, I need to compute the following integral \\int\_{0}^{t} e^{At'}b \\,dt' where A is a real-valued matrix of size (m x m), and b is a real-valued column vector of size (m x 1). The current method I have implemented to c…

---

## [LaTeX Support for Julia Discourse?](https://discourse.julialang.org/t/latex-support-for-julia-discourse/85411)

<div class="topic-metadata">

**Author:** [@danrib07](https://discourse.julialang.org/u/danrib07)\
**Replies:** 3\
**Last updated:** [August 6, 2022, 9:38pm UTC](https://discourse.julialang.org/t/latex-support-for-julia-discourse/85411 "2022-08-06T21:38:44Z")

</div>

Hi everyone, I was wondering if there is some sort of LaTeX support that works with this Discourse? For example, I would like to write \\Delta and have Δ rendered. Any suggestions/comments are greatly appreciated.

---

## [Grouped Data Frame -- Two different types](https://discourse.julialang.org/t/grouped-data-frame-two-different-types/85404)

<div class="topic-metadata">

**Author:** [@Snowy](https://discourse.julialang.org/u/Snowy)\
**Replies:** 3\
**Last updated:** [August 6, 2022, 8:47pm UTC](https://discourse.julialang.org/t/grouped-data-frame-two-different-types/85404 "2022-08-06T20:47:21Z")

</div>

Hi! I have two different implementations of grouping dataframes, but I’m trying to determine why they are different types. Here is my code: using CSV using DataFrames timeseries = CSV.read("link to data file (see bel…

---

## [Significant CUDA.jl memory allocations outside of main pool?](https://discourse.julialang.org/t/significant-cuda-jl-memory-allocations-outside-of-main-pool/59991)

<div class="topic-metadata">

**Author:** [@jpdoane](https://discourse.julialang.org/u/jpdoane)\
**Replies:** 2\
**Last updated:** [August 6, 2022, 7:35pm UTC](https://discourse.julialang.org/t/significant-cuda-jl-memory-allocations-outside-of-main-pool/59991 "2022-08-06T19:35:53Z")

</div>

I have been benchmarking various CUDA.jl kernels with large CuArrays, and have been experiencing out of GPU memory errors after running the same function repeatedly. CUDA.jl seems to be holding onto significant amounts o…

---

## [Puzzled by (abstract) NTuple conversion](https://discourse.julialang.org/t/puzzled-by-abstract-ntuple-conversion/8286)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 0\
**Last updated:** [January 11, 2018, 10:25am UTC](https://discourse.julialang.org/t/puzzled-by-abstract-ntuple-conversion/8286 "2018-01-11T10:25:50Z")

</div>

Is this expected? julia\> convert(NTuple{2,T} where T\<:AbstractFloat, (1, Float16(2.0))) (1.0, Float16(2.0)) julia\> ans isa NTuple{2,T} where T\<:AbstractFloat false I was under the impression that convert offered a gua…

---

## [\[ANN\] NTupleKmers.jl](https://discourse.julialang.org/t/ann-ntuplekmers-jl/40474)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 0\
**Last updated:** [May 30, 2020, 4:09pm UTC](https://discourse.julialang.org/t/ann-ntuplekmers-jl/40474 "2020-05-30T16:09:20Z")

</div>

Hi Everyone, Following my earlier murmerings on Kmers and NTuples on Slack and here: Ntuple aggressive specialisation and boxed values I decided to create an experimental package repo on BioJulia that can house my NTu…

---

## [Why is there an allocation?](https://discourse.julialang.org/t/why-is-there-an-allocation/85405)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 12\
**Last updated:** [August 6, 2022, 7:00pm UTC](https://discourse.julialang.org/t/why-is-there-an-allocation/85405 "2022-08-06T19:00:30Z")

</div>

module mbas001 elxs = fill(Matrix{Float64}(undef, 3, 3), 7) for \_i in eachindex(elxs) elxs\[\_i\] = rand(3, 3) end ex = fill(zero(Float64), 3, 3) copy2ex!(ex, elxs, j, k) = let elxsc = elxs\[c\] for \_i in axes(ex…

---

## [Slower with threads](https://discourse.julialang.org/t/slower-with-threads/84600)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 26\
**Last updated:** [August 6, 2022, 5:46pm UTC](https://discourse.julialang.org/t/slower-with-threads/84600 "2022-08-06T17:46:22Z")

</div>

Hello everybody! My actual code takes 16 hours. So I went to learn Parallelism. I started with @task and the execution time went down to 10 hours. Very good! As I have a server with 64 cores, I thought about using @threa…

---

## [Numerical Maximum Entropy... suggested method / Optimization & Integration packages?](https://discourse.julialang.org/t/numerical-maximum-entropy-suggested-method-optimization-integration-packages/85367)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 4\
**Last updated:** [August 6, 2022, 5:26pm UTC](https://discourse.julialang.org/t/numerical-maximum-entropy-suggested-method-optimization-integration-packages/85367 "2022-08-06T17:26:22Z")

</div>

So I’m interested in finding an approximate maximum entropy distribution for a positive quantity with a given mean and a given mean absolute difference between two randomly chosen values (it’s related to the Gini coeffic…

---

## [How to see where a symbol is defined](https://discourse.julialang.org/t/how-to-see-where-a-symbol-is-defined/85406)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 2\
**Last updated:** [August 6, 2022, 5:03pm UTC](https://discourse.julialang.org/t/how-to-see-where-a-symbol-is-defined/85406 "2022-08-06T17:03:37Z")

</div>

If I have the file function f end f(x) = x f() = 5 I can use methods to find the method definitions on lines 3 and 4, but how can I find the function declaration on line 1?

---

## [Shortcut if isnothing(variable = match(...))](https://discourse.julialang.org/t/shortcut-if-isnothing-variable-match/85390)

<div class="topic-metadata">

**Author:** [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)\
**Replies:** 3\
**Last updated:** [August 6, 2022, 4:04pm UTC](https://discourse.julialang.org/t/shortcut-if-isnothing-variable-match/85390 "2022-08-06T16:04:23Z")

</div>

Hi all, does it exist a shorter syntax to write some like this: elseif !isnothing(m = match(...) .. use m rather than the more verbose and nested block: else m = match(...) if !isnothing(m) .. use m end…

---

## [Introduction to an educational project](https://discourse.julialang.org/t/introduction-to-an-educational-project/85402)

<div class="topic-metadata">

**Author:** [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Replies:** 0\
**Last updated:** [August 6, 2022, 3:03pm UTC](https://discourse.julialang.org/t/introduction-to-an-educational-project/85402 "2022-08-06T15:03:26Z")

</div>

\[TOC\] Guide This project aims to help users (mainly non-English-native-speakers) better learn, use and develop julialang and its community. You can find github org here. You can find status here (google-translate may …

---

## [Can someone review my Julia notebook](https://discourse.julialang.org/t/can-someone-review-my-julia-notebook/85396)

<div class="topic-metadata">

**Author:** [@purport](https://discourse.julialang.org/u/purport)\
**Replies:** 2\
**Last updated:** [August 6, 2022, 3:08pm UTC](https://discourse.julialang.org/t/can-someone-review-my-julia-notebook/85396 "2022-08-06T15:08:18Z")

</div>

Hi, I’ve been learning Julia for a few weeks off and on, and reading the David Mac Kay book at the same time. I was wondering if some of you could review my notebook here https://purport.neocities.org/hamming.html Curre…

---

## [How to convert Matrix of Ints into image](https://discourse.julialang.org/t/how-to-convert-matrix-of-ints-into-image/85273)

<div class="topic-metadata">

**Author:** [@momo1](https://discourse.julialang.org/u/momo1)\
**Replies:** 12\
**Last updated:** [August 6, 2022, 3:04pm UTC](https://discourse.julialang.org/t/how-to-convert-matrix-of-ints-into-image/85273 "2022-08-06T15:04:51Z")

</div>

I have a matrix of Ints. I’m using it for semantic classification so each pixel is a groundtruth label value, e.g. (10,20)=3 where at coordinate 10,20 there is a pixel value 3 which is the class. This ground truth la…

---

## [One-line if-else statement with short-circuit evaluation](https://discourse.julialang.org/t/one-line-if-else-statement-with-short-circuit-evaluation/85399)

<div class="topic-metadata">

**Author:** [@tapyu](https://discourse.julialang.org/u/tapyu)\
**Replies:** 1\
**Last updated:** [August 6, 2022, 2:28pm UTC](https://discourse.julialang.org/t/one-line-if-else-statement-with-short-circuit-evaluation/85399 "2022-08-06T14:28:34Z")

</div>

In Unix shell scripts, we can do the following ❯ \[\[ -n $HOME \]\] && echo "true statement" || echo "else statement" true statement ❯ \[\[ -n $NOT\_A\_ENV \]\] && echo "true statement" || echo "else statement" else statement Ho…

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

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