# Latest

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

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

**Page:** 842

---

## [Reduce compilation time for long and nested tuples](https://discourse.julialang.org/t/reduce-compilation-time-for-long-and-nested-tuples/91392)

<div class="topic-metadata">

**Author:** [@osimonn](https://discourse.julialang.org/u/osimonn)\
**Replies:** 4\
**Last updated:** [December 9, 2022, 2:45am UTC](https://discourse.julialang.org/t/reduce-compilation-time-for-long-and-nested-tuples/91392 "2022-12-09T02:45:24Z")

</div>

Details: I am calling C functions and using C structures from Julia by using the Clang.jl to automate the wrapping process. In the C code, there are multiple arrays of one or more dimensions. In order to have a one-to-o…

---

## [Precompilation of Module](https://discourse.julialang.org/t/precompilation-of-module/91383)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 5\
**Last updated:** [December 9, 2022, 2:29am UTC](https://discourse.julialang.org/t/precompilation-of-module/91383 "2022-12-09T02:29:00Z")

</div>

I am working in VSC (Visual Studio Code) and added ModelingToolkit.jl to the packages. All went well, and then I typed using ModelingToolkit, and all was good. Then I went to a different window, and started up Julia on t…

---

## [Initiate multiple arrays from a set of names with comprehension](https://discourse.julialang.org/t/initiate-multiple-arrays-from-a-set-of-names-with-comprehension/91402)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 7\
**Last updated:** [December 8, 2022, 11:21pm UTC](https://discourse.julialang.org/t/initiate-multiple-arrays-from-a-set-of-names-with-comprehension/91402 "2022-12-08T23:21:29Z")

</div>

I’m trying to understand how to initiate multiple arrays from a set of names. To initiate a new vector I would do something like j = Vector{Float64}(undef,10) typeof(j) Vector{Float64} (alias for Array{Float64, 1}) b…

---

## [Save gif with a filename](https://discourse.julialang.org/t/save-gif-with-a-filename/91448)

<div class="topic-metadata">

**Author:** [@sky](https://discourse.julialang.org/u/sky)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 10:28pm UTC](https://discourse.julialang.org/t/save-gif-with-a-filename/91448 "2022-12-08T22:28:22Z")

</div>

Hi everyone! I’m looking at creating gif in this link https://docs.juliaplots.org/latest/animations/ and I’m wondering how to save gif with a filename without using @animate. For example, the following code would gen…

---

## [Help using Python in Julia with PythonCall and DLPack](https://discourse.julialang.org/t/help-using-python-in-julia-with-pythoncall-and-dlpack/91441)

<div class="topic-metadata">

**Author:** [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 9:27pm UTC](https://discourse.julialang.org/t/help-using-python-in-julia-with-pythoncall-and-dlpack/91441 "2022-12-08T21:27:27Z")

</div>

I am trying to utilize TorchIO on some Julia Arrays. I have gone with the combination of PythonCall.jl and DLPack.jl. Currently, the TorchIO augmentations work when the array is below a specific size, but fall apart afte…

---

## [How to take samples from a DataFrame that have an specific mean](https://discourse.julialang.org/t/how-to-take-samples-from-a-dataframe-that-have-an-specific-mean/91427)

<div class="topic-metadata">

**Author:** [@Juan\_Mac\_Donagh](https://discourse.julialang.org/u/Juan_Mac_Donagh)\
**Replies:** 12\
**Last updated:** [December 8, 2022, 7:48pm UTC](https://discourse.julialang.org/t/how-to-take-samples-from-a-dataframe-that-have-an-specific-mean/91427 "2022-12-08T19:48:10Z")

</div>

Hi all. I was wondering what was the most efficient way to perform this task: I have a big DataFrame, and I need to take random samples (this is the easy part). But I need that the columns of the samples match the mean …

---

## [Matrix product \`M \* transpose(M)\`](https://discourse.julialang.org/t/matrix-product-m-transpose-m/61212)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 10\
**Last updated:** [December 8, 2022, 6:02pm UTC](https://discourse.julialang.org/t/matrix-product-m-transpose-m/61212 "2022-12-08T18:02:45Z")

</div>

Hello, Is there a function in Julia to efficiently compute the matrix product M \* transpose(M)? This matrix is symmetric, so there should be a more efficient way than doing M \* transpose(M). In R one can use the tcross…

---

## [How to ignore unnecessary function arguments?](https://discourse.julialang.org/t/how-to-ignore-unnecessary-function-arguments/91440)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 7:26pm UTC](https://discourse.julialang.org/t/how-to-ignore-unnecessary-function-arguments/91440 "2022-12-08T19:26:18Z")

</div>

\# Hello, i have any structures with kwargs, like this Base.@kwdef struct Foo a b c end # and i have any named tuples like this nt = (a=1, b=2, c=3, d=4, e=5, f=6, g=7) # ... # always : issubset(fieldnames(Foo), …

---

## [JuliaUserGroupMunich: Fall-in-love-with-julia 101 on Meta Programming](https://discourse.julialang.org/t/juliausergroupmunich-fall-in-love-with-julia-101-on-meta-programming/90746)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 4\
**Last updated:** [December 8, 2022, 7:04pm UTC](https://discourse.julialang.org/t/juliausergroupmunich-fall-in-love-with-julia-101-on-meta-programming/90746 "2022-12-08T19:04:37Z")

</div>

Join us on :spiral\_calendar: Monday 5. December 2022 :clock630: 18:30 CET organized via meetup Fall in love with Julia: Meta Programming 101 ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Meta programming is one of those dark magics…

---

## [How to easily troubleshoot type instability traps in complex code?](https://discourse.julialang.org/t/how-to-easily-troubleshoot-type-instability-traps-in-complex-code/91439)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 1\
**Last updated:** [December 8, 2022, 6:45pm UTC](https://discourse.julialang.org/t/how-to-easily-troubleshoot-type-instability-traps-in-complex-code/91439 "2022-12-08T18:45:16Z")

</div>

I know that type stability is very important in Julia, so how can I get a warning when there is a type change in my code? For example, I now have a very long code function f(x) that runs slowly, and I want to find out i…

---

## [JuMP: Constrain with quadratic equation](https://discourse.julialang.org/t/jump-constrain-with-quadratic-equation/91432)

<div class="topic-metadata">

**Author:** [@Gabsxk](https://discourse.julialang.org/u/Gabsxk)\
**Replies:** 3\
**Last updated:** [December 8, 2022, 6:36pm UTC](https://discourse.julialang.org/t/jump-constrain-with-quadratic-equation/91432 "2022-12-08T18:36:52Z")

</div>

How to solve a quadratic equation using JuMP? I was following the documentation, but the quadratic equations are not working.

---

## [Plotting each of the equations in an ODE system in a different figure window](https://discourse.julialang.org/t/plotting-each-of-the-equations-in-an-ode-system-in-a-different-figure-window/91404)

<div class="topic-metadata">

**Author:** [@jethro-djan](https://discourse.julialang.org/u/jethro-djan)\
**Replies:** 5\
**Last updated:** [December 8, 2022, 5:13pm UTC](https://discourse.julialang.org/t/plotting-each-of-the-equations-in-an-ode-system-in-a-different-figure-window/91404 "2022-12-08T17:13:00Z")

</div>

Hello everyone. I have solved a system of fractional ODEs using a tool I found on github and I want to plot it. The way I want to go about it is this: each solution in the system plotted against time and in different fi…

---

## [How can I save a data frame in a fits file?](https://discourse.julialang.org/t/how-can-i-save-a-data-frame-in-a-fits-file/91394)

<div class="topic-metadata">

**Author:** [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Replies:** 0\
**Last updated:** [December 7, 2022, 10:57pm UTC](https://discourse.julialang.org/t/how-can-i-save-a-data-frame-in-a-fits-file/91394 "2022-12-07T22:57:05Z")

</div>

How can I save a data frame in a fits file using FITSIO.jl or other package ? Thank you very much

---

## [\[ANN\] Mendeleev.jl - accessing chemical elements data](https://discourse.julialang.org/t/ann-mendeleev-jl-accessing-chemical-elements-data/89804)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 34\
**Last updated:** [December 8, 2022, 2:42pm UTC](https://discourse.julialang.org/t/ann-mendeleev-jl-accessing-chemical-elements-data/89804 "2022-12-08T14:42:42Z")

</div>

I am excited to announce Mendeleev - a database of chemical elements. The package is API compatible with the venerable PeriodicTable, but contains data on much more properties (about 100), including e.g. atomic and ionic…

---

## [Safe base64decode](https://discourse.julialang.org/t/safe-base64decode/91367)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 8\
**Last updated:** [December 8, 2022, 12:48pm UTC](https://discourse.julialang.org/t/safe-base64decode/91367 "2022-12-08T12:48:13Z")

</div>

I’d like to be able to base64decode a string without any risk of an ArgumentError("malformed base64 sequence") (see here). To that end, I can think of two main options: Make a safe version of the base64decode function …

---

## [Makie screen blanks after mouse click-drag](https://discourse.julialang.org/t/makie-screen-blanks-after-mouse-click-drag/15145)

<div class="topic-metadata">

**Author:** [@jac299792458](https://discourse.julialang.org/u/jac299792458)\
**Replies:** 3\
**Last updated:** [September 19, 2018, 3:14pm UTC](https://discourse.julialang.org/t/makie-screen-blanks-after-mouse-click-drag/15145 "2018-09-19T15:14:37Z")

</div>

All, Has anyone encountered their scene going blank when the mouse click and drag? It’s inconsistent for me, and doesn’t spit out any error messages. There might be a correlation between the error and part of the scen…

---

## [Selecting specific group in a multiagent simulation with agents.jl](https://discourse.julialang.org/t/selecting-specific-group-in-a-multiagent-simulation-with-agents-jl/91421)

<div class="topic-metadata">

**Author:** [@indymnv](https://discourse.julialang.org/u/indymnv)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 11:32am UTC](https://discourse.julialang.org/t/selecting-specific-group-in-a-multiagent-simulation-with-agents-jl/91421 "2022-12-08T11:32:11Z")

</div>

Hello people! I am building a simulation model with agents.jl of a city where any moment, there is an area that can be affected by an emergency with a specific probability, so if this is the case, I want to move an ambul…

---

## [How to Fill Area between y-axis and the curve $x^{2}$ correctly?](https://discourse.julialang.org/t/how-to-fill-area-between-y-axis-and-the-curve-x-2-correctly/91417)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 11:27am UTC](https://discourse.julialang.org/t/how-to-fill-area-between-y-axis-and-the-curve-x-2-correctly/91417 "2022-12-08T11:27:47Z")

</div>

Hi all, I want to recreate this plot. My code currently create this far away from the desired plot: using Plots, LaTeXStrings, Plots.PlotMeasures gr() f(x) = x^(2) plot(f, ylims= (0,33), xlims=(-2,10), framestyle=…

---

## [Agents.jl: subset object returned from nearby\_positions](https://discourse.julialang.org/t/agents-jl-subset-object-returned-from-nearby-positions/91399)

<div class="topic-metadata">

**Author:** [@sea\_slug](https://discourse.julialang.org/u/sea_slug)\
**Replies:** 1\
**Last updated:** [December 8, 2022, 11:10am UTC](https://discourse.julialang.org/t/agents-jl-subset-object-returned-from-nearby-positions/91399 "2022-12-08T11:10:57Z")

</div>

I am making a predator-prey model, following the wolf-sheep example using Agents.jl. Following on from this question, instead of sheep moving to a random cell I am trying to make the sheep move to a cell that contains g…

---

## [Findfirst with dates](https://discourse.julialang.org/t/findfirst-with-dates/91419)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 1\
**Last updated:** [December 8, 2022, 9:51am UTC](https://discourse.julialang.org/t/findfirst-with-dates/91419 "2022-12-08T09:51:55Z")

</div>

The following script throws an error, and I wonder what the correct syntax is for achieving what I want: id\_date = findfirst(market\_days\_all, market\_day) ERROR: MethodError: no method matching findfirst(::Vector{Date},…

---

## [Where do I find the GTK widget properties?](https://discourse.julialang.org/t/where-do-i-find-the-gtk-widget-properties/80299)

<div class="topic-metadata">

**Author:** [@Rossati](https://discourse.julialang.org/u/Rossati)\
**Replies:** 5\
**Last updated:** [December 8, 2022, 8:56am UTC](https://discourse.julialang.org/t/where-do-i-find-the-gtk-widget-properties/80299 "2022-12-08T08:56:03Z")

</div>

Hi I started using Julia to build a form generator by GTK and I haven’t find a list of widget properties so, for example, for set the button width. I have tried this: function createButton(caption,width) btn = …

---

## [Variable time-stepping and discontinuous gradients](https://discourse.julialang.org/t/variable-time-stepping-and-discontinuous-gradients/91382)

<div class="topic-metadata">

**Author:** [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Replies:** 4\
**Last updated:** [December 8, 2022, 8:39am UTC](https://discourse.julialang.org/t/variable-time-stepping-and-discontinuous-gradients/91382 "2022-12-08T08:39:07Z")

</div>

I read here that in the context of “trajectory optimisation” or “optimal control”: One very important idea in numerical integration of differential equations is the use of variable-step integration … We typically avoid…

---

## [Relative text position in Makie in log scale](https://discourse.julialang.org/t/relative-text-position-in-makie-in-log-scale/91393)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 7:43am UTC](https://discourse.julialang.org/t/relative-text-position-in-makie-in-log-scale/91393 "2022-12-08T07:43:13Z")

</div>

I want to specify the position of the text relative to the axis. I tried the following: fig = Figure() ax1 = Axis(fig\[1,1\], xscale=log10, yscale=log10) text!(ax1, 0.1, 0.9, text="testing", align=(:left, :top), space=:r…

---

## [Julia 1.8.2 message ERROR: LoadError: too many parameters for type](https://discourse.julialang.org/t/julia-1-8-2-message-error-loaderror-too-many-parameters-for-type/91330)

<div class="topic-metadata">

**Author:** [@mmv](https://discourse.julialang.org/u/mmv)\
**Replies:** 4\
**Last updated:** [December 8, 2022, 2:47am UTC](https://discourse.julialang.org/t/julia-1-8-2-message-error-loaderror-too-many-parameters-for-type/91330 "2022-12-08T02:47:16Z")

</div>

Hi! The header file (.h) of a C shared library contains the following declaration: typedef struct { int path; /\*\*\< MISR path number \*/ long long projcode; /\*\*\< GCTP projection code \*/ long long zonecode; /\*\*\< …

---

## [Arpeggeo® Technologies](https://discourse.julialang.org/t/arpeggeo-technologies/90111)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 4\
**Last updated:** [December 8, 2022, 1:32am UTC](https://discourse.julialang.org/t/arpeggeo-technologies/90111 "2022-12-08T01:32:35Z")

</div>

I’m super excited to announce Arpeggeo®, the tech company I’ve founded after years of academic work to bridge industrial challenges in mining, energy and agriculture with our state-of-the-art GeoStats.jl technology. We …

---

## [InvalidIRError with CuArray broadcast when complex values are involved in Bessel functions](https://discourse.julialang.org/t/invalidirerror-with-cuarray-broadcast-when-complex-values-are-involved-in-bessel-functions/91312)

<div class="topic-metadata">

**Author:** [@jinml](https://discourse.julialang.org/u/jinml)\
**Replies:** 2\
**Last updated:** [December 8, 2022, 12:47am UTC](https://discourse.julialang.org/t/invalidirerror-with-cuarray-broadcast-when-complex-values-are-involved-in-bessel-functions/91312 "2022-12-08T00:47:51Z")

</div>

Hi, I’m receiving runtime errors from julia when playing with the following simple code \> \> julia\> using CUDA, SpecialFunctions \> \> julia\> function cutest(x::Float64,f::Float64) \> c=besselj0(f); \> return…

---

## [What @named mean](https://discourse.julialang.org/t/what-named-mean/91375)

<div class="topic-metadata">

**Author:** [@AlexFreik](https://discourse.julialang.org/u/AlexFreik)\
**Replies:** 11\
**Last updated:** [December 8, 2022, 12:16am UTC](https://discourse.julialang.org/t/what-named-mean/91375 "2022-12-08T00:16:13Z")

</div>

Again and again I see syntax with @named, for example @named source = Voltage() What does it mean? What @ mean in jullia? Thanks! Sorry if question is obvious, but after 30 mins of googling I still cant figure out ;( …

---

## [Expected Performance of Julia within a Spark Environment?](https://discourse.julialang.org/t/expected-performance-of-julia-within-a-spark-environment/91377)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 7\
**Last updated:** [December 7, 2022, 10:26pm UTC](https://discourse.julialang.org/t/expected-performance-of-julia-within-a-spark-environment/91377 "2022-12-07T22:26:28Z")

</div>

Hey folks, I need some help on answering a question I was posed: Assuming an algorithm is written in R or Python with some attempt to leverage the optomizations available in a Spark environment for parallelization etc…

---

## [How to drop the Z-dim of a shape file](https://discourse.julialang.org/t/how-to-drop-the-z-dim-of-a-shape-file/91390)

<div class="topic-metadata">

**Author:** [@luraess](https://discourse.julialang.org/u/luraess)\
**Replies:** 1\
**Last updated:** [December 7, 2022, 10:20pm UTC](https://discourse.julialang.org/t/how-to-drop-the-z-dim-of-a-shape-file/91390 "2022-12-07T22:20:46Z")

</div>

I would like to rasterise and draw border of a polygon from a Shapefile as in this example from Rasters.jl. I load my Shapefile as following julia\> vd\_bord = Shapefile.Handle("data/Shapefiles/Vaud.shp").shapes\[1\] Shape…

---

## [Plot a line between two points](https://discourse.julialang.org/t/plot-a-line-between-two-points/91391)

<div class="topic-metadata">

**Author:** [@sky](https://discourse.julialang.org/u/sky)\
**Replies:** 4\
**Last updated:** [December 7, 2022, 9:10pm UTC](https://discourse.julialang.org/t/plot-a-line-between-two-points/91391 "2022-12-07T21:10:11Z")

</div>

Hi everyone! I’m trying to plot a line segment between two points, for example (1,2) and (2,3). I did plot(\[1.0 2.0\],\[2.0 3.0\], linewidth=2,legend=:false) However, nothing showed up. I’m using Julia 1.6.7.

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

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