# Latest

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

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

**Page:** 882

---

## [ModelingToolkit - the concept of "state"](https://discourse.julialang.org/t/modelingtoolkit-the-concept-of-state/89304)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [October 28, 2022, 8:07am UTC](https://discourse.julialang.org/t/modelingtoolkit-the-concept-of-state/89304 "2022-10-28T08:07:53Z")

</div>

I’m a little confused about the use of the word “state” (not only in ModelingToolkit). In classic dynamic systems theory, the state is the minimum information necessary to describe current time of a dynamic system, so th…

---

## [Makie: Colouring 3D Contours by another Array](https://discourse.julialang.org/t/makie-colouring-3d-contours-by-another-array/88829)

<div class="topic-metadata">

**Author:** [@Whyborn](https://discourse.julialang.org/u/Whyborn)\
**Replies:** 9\
**Last updated:** [October 28, 2022, 7:18am UTC](https://discourse.julialang.org/t/makie-colouring-3d-contours-by-another-array/88829 "2022-10-28T07:18:26Z")

</div>

I would like to build a 3D contour plot, with the contours constructed based on a given array and the colours on said contours defined by a second array. An example relevant to me is the Inviscid Taylor-Green Vortex: us…

---

## [Switching data type in a vector](https://discourse.julialang.org/t/switching-data-type-in-a-vector/89423)

<div class="topic-metadata">

**Author:** [@Phuntsho](https://discourse.julialang.org/u/Phuntsho)\
**Replies:** 2\
**Last updated:** [October 28, 2022, 7:08am UTC](https://discourse.julialang.org/t/switching-data-type-in-a-vector/89423 "2022-10-28T07:08:33Z")

</div>

I have a vector V::Vector{Tuple{Int64, Int64}} but sometimes one of the second entries becomes Float64. I don’t want to make it V::Vector{Tuple{Int64, Float64}} or V::Vector{Tuple{Int64, Any}} for performance. Is there a…

---

## [Can typeof() return an alias?](https://discourse.julialang.org/t/can-typeof-return-an-alias/89412)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 4\
**Last updated:** [October 28, 2022, 6:58am UTC](https://discourse.julialang.org/t/can-typeof-return-an-alias/89412 "2022-10-28T06:58:11Z")

</div>

Is it possible to have a type alias where typeof() returns the alias rather than the base type e.g. XString = String x::XString = "ab" typeof(x) # gives XString not String Use Case The below code produc…

---

## [Recording an 3d mesh animation, not updating between frames](https://discourse.julialang.org/t/recording-an-3d-mesh-animation-not-updating-between-frames/89428)

<div class="topic-metadata">

**Author:** [@m\_x155](https://discourse.julialang.org/u/m_x155)\
**Replies:** 1\
**Last updated:** [October 28, 2022, 6:19am UTC](https://discourse.julialang.org/t/recording-an-3d-mesh-animation-not-updating-between-frames/89428 "2022-10-28T06:19:01Z")

</div>

Hi, I have some results from a simulation that represent a 3d surface object moving in time. When I try to record the mesh much like the example in the documentation I don’t seem to get the plot actually updating. It dis…

---

## [Mosaic plot in Makie](https://discourse.julialang.org/t/mosaic-plot-in-makie/89425)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [October 28, 2022, 5:25am UTC](https://discourse.julialang.org/t/mosaic-plot-in-makie/89425 "2022-10-28T05:25:03Z")

</div>

Does Makie have Mosaic plots?

---

## [How to capture stdout from one Thread?](https://discourse.julialang.org/t/how-to-capture-stdout-from-one-thread/45812)

<div class="topic-metadata">

**Author:** [@danspielman](https://discourse.julialang.org/u/danspielman)\
**Replies:** 5\
**Last updated:** [October 28, 2022, 4:25am UTC](https://discourse.julialang.org/t/how-to-capture-stdout-from-one-thread/45812 "2022-10-28T04:25:27Z")

</div>

I would like to capture the stdout from one thread out of many that are running, and save it in a string. Does anyone know how to do this thread-by-thread? I can at least know the id of the thread I care about. redire…

---

## [Understanding type instability related to StructArrays](https://discourse.julialang.org/t/understanding-type-instability-related-to-structarrays/89413)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 1\
**Last updated:** [October 28, 2022, 1:39am UTC](https://discourse.julialang.org/t/understanding-type-instability-related-to-structarrays/89413 "2022-10-28T01:39:41Z")

</div>

A minimun example in REPL: julia\> using StructArrays julia\> mutable struct Foo foo::Int end julia\> mutable struct Bar bar::StructArray{Foo} end julia\> bar = Bar(StructArray(\[Foo(1)…

---

## [Flux Chain function](https://discourse.julialang.org/t/flux-chain-function/89369)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 11:12pm UTC](https://discourse.julialang.org/t/flux-chain-function/89369 "2022-10-27T23:12:03Z")

</div>

Why does the Chain function not warn if the output of one layer is not compatible with the imput of the next?

---

## [IJulia, WGLMakie, and JupyterLab: No output](https://discourse.julialang.org/t/ijulia-wglmakie-and-jupyterlab-no-output/70467)

<div class="topic-metadata">

**Author:** [@Ludovic\_Dumoulin](https://discourse.julialang.org/u/Ludovic_Dumoulin)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 9:45pm UTC](https://discourse.julialang.org/t/ijulia-wglmakie-and-jupyterlab-no-output/70467 "2022-10-27T21:45:32Z")

</div>

Hello, I am using IJulia and WGLMakie, and I’d like to make interactive plot. Unfortunately when I run this code in a cell, there is no output… Nz = 100 Nt = 10 ρ\_t = rand(Nz, Nt) using Makie: Slider using WGLMakie WG…

---

## [Is there way to do math on type parameters for function defintions](https://discourse.julialang.org/t/is-there-way-to-do-math-on-type-parameters-for-function-defintions/89400)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 2\
**Last updated:** [October 27, 2022, 9:16pm UTC](https://discourse.julialang.org/t/is-there-way-to-do-math-on-type-parameters-for-function-defintions/89400 "2022-10-27T21:16:53Z")

</div>

I would like to do something like this, pt\_to\_line\_dist(x::SVector{N-1},l::SVector{N}) where N \<: UInt = print("hi") Is it possible?

---

## [Scaled FFT implementation seems to only use one thread despite setting no. of threads to 8](https://discourse.julialang.org/t/scaled-fft-implementation-seems-to-only-use-one-thread-despite-setting-no-of-threads-to-8/89396)

<div class="topic-metadata">

**Author:** [@Thaegy](https://discourse.julialang.org/u/Thaegy)\
**Replies:** 2\
**Last updated:** [October 27, 2022, 8:06pm UTC](https://discourse.julialang.org/t/scaled-fft-implementation-seems-to-only-use-one-thread-despite-setting-no-of-threads-to-8/89396 "2022-10-27T20:06:33Z")

</div>

Hi there, I have been trying to implement a form of the scaled FFT for use in optical propagation. The code was also rewritten in MATLAB to act as a comparison. My Julia implementation seems much slower than what I was …

---

## [Anyone fetching UUIDs using LibPQ.jl?](https://discourse.julialang.org/t/anyone-fetching-uuids-using-libpq-jl/89395)

<div class="topic-metadata">

**Author:** [@iamed2](https://discourse.julialang.org/u/iamed2)\
**Replies:** 2\
**Last updated:** [October 27, 2022, 8:40pm UTC](https://discourse.julialang.org/t/anyone-fetching-uuids-using-libpq-jl/89395 "2022-10-27T20:40:26Z")

</div>

I’m introducing support for parsing UUIDs from PostgreSQL in LibPQ.jl and I would like to know if anyone would be negatively impacted by setting UUID as the default type for the PostgreSQL uuid type. This means that if y…

---

## [How can I visualize the data of a sparse matrix using a vector](https://discourse.julialang.org/t/how-can-i-visualize-the-data-of-a-sparse-matrix-using-a-vector/89394)

<div class="topic-metadata">

**Author:** [@thiagoselias](https://discourse.julialang.org/u/thiagoselias)\
**Replies:** 2\
**Last updated:** [October 27, 2022, 8:24pm UTC](https://discourse.julialang.org/t/how-can-i-visualize-the-data-of-a-sparse-matrix-using-a-vector/89394 "2022-10-27T20:24:43Z")

</div>

The way I’m doing it, the index values appear all mixed up in the code: EX: v = matopen(“index.mat”); index= read(v, “v”); close(v); x = (list\[index\])

---

## [The huge difference of two functions for the same goal inside and outside of function](https://discourse.julialang.org/t/the-huge-difference-of-two-functions-for-the-same-goal-inside-and-outside-of-function/89389)

<div class="topic-metadata">

**Author:** [@swish47](https://discourse.julialang.org/u/swish47)\
**Replies:** 5\
**Last updated:** [October 27, 2022, 8:22pm UTC](https://discourse.julialang.org/t/the-huge-difference-of-two-functions-for-the-same-goal-inside-and-outside-of-function/89389 "2022-10-27T20:22:49Z")

</div>

There are two functions for computing the same array. However, there is a weird thing on time elapse. Inside function: using FLoops ot=collect(range(start=-3,length=3600\*4,stop=3)); st=rand(1000000); sgf::Vector{Comple…

---

## [How do you export a binary operator from a module?](https://discourse.julialang.org/t/how-do-you-export-a-binary-operator-from-a-module/89376)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 2\
**Last updated:** [October 27, 2022, 8:01pm UTC](https://discourse.julialang.org/t/how-do-you-export-a-binary-operator-from-a-module/89376 "2022-10-27T20:01:37Z")

</div>

I have the following defined, homogenize(x) = push(x,one(eltype(x))) mixed\_matvec\_multiplication(A::AbstractArray,x::AbstractVector) = A\*homogenize(x) ⊛(A,x) = mixed\_matvec\_multiplication(A,x) I can’t seem to export …

---

## [Plotting on an unstructured grid](https://discourse.julialang.org/t/plotting-on-an-unstructured-grid/89316)

<div class="topic-metadata">

**Author:** [@HMegh](https://discourse.julialang.org/u/HMegh)\
**Replies:** 2\
**Last updated:** [October 27, 2022, 6:53pm UTC](https://discourse.julialang.org/t/plotting-on-an-unstructured-grid/89316 "2022-10-27T18:53:38Z")

</div>

I have points \\{(x\_i,y\_i)\\}\_{i=1}^n and values \\{z\_i\\}\_{i=1}^n and I wish to plot them as a surface plot. However, when using surface(x,y,z) I get the following error \*\*\* IDENTICAL DATA POINTS. NDP = 3772 IP1 =…

---

## [What does this code do?](https://discourse.julialang.org/t/what-does-this-code-do/89266)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 8\
**Last updated:** [October 27, 2022, 6:51pm UTC](https://discourse.julialang.org/t/what-does-this-code-do/89266 "2022-10-27T18:51:40Z")

</div>

I found this code recently. Does anybody know what it’s supposed to do? (zip()...,)

---

## [Getting UndefVarError even though variables are defined](https://discourse.julialang.org/t/getting-undefvarerror-even-though-variables-are-defined/89383)

<div class="topic-metadata">

**Author:** [@Max\_A](https://discourse.julialang.org/u/Max_A)\
**Replies:** 5\
**Last updated:** [October 27, 2022, 5:45pm UTC](https://discourse.julialang.org/t/getting-undefvarerror-even-though-variables-are-defined/89383 "2022-10-27T17:45:33Z")

</div>

Hi all, I am using the following code to solve an ODE. I defined my variables but I am still getting an UndefVarError. Any help here? v\_x(x, y, t) = -sin(pi \* y) \* cos(pi \* t / 5) v\_y(x, y, t) = sin(pi \* x) \* cos(pi …

---

## [Where is the compiled code? Does julia compile the code on every run with \`julia somescript.jl\`](https://discourse.julialang.org/t/where-is-the-compiled-code-does-julia-compile-the-code-on-every-run-with-julia-somescript-jl/89340)

<div class="topic-metadata">

**Author:** [@benibilme](https://discourse.julialang.org/u/benibilme)\
**Replies:** 6\
**Last updated:** [October 27, 2022, 6:16pm UTC](https://discourse.julialang.org/t/where-is-the-compiled-code-does-julia-compile-the-code-on-every-run-with-julia-somescript-jl/89340 "2022-10-27T18:16:37Z")

</div>

Hello, I am actually developer and pick up interest in julia and using it to refresh my algorithm and math skills. I am hard core vim user and I accustomed to write scripts, programs and compile them. I generally do n…

---

## [Plots.Surface rescaling gives incorrect color legend](https://discourse.julialang.org/t/plots-surface-rescaling-gives-incorrect-color-legend/89381)

<div class="topic-metadata">

**Author:** [@Grace\_Chuan](https://discourse.julialang.org/u/Grace_Chuan)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 5:42pm UTC](https://discourse.julialang.org/t/plots-surface-rescaling-gives-incorrect-color-legend/89381 "2022-10-27T17:42:47Z")

</div>

Hello, I am trying to plot a surface via Julia Plots. The maximum of the series I would like to plot along the z axis is 10. But I want the z axis to rescale to (0,20). When I add in the argument: zlim = (0,20), I get wh…

---

## [Is there a built-in function to get the size of a folder?](https://discourse.julialang.org/t/is-there-a-built-in-function-to-get-the-size-of-a-folder/76762)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 7\
**Last updated:** [October 27, 2022, 5:28pm UTC](https://discourse.julialang.org/t/is-there-a-built-in-function-to-get-the-size-of-a-folder/76762 "2022-10-27T17:28:02Z")

</div>

I saw that there are stat and filesize, but I don’t see a recursive option. Is there a small package or another function that can give me the cumulative size of all files in a folder? Another thing I am not sure about …

---

## [Flushing output for Logging immediately without buffering](https://discourse.julialang.org/t/flushing-output-for-logging-immediately-without-buffering/26800)

<div class="topic-metadata">

**Author:** [@scottstanie](https://discourse.julialang.org/u/scottstanie)\
**Replies:** 4\
**Last updated:** [October 26, 2022, 5:24pm UTC](https://discourse.julialang.org/t/flushing-output-for-logging-immediately-without-buffering/26800 "2022-10-26T17:24:26Z")

</div>

I’ve got a problem similar to this question: How to flush stdout where I want to log output from a long running script, usually to stderr, and check on it with tail -f If I run it and redirect the output to a file wit…

---

## [String questions](https://discourse.julialang.org/t/string-questions/89375)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 3\
**Last updated:** [October 27, 2022, 4:49pm UTC](https://discourse.julialang.org/t/string-questions/89375 "2022-10-27T16:49:47Z")

</div>

chr="ppp" pppfile="c:/Users/Dsektop/"\*chr\*".csv" I want to use chr to generate the “pppfile”.I tried like the following julia\> ($chr)file="c:/Users/Dsektop/"\*chr\*".csv" ERROR: syntax: extra token "file" after end of ex…

---

## [\[ANN\] SimpleQuantum: A package for calculating properties of solids + a tutorial blog on how to do these calculations in Julia](https://discourse.julialang.org/t/ann-simplequantum-a-package-for-calculating-properties-of-solids-a-tutorial-blog-on-how-to-do-these-calculations-in-julia/89075)

<div class="topic-metadata">

**Author:** [@tpolakovic](https://discourse.julialang.org/u/tpolakovic)\
**Replies:** 6\
**Last updated:** [October 27, 2022, 4:47pm UTC](https://discourse.julialang.org/t/ann-simplequantum-a-package-for-calculating-properties-of-solids-a-tutorial-blog-on-how-to-do-these-calculations-in-julia/89075 "2022-10-27T16:47:30Z")

</div>

SimpleQuantum is now available for easy-to-setup calculations of (for now just electronic) properties of solids. It provides ways to define and visualize crystal structures and a simple way to do common tasks, like calcu…

---

## [ModelingToolkit.jl ODEProblem throwing error when differential term not isolated to the LHS](https://discourse.julialang.org/t/modelingtoolkit-jl-odeproblem-throwing-error-when-differential-term-not-isolated-to-the-lhs/89365)

<div class="topic-metadata">

**Author:** [@ap2013](https://discourse.julialang.org/u/ap2013)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 4:36pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-odeproblem-throwing-error-when-differential-term-not-isolated-to-the-lhs/89365 "2022-10-27T16:36:59Z")

</div>

I am constructing an ODESystem by connecting 4 different systems. I recently changed one of the systems, I want it to be a 2-DOF planar arm with equations M(\\theta)\\ddot{\\theta} + C(\\theta,\\dot{\\theta})\\dot{\\theta} = u …

---

## [Plots Broken on Mac](https://discourse.julialang.org/t/plots-broken-on-mac/65551)

<div class="topic-metadata">

**Author:** [@RafGeo](https://discourse.julialang.org/u/RafGeo)\
**Replies:** 9\
**Last updated:** [August 11, 2021, 12:23am UTC](https://discourse.julialang.org/t/plots-broken-on-mac/65551 "2021-08-11T00:23:06Z")

</div>

After woking on my project i saved, quit everything and updated to the new version of Mac Big Sur 11.5.1. Once i got the next day Julia refused to plot anything. While in REPL, typing the command julia\> plot(collect(1:…

---

## [Soft constraints in JuMP](https://discourse.julialang.org/t/soft-constraints-in-jump/89373)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 4:04pm UTC](https://discourse.julialang.org/t/soft-constraints-in-jump/89373 "2022-10-27T16:04:14Z")

</div>

I am completely new to the JuMP.jl package. I am trying to set soft constraints with different weights but only getting errors for any constraints I set. I would like something similar to this link I have tried using…

---

## [Querying an LibSpatialIndex.jl RTree](https://discourse.julialang.org/t/querying-an-libspatialindex-jl-rtree/88916)

<div class="topic-metadata">

**Author:** [@ctrebbau](https://discourse.julialang.org/u/ctrebbau)\
**Replies:** 2\
**Last updated:** [October 27, 2022, 3:51pm UTC](https://discourse.julialang.org/t/querying-an-libspatialindex-jl-rtree/88916 "2022-10-27T15:51:42Z")

</div>

I have an OpenStreetMapX (mad) of Madrid and around 4 million coordinates that I wish to associate with their corresponding mad.nodes. Unfortunately using OpenStreetMapX.jl’s point\_to\_nodes out-of-the-box is infeasible …

---

## [Why are macros re-pre-compiled](https://discourse.julialang.org/t/why-are-macros-re-pre-compiled/89319)

<div class="topic-metadata">

**Author:** [@tfiers](https://discourse.julialang.org/u/tfiers)\
**Replies:** 4\
**Last updated:** [October 27, 2022, 3:39pm UTC](https://discourse.julialang.org/t/why-are-macros-re-pre-compiled/89319 "2022-10-27T15:39:26Z")

</div>

I am trying to improve load time of a package of mine. I found that a lot of this time was spent type-inferring macro-related functions, for example: Through using @match (Match.jl): Match.gen\_match\_expr(::String, :…

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

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