# Latest

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

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

**Page:** 1382

---

## [Promote field of abstract type](https://discourse.julialang.org/t/promote-field-of-abstract-type/61732)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 7\
**Last updated:** [May 25, 2021, 7:10am UTC](https://discourse.julialang.org/t/promote-field-of-abstract-type/61732 "2021-05-25T07:10:22Z")

</div>

I’d like to simplify the following code so that there is only one method for multiplication that applies to all subtypes of AbstractTerm abstract type AbstractTerm{T} end struct ATerm{T} \<: AbstractTerm{T} data::T …

---

## [How to make my Julia code fast like MATLAB?](https://discourse.julialang.org/t/how-to-make-my-julia-code-fast-like-matlab/61678)

<div class="topic-metadata">

**Author:** [@Kyle7](https://discourse.julialang.org/u/Kyle7)\
**Replies:** 19\
**Last updated:** [May 25, 2021, 7:03am UTC](https://discourse.julialang.org/t/how-to-make-my-julia-code-fast-like-matlab/61678 "2021-05-25T07:03:52Z")

</div>

Hi All, I am new to Julia and really struggling to understand what is making my code which convolutes a signal with a Gaussian or Lorentzian so slow. I have the equivilent MATLAB code that runs in 4 seconds when vectoris…

---

## [Implementing Singleton design pattern](https://discourse.julialang.org/t/implementing-singleton-design-pattern/61704)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 8\
**Last updated:** [May 25, 2021, 6:04am UTC](https://discourse.julialang.org/t/implementing-singleton-design-pattern/61704 "2021-05-25T06:04:03Z")

</div>

Hi. I’m having trouble trying to implement the Singleton design pattern. In Java or C++, I would use a static pointer to the single instance, but Julia doesn’t have static data that I’m aware of. So I tried using an exte…

---

## [Trying to understand the use of shared memory on GPUs](https://discourse.julialang.org/t/trying-to-understand-the-use-of-shared-memory-on-gpus/61240)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [May 25, 2021, 5:47am UTC](https://discourse.julialang.org/t/trying-to-understand-the-use-of-shared-memory-on-gpus/61240 "2021-05-25T05:47:38Z")

</div>

Hi, I’m trying to learn how to use shared memory on the GPU by following the very nice write-up in https://jenni-westoby.github.io/Julia\_GPU\_examples/dev/Vector\_dot\_product/ however, I fail to understand basic things …

---

## [Cxx.jl Compatability with Julia 1.5+](https://discourse.julialang.org/t/cxx-jl-compatability-with-julia-1-5/53782)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 7\
**Last updated:** [May 25, 2021, 4:57am UTC](https://discourse.julialang.org/t/cxx-jl-compatability-with-julia-1-5/53782 "2021-05-25T04:57:52Z")

</div>

The package Cxx.jl seems to be partially compatible with Julia 1.3, and not compatible with Julia 1.5+ (as referenced by this discourse post and #464). Does Julia 1.5 introduce permanent incompatibilities with a project…

---

## [JSON3.jl parse custom type with NaN](https://discourse.julialang.org/t/json3-jl-parse-custom-type-with-nan/61295)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 3\
**Last updated:** [May 25, 2021, 3:45am UTC](https://discourse.julialang.org/t/json3-jl-parse-custom-type-with-nan/61295 "2021-05-25T03:45:49Z")

</div>

The following works: struct Foo a::Vector{Float64} b::Float64 end JSON3.StructType(::Type{Foo}) = JSON3.Struct() str = JSON3.write(Foo(\[NaN, 2.3\], NaN), allow\_inf=true) JSON3.read(str, Foo, allow\_inf=true) Wi…

---

## [Fatal error while reading in messy data using DataFrames, CSV](https://discourse.julialang.org/t/fatal-error-while-reading-in-messy-data-using-dataframes-csv/61314)

<div class="topic-metadata">

**Author:** [@jessecm](https://discourse.julialang.org/u/jessecm)\
**Replies:** 6\
**Last updated:** [May 25, 2021, 3:28am UTC](https://discourse.julialang.org/t/fatal-error-while-reading-in-messy-data-using-dataframes-csv/61314 "2021-05-25T03:28:22Z")

</div>

Hi, while reading in a large, messy dataset, I got the message: using DataFrames, CSV, Random, Tables GBIF\_chordate = CSV.read("occurrence.txt", DataFrame; header = true); \*\*ERROR:\*\* thread = 1 fatal error, encountered …

---

## [Importing module in same file](https://discourse.julialang.org/t/importing-module-in-same-file/21724)

<div class="topic-metadata">

**Author:** [@yash](https://discourse.julialang.org/u/yash)\
**Replies:** 9\
**Last updated:** [May 25, 2021, 1:40am UTC](https://discourse.julialang.org/t/importing-module-in-same-file/21724 "2021-05-25T01:40:16Z")

</div>

How can I import a module in another module in same file in julia ??

---

## [PyJulia, passing numpy array from Python side](https://discourse.julialang.org/t/pyjulia-passing-numpy-array-from-python-side/45894)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 13\
**Last updated:** [May 25, 2021, 12:40am UTC](https://discourse.julialang.org/t/pyjulia-passing-numpy-array-from-python-side/45894 "2021-05-25T00:40:57Z")

</div>

I’m looking into extending Python with Julia code through PyJulia, particularly allocating numpy arrays in Python, passing them to Julia (without copying) to do some processing and then use the result in Python again. Th…

---

## [Reshaping ID and STatus by CATegory](https://discourse.julialang.org/t/reshaping-id-and-status-by-category/61716)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 2\
**Last updated:** [May 24, 2021, 7:55pm UTC](https://discourse.julialang.org/t/reshaping-id-and-status-by-category/61716 "2021-05-24T19:55:42Z")

</div>

I would like to see (some of) the different ways in which we can transform the following dataframe df=DataFrame(CAT=\["A","B","C","A","B","C","D","E","A","C","D"\], ID=\[1,1,1,2,2,2,2,2,3,3,3\], ST=\["q","q"…

---

## [Reading Multiple Files in a Folder Into a tensor in Julia](https://discourse.julialang.org/t/reading-multiple-files-in-a-folder-into-a-tensor-in-julia/61324)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 8\
**Last updated:** [May 24, 2021, 7:43pm UTC](https://discourse.julialang.org/t/reading-multiple-files-in-a-folder-into-a-tensor-in-julia/61324 "2021-05-24T19:43:04Z")

</div>

New to Julia and programming in general so this is a two part question. Suppose I have a Folder with 3,000 CSV files. Each file is roughly 7,000 x 7. (The number of rows may vary from file to file but the number of co…

---

## [\`convert\` vs constructor](https://discourse.julialang.org/t/convert-vs-constructor/61735)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 4\
**Last updated:** [May 24, 2021, 7:28pm UTC](https://discourse.julialang.org/t/convert-vs-constructor/61735 "2021-05-24T19:28:32Z")

</div>

Which is considered better Julia style, this: f(a::T) where{T\<:Number} = T(2) or this: f(a::T) where{T\<:Number} = convert(T,2) Or are they equivalent in practice?

---

## [Is \`BigFloat\` loss of precision intended?](https://discourse.julialang.org/t/is-bigfloat-loss-of-precision-intended/61728)

<div class="topic-metadata">

**Author:** [@MarcMush](https://discourse.julialang.org/u/MarcMush)\
**Replies:** 5\
**Last updated:** [May 24, 2021, 7:03pm UTC](https://discourse.julialang.org/t/is-bigfloat-loss-of-precision-intended/61728 "2021-05-24T19:03:06Z")

</div>

when doing any operation on a BigFloat, the precision of the result always reverts back to the default one, instead of getting it from the operands. Is this behavior intended and if yes, why ? julia\> a=BigFloat("1.1", …

---

## [\[ANN\] TerminalPager.jl v0.2.0](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 38\
**Last updated:** [May 24, 2021, 6:31pm UTC](https://discourse.julialang.org/t/ann-terminalpager-jl-v0-2-0/61616 "2021-05-24T18:31:27Z")

</div>

Hi! I just tagged a new version of TerminalPager.jl with minor updates. We have now two macros to help. The first one is called @dpr and can be used to access any documentation inside the pager: julia\> @dpr write T…

---

## [Difference between function that accepts abstract types and another that uses type parameters](https://discourse.julialang.org/t/difference-between-function-that-accepts-abstract-types-and-another-that-uses-type-parameters/61687)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 4\
**Last updated:** [May 24, 2021, 4:28pm UTC](https://discourse.julialang.org/t/difference-between-function-that-accepts-abstract-types-and-another-that-uses-type-parameters/61687 "2021-05-24T16:28:40Z")

</div>

Consider the following code: function do\_work(first::Number,second::Number) println("Working with $(typeof(first)) and $(typeof(second))") end function do\_work(first::A,second::B) where {A\<:Number, B\<:Number} …

---

## [Package updated but not available (12 hours latter)](https://discourse.julialang.org/t/package-updated-but-not-available-12-hours-latter/61718)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 13\
**Last updated:** [May 24, 2021, 4:20pm UTC](https://discourse.julialang.org/t/package-updated-but-not-available-12-hours-latter/61718 "2021-05-24T16:20:33Z")

</div>

Yesterday I released a new patch version of a package. It is still not available here for update. (@v1.6) pkg\> up ComplexMixtures Updating registry at \`~/.julia/registries/General\` No Changes to \`~/.julia/environm…

---

## [How to implement a real time DAE solver](https://discourse.julialang.org/t/how-to-implement-a-real-time-dae-solver/61719)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 12\
**Last updated:** [May 24, 2021, 4:13pm UTC](https://discourse.julialang.org/t/how-to-implement-a-real-time-dae-solver/61719 "2021-05-24T16:13:27Z")

</div>

I have the following solver: differential\_vars = ones(Bool, 36) prob = DAEProblem(residual!, yd0, y0, tspan, differential\_vars=differential\_vars) solver = IDA(linear\_solver=:Dense) @time sol = solve(prob, solver, save…

---

## [Problems with environment - Tree Hash Mismatch!](https://discourse.julialang.org/t/problems-with-environment-tree-hash-mismatch/60103)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 23\
**Last updated:** [May 24, 2021, 3:44pm UTC](https://discourse.julialang.org/t/problems-with-environment-tree-hash-mismatch/60103 "2021-05-24T15:44:29Z")

</div>

I have a Julia project on my machine, and I then run the project on a different machine (cluster). To do that I copy the relevant files including the Project.toml, manifest.toml files. I included the package JLD2, and r…

---

## [Plot the Theodorus Spiral with Plots](https://discourse.julialang.org/t/plot-the-theodorus-spiral-with-plots/61720)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 2\
**Last updated:** [May 24, 2021, 2:30pm UTC](https://discourse.julialang.org/t/plot-the-theodorus-spiral-with-plots/61720 "2021-05-24T14:30:40Z")

</div>

Tried to reproduce the following code from the link in Julia But I can’t configure the graphics part correctly. I show you where I have been: #https://theredforgepublishinghouse.com/learn-maths-with-the-theodorus-spir…

---

## [Plotting a closed curve in 3D](https://discourse.julialang.org/t/plotting-a-closed-curve-in-3d/61691)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [May 24, 2021, 2:23pm UTC](https://discourse.julialang.org/t/plotting-a-closed-curve-in-3d/61691 "2021-05-24T14:23:06Z")

</div>

How do you plot a closed curve in Julia? For instance using Plots.jl. I would like to draw an ellipse into a 3-dimensional plot.

---

## [How to cite Julia in publications?](https://discourse.julialang.org/t/how-to-cite-julia-in-publications/23060)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 14\
**Last updated:** [May 24, 2021, 1:49pm UTC](https://discourse.julialang.org/t/how-to-cite-julia-in-publications/23060 "2021-05-24T13:49:30Z")

</div>

What is the proper citation for Julia itself? julialang.org? Or one of the foundational articles?

---

## [Macro capturing intermediate values](https://discourse.julialang.org/t/macro-capturing-intermediate-values/61715)

<div class="topic-metadata">

**Author:** [@MeinAccount](https://discourse.julialang.org/u/MeinAccount)\
**Replies:** 0\
**Last updated:** [May 24, 2021, 10:15am UTC](https://discourse.julialang.org/t/macro-capturing-intermediate-values/61715 "2021-05-24T10:15:30Z")

</div>

I just wanted to show of a fun little macro I wrote. Doing a course on stochastic simulation, I’m writing small functions that simulate some process. For performance reasons I don’t want to emit all the intermediate valu…

---

## [Transforming dataframe columns selected via regex while keeping the other columns](https://discourse.julialang.org/t/transforming-dataframe-columns-selected-via-regex-while-keeping-the-other-columns/61702)

<div class="topic-metadata">

**Author:** [@anon71627001](https://discourse.julialang.org/u/anon71627001)\
**Replies:** 4\
**Last updated:** [May 24, 2021, 10:03am UTC](https://discourse.julialang.org/t/transforming-dataframe-columns-selected-via-regex-while-keeping-the-other-columns/61702 "2021-05-24T10:03:40Z")

</div>

Let’s say I have df = DataFrame(ax = 1:3, bx = 4:6, cy = 7:9, dy = 10:12) and want to double the values of each column that has an “x” in its header, while leaving the columns that don’t have an “x” in their header uncha…

---

## [Tagbot is not tagging releases automatically](https://discourse.julialang.org/t/tagbot-is-not-tagging-releases-automatically/61712)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [May 24, 2021, 9:49am UTC](https://discourse.julialang.org/t/tagbot-is-not-tagging-releases-automatically/61712 "2021-05-24T09:49:27Z")

</div>

In my package SphericalHarmonics.jl the tagbot has not been tagging releases. My TagBot.yml is name: TagBot on: issue\_comment: types: - created workflow\_dispatch: jobs: TagBot: if: github.event\_name …

---

## [Reading in xlsx with multiple header rows using the XLSX Pkg](https://discourse.julialang.org/t/reading-in-xlsx-with-multiple-header-rows-using-the-xlsx-pkg/61594)

<div class="topic-metadata">

**Author:** [@kbot](https://discourse.julialang.org/u/kbot)\
**Replies:** 2\
**Last updated:** [May 24, 2021, 8:46am UTC](https://discourse.julialang.org/t/reading-in-xlsx-with-multiple-header-rows-using-the-xlsx-pkg/61594 "2021-05-24T08:46:30Z")

</div>

I’m attempting to use API Reference · XLSX.jl to (called from a custom wrapper tool) to read in an excel workbook and create a dataframe. However, the header is split across the top two rows → is there an alternative pa…

---

## [SDDiP: Could not solve for Lagrangian duals. Iteration limit exceeded](https://discourse.julialang.org/t/sddip-could-not-solve-for-lagrangian-duals-iteration-limit-exceeded/61673)

<div class="topic-metadata">

**Author:** [@BYS](https://discourse.julialang.org/u/BYS)\
**Replies:** 5\
**Last updated:** [May 24, 2021, 8:44am UTC](https://discourse.julialang.org/t/sddip-could-not-solve-for-lagrangian-duals-iteration-limit-exceeded/61673 "2021-05-24T08:44:09Z")

</div>

I have tried a SDDP model including integer using “integrality\_handler=SDDP.SDDiP()”, and I set SDDP.train(model; iteration\_limit = 10) The results are as follows, ERROR: LoadError: Could not solve for Lagrangian dual…

---

## ["Next" and "Previous" Buttons in Pluto](https://discourse.julialang.org/t/next-and-previous-buttons-in-pluto/61363)

<div class="topic-metadata">

**Author:** [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Replies:** 6\
**Last updated:** [May 24, 2021, 8:37am UTC](https://discourse.julialang.org/t/next-and-previous-buttons-in-pluto/61363 "2021-05-24T08:37:51Z")

</div>

Hi all, I’d like to set an array index with a simple widget in Pluto via @bind but instead of a slider I’d like to use “next” and “previous” buttons. Does anyone know how to do that?

---

## [Documentation build workflow can't resolve dependency version while CI workflow can](https://discourse.julialang.org/t/documentation-build-workflow-cant-resolve-dependency-version-while-ci-workflow-can/61684)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [May 24, 2021, 6:45am UTC](https://discourse.julialang.org/t/documentation-build-workflow-cant-resolve-dependency-version-while-ci-workflow-can/61684 "2021-05-24T06:45:53Z")

</div>

I’m facing a somewhat strange issue in a package of mine, where a dependency is correctly found in the CI workflow but the documenter workflow can’t resolve its version. Here is the output from the documenter workflow: …

---

## [Franklin and Pluto play smoothly together (not quite yet)](https://discourse.julialang.org/t/franklin-and-pluto-play-smoothly-together-not-quite-yet/61002)

<div class="topic-metadata">

**Author:** [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)\
**Replies:** 3\
**Last updated:** [May 24, 2021, 6:03am UTC](https://discourse.julialang.org/t/franklin-and-pluto-play-smoothly-together-not-quite-yet/61002 "2021-05-24T06:03:02Z")

</div>

I really :heart: Pluto.jl as I :heart: Franklin.jl too. Wouldn’t be wonderful if both frameworks have more things in common? Franklin uses markdown to create static websites at the same time that can run julia code and …

---

## [Save multiple plots on separate pages of one PDF](https://discourse.julialang.org/t/save-multiple-plots-on-separate-pages-of-one-pdf/41953)

<div class="topic-metadata">

**Author:** [@corbat](https://discourse.julialang.org/u/corbat)\
**Replies:** 3\
**Last updated:** [May 24, 2021, 5:42am UTC](https://discourse.julialang.org/t/save-multiple-plots-on-separate-pages-of-one-pdf/41953 "2021-05-24T05:42:26Z")

</div>

Hi, is there a way to save multiple plots, more precisely multiple figures generated with Plots.jl, on separate pages of a single PDF file?

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

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