# Latest

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

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

**Page:** 1110

---

## [Defining an array of MTK variables causes error with ModelingToolkit.discretize()](https://discourse.julialang.org/t/defining-an-array-of-mtk-variables-causes-error-with-modelingtoolkit-discretize/77153)

<div class="topic-metadata">

**Author:** [@Fathya.Salih](https://discourse.julialang.org/u/Fathya.Salih)\
**Replies:** 4\
**Last updated:** [February 28, 2022, 8:05am UTC](https://discourse.julialang.org/t/defining-an-array-of-mtk-variables-causes-error-with-modelingtoolkit-discretize/77153 "2022-02-28T08:05:04Z")

</div>

I am trying to solve a number of ODEs for a set of variables (u\_1, u\_2, ..., u\_6) using MethodOfLines.jl, but I get this error MethodError: no method matching nameof(::SymbolicUtils.Term{SymbolicUtils.FnType{Tuple, Real…

---

## [\[ANN\] C3T - Crash Course Category Theory 🐱](https://discourse.julialang.org/t/ann-c3t-crash-course-category-theory/73392)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 4\
**Last updated:** [February 28, 2022, 2:40am UTC](https://discourse.julialang.org/t/ann-c3t-crash-course-category-theory/73392 "2022-02-28T02:40:50Z")

</div>

Hi all! I have been in the process of creating a Crash Course Category Theory website called C3T which utilizes Julia, Julia Markdown, KaTeX, Franklin.jl, Weave.jl, mermaid.js, and some Haskell! This is designed to …

---

## [Hcubature - New to Julia](https://discourse.julialang.org/t/hcubature-new-to-julia/77155)

<div class="topic-metadata">

**Author:** [@maria96](https://discourse.julialang.org/u/maria96)\
**Replies:** 7\
**Last updated:** [February 27, 2022, 10:45pm UTC](https://discourse.julialang.org/t/hcubature-new-to-julia/77155 "2022-02-27T22:45:48Z")

</div>

Hi all! I’m very new to Julia so this may be quite simple I don’t know. I have two functions written in Julia that I want to integrate and both should give a value very close to 1. They both produce the same type of var…

---

## [Minkowski decomposition in Polyhedra.jl](https://discourse.julialang.org/t/minkowski-decomposition-in-polyhedra-jl/77156)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 1\
**Last updated:** [February 27, 2022, 10:36pm UTC](https://discourse.julialang.org/t/minkowski-decomposition-in-polyhedra-jl/77156 "2022-02-27T22:36:44Z")

</div>

Is there a function about minskowski decomposition or minkowski summands which gives the all summands pair?

---

## [Parameter setting](https://discourse.julialang.org/t/parameter-setting/76836)

<div class="topic-metadata">

**Author:** [@mamo](https://discourse.julialang.org/u/mamo)\
**Replies:** 10\
**Last updated:** [February 27, 2022, 9:40pm UTC](https://discourse.julialang.org/t/parameter-setting/76836 "2022-02-27T21:40:48Z")

</div>

Dear all, I need to set a parameter with the structure equivalent to this AMPL declaration: param wg{c in C, cont in CONT\[c\]}; sets C and CONT\[c\] are as follows: set C := C1 C2; set CONT\[C1\] := 1 2 3 4 5; set CONT\[…

---

## [Help with a variation of the electrical components' example](https://discourse.julialang.org/t/help-with-a-variation-of-the-electrical-components-example/77099)

<div class="topic-metadata">

**Author:** [@vgg](https://discourse.julialang.org/u/vgg)\
**Replies:** 4\
**Last updated:** [February 27, 2022, 8:02pm UTC](https://discourse.julialang.org/t/help-with-a-variation-of-the-electrical-components-example/77099 "2022-02-27T20:02:46Z")

</div>

Hello, I have been doing my first tests with ModelingToolkit and when I tried to modify the acausal components example by adding other types of voltage source I had some problems that I don’t quite understand. In the f…

---

## [Reusing preallocated memory without unsafe wraps](https://discourse.julialang.org/t/reusing-preallocated-memory-without-unsafe-wraps/77069)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 8\
**Last updated:** [February 27, 2022, 8:01pm UTC](https://discourse.julialang.org/t/reusing-preallocated-memory-without-unsafe-wraps/77069 "2022-02-27T20:01:04Z")

</div>

Hello, I need to use large arrays of floats in a large number of iterations. In each iteration, the size of the arrays will be different. If memory permits, I can pre-allocate the memory needed for all iterations at o…

---

## [High frame rate and resolution from a Raspberry Pi camera](https://discourse.julialang.org/t/high-frame-rate-and-resolution-from-a-raspberry-pi-camera/76815)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 2\
**Last updated:** [February 27, 2022, 6:54pm UTC](https://discourse.julialang.org/t/high-frame-rate-and-resolution-from-a-raspberry-pi-camera/76815 "2022-02-27T18:54:30Z")

</div>

Has anyone been able to fetch frames from a Raspberry Pi camera (i.e. an RPI with a NoIR Pi Cam connected to it with a ribbon cable) at a relatively high frame rate and resolution? I realize that “relatively high frame …

---

## [Easily run code in .jmd file (Weave.jl)](https://discourse.julialang.org/t/easily-run-code-in-jmd-file-weave-jl/61575)

<div class="topic-metadata">

**Author:** [@Antomek](https://discourse.julialang.org/u/Antomek)\
**Replies:** 1\
**Last updated:** [February 27, 2022, 4:47pm UTC](https://discourse.julialang.org/t/easily-run-code-in-jmd-file-weave-jl/61575 "2022-02-27T16:47:19Z")

</div>

Hello, Is there an easy way to run the code chunks from a .jmd file in the REPL? I am using VS Code, and like using Weave.jl to properly document my simulations. However, it would be nice if running code was easier fr…

---

## [Time cost for using structs](https://discourse.julialang.org/t/time-cost-for-using-structs/77149)

<div class="topic-metadata">

**Author:** [@lineycroc](https://discourse.julialang.org/u/lineycroc)\
**Replies:** 2\
**Last updated:** [February 27, 2022, 2:07pm UTC](https://discourse.julialang.org/t/time-cost-for-using-structs/77149 "2022-02-27T14:07:31Z")

</div>

I am trying to better understand the performance implications of using mutable structs. My actual use case is similar to the Optim package of storing a state variable that will change every iteration (such as https://git…

---

## [Time series interpolation](https://discourse.julialang.org/t/time-series-interpolation/77147)

<div class="topic-metadata">

**Author:** [@cripcate](https://discourse.julialang.org/u/cripcate)\
**Replies:** 3\
**Last updated:** [February 27, 2022, 12:44pm UTC](https://discourse.julialang.org/t/time-series-interpolation/77147 "2022-02-27T12:44:33Z")

</div>

Suppose i have two vectors, one containing timestamps and one containing values: using Dates dt = collect(Date(1900,1,1):Day(2):Date(1902,1,1)) y = randn(length(x)) I want to upsample these data to daily resolution by …

---

## [What is the difference between Graphs and GraphMakie?](https://discourse.julialang.org/t/what-is-the-difference-between-graphs-and-graphmakie/77144)

<div class="topic-metadata">

**Author:** [@matic\_lauko](https://discourse.julialang.org/u/matic_lauko)\
**Replies:** 2\
**Last updated:** [February 27, 2022, 11:35am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-graphs-and-graphmakie/77144 "2022-02-27T11:35:36Z")

</div>

I have tried using both, but from what I can see GraphMakie is just Graphs, with interactivity. Plus they have a bit different syntax. How different is syntax, exactly as one uses a package more, is it a big difference?

---

## [Why are there so many plotting backends?](https://discourse.julialang.org/t/why-are-there-so-many-plotting-backends/77142)

<div class="topic-metadata">

**Author:** [@matic\_lauko](https://discourse.julialang.org/u/matic_lauko)\
**Replies:** 7\
**Last updated:** [February 27, 2022, 11:15am UTC](https://discourse.julialang.org/t/why-are-there-so-many-plotting-backends/77142 "2022-02-27T11:15:44Z")

</div>

Hello, I’m learning to use Makie, but have also looked at some other packages like GadFly and Plots, but Makie seems my favorite. I’m just wondering why does it have 4 different backends(WGLMakie, GLMakie, and CairoMakie…

---

## [Operation between two large N-dimensional arrays](https://discourse.julialang.org/t/operation-between-two-large-n-dimensional-arrays/77141)

<div class="topic-metadata">

**Author:** [@Tzaki](https://discourse.julialang.org/u/Tzaki)\
**Replies:** 2\
**Last updated:** [February 27, 2022, 10:41am UTC](https://discourse.julialang.org/t/operation-between-two-large-n-dimensional-arrays/77141 "2022-02-27T10:41:10Z")

</div>

Hello, I am pretty much new to Julia. I am now trying to do an operation between two large N-dimensional sparse arrays of the same size (typically something like 8-dimensional array with 5 to 10 elements for each dimens…

---

## [Error with quiver: "unexpected vi type Nothing for quiver: nothing"](https://discourse.julialang.org/t/error-with-quiver-unexpected-vi-type-nothing-for-quiver-nothing/77060)

<div class="topic-metadata">

**Author:** [@leopdsf](https://discourse.julialang.org/u/leopdsf)\
**Replies:** 1\
**Last updated:** [February 27, 2022, 12:11am UTC](https://discourse.julialang.org/t/error-with-quiver-unexpected-vi-type-nothing-for-quiver-nothing/77060 "2022-02-27T00:11:53Z")

</div>

Greetings, everybody! I’m having a problem using quiver from Plots.jl. As I understood, I have to provide 2 arrays that will state the initial coordinate of the vector, and other 2 that will state its final position. So…

---

## [LoadError: MethodError: no method matching size(::Pair{Symbol, Any}), when using Flux.loadparams!](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-size-pair-symbol-any-when-using-flux-loadparams/69578)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 1\
**Last updated:** [February 26, 2022, 8:06pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-size-pair-symbol-any-when-using-flux-loadparams/69578 "2022-02-26T20:06:50Z")

</div>

I try to use Flux.loadparams! as it is described in the documentation loadparams!, and I get an error: Closest candidates are: size(::Union{LinearAlgebra.QR, LinearAlgebra.QRCompactWY, LinearAlgebra.QRPivoted}) at C:\\…

---

## [Numeric integration](https://discourse.julialang.org/t/numeric-integration/77134)

<div class="topic-metadata">

**Author:** [@rsimic](https://discourse.julialang.org/u/rsimic)\
**Replies:** 1\
**Last updated:** [February 26, 2022, 7:54pm UTC](https://discourse.julialang.org/t/numeric-integration/77134 "2022-02-26T19:54:17Z")

</div>

begin using HCubature z(x, y) = exp(-x^2) a = (0, 0) b = (3, 3) hcubature(z, a, b) end code above returns error MethodError: no method matching z(::StaticArrays.SVector{2, Float64}) Closest candidates are: z(::…

---

## [Energy consumption analysis for Julia](https://discourse.julialang.org/t/energy-consumption-analysis-for-julia/77124)

<div class="topic-metadata">

**Author:** [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Replies:** 2\
**Last updated:** [February 26, 2022, 7:32pm UTC](https://discourse.julialang.org/t/energy-consumption-analysis-for-julia/77124 "2022-02-26T19:32:15Z")

</div>

Hey folks, There was an interesting paper published in 2017 which did an analysis of the energy consumption of various programming languages. It would be really great to get Julia support on this repo: https://github.co…

---

## [How to concatenate these two arrays?](https://discourse.julialang.org/t/how-to-concatenate-these-two-arrays/77129)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 6\
**Last updated:** [February 26, 2022, 4:32pm UTC](https://discourse.julialang.org/t/how-to-concatenate-these-two-arrays/77129 "2022-02-26T16:32:59Z")

</div>

For example, I have two arrays A and B as below: A = rand(5,3); B = rand(5,3,2); How do I concatenate them into C with the size of 5,3,3, so that: C\[:, :, 1\] = A; C\[:, :, 2:3\] = B; Many thanks.

---

## [How do I add a new column to a dataframe in Julia using conditional logic?](https://discourse.julialang.org/t/how-do-i-add-a-new-column-to-a-dataframe-in-julia-using-conditional-logic/77103)

<div class="topic-metadata">

**Author:** [@a.frist](https://discourse.julialang.org/u/a.frist)\
**Replies:** 5\
**Last updated:** [February 26, 2022, 2:57pm UTC](https://discourse.julialang.org/t/how-do-i-add-a-new-column-to-a-dataframe-in-julia-using-conditional-logic/77103 "2022-02-26T14:57:03Z")

</div>

I want to create a new column in my dataframe. If another column equals zero, I want this column to equal zero. If it doesn’t, I would like this column to equal another column divided by a third column. I tried using the…

---

## [DSP.jl Side Effect on Dates](https://discourse.julialang.org/t/dsp-jl-side-effect-on-dates/77115)

<div class="topic-metadata">

**Author:** [@herm](https://discourse.julialang.org/u/herm)\
**Replies:** 2\
**Last updated:** [February 26, 2022, 2:29pm UTC](https://discourse.julialang.org/t/dsp-jl-side-effect-on-dates/77115 "2022-02-26T14:29:04Z")

</div>

Interestingly I found with Julia Version 1.7.2 (2022-02-06) for window the following side effect: No Bug using Dates datenow=Dates.format(Dates.now(),“yyyymmddTHHMMSSZ”) Buggy using DSP using Dates datenow=Dates.f…

---

## [Is there an efficient and elegant way to keep the top 2 values from an iterator](https://discourse.julialang.org/t/is-there-an-efficient-and-elegant-way-to-keep-the-top-2-values-from-an-iterator/77121)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 1\
**Last updated:** [February 26, 2022, 2:16pm UTC](https://discourse.julialang.org/t/is-there-an-efficient-and-elegant-way-to-keep-the-top-2-values-from-an-iterator/77121 "2022-02-26T14:16:05Z")

</div>

Consider an arbitrary itr that returns a sequence of values. Now maximum(itr) will return max value, is there a way to return the maximum 2 values? partialsort(collect(itr), 2) would do the trick but collect might be…

---

## [How to typeset in bold letters with \`annotate!()\` using Plots](https://discourse.julialang.org/t/how-to-typeset-in-bold-letters-with-annotate-using-plots/76941)

<div class="topic-metadata">

**Author:** [@met-j](https://discourse.julialang.org/u/met-j)\
**Replies:** 8\
**Last updated:** [February 26, 2022, 12:49pm UTC](https://discourse.julialang.org/t/how-to-typeset-in-bold-letters-with-annotate-using-plots/76941 "2022-02-26T12:49:20Z")

</div>

How would I get a Bold font type in the annotate!() function using Plots with the GR backend?

---

## [How to find the sum for indices satisfying certain conditions？](https://discourse.julialang.org/t/how-to-find-the-sum-for-indices-satisfying-certain-conditions/77117)

<div class="topic-metadata">

**Author:** [@Shouto](https://discourse.julialang.org/u/Shouto)\
**Replies:** 3\
**Last updated:** [February 26, 2022, 12:03pm UTC](https://discourse.julialang.org/t/how-to-find-the-sum-for-indices-satisfying-certain-conditions/77117 "2022-02-26T12:03:14Z")

</div>

Hi all, I have the following question. Assume that we have integer-valued N \>=1 objects such that E\_1,…,E\_N. Each E\_i takes a number between 1 and N, allowing for duplicates. Let f be a function and X\_1,…,X\_N be N real…

---

## [@views throws an error in combination with a struct](https://discourse.julialang.org/t/views-throws-an-error-in-combination-with-a-struct/77090)

<div class="topic-metadata">

**Author:** [@pgoulart](https://discourse.julialang.org/u/pgoulart)\
**Replies:** 4\
**Last updated:** [February 26, 2022, 10:09am UTC](https://discourse.julialang.org/t/views-throws-an-error-in-combination-with-a-struct/77090 "2022-02-26T10:09:08Z")

</div>

I am not sure if this is a bug or just not allowed syntax for some reason. The @views macro throws an error under seemingly narrow circumstances as shown in the last line of the example below: struct Foo{T} a::Vec…

---

## [Bug in julia zeros() side effects](https://discourse.julialang.org/t/bug-in-julia-zeros-side-effects/77046)

<div class="topic-metadata">

**Author:** [@herm](https://discourse.julialang.org/u/herm)\
**Replies:** 4\
**Last updated:** [February 26, 2022, 9:48am UTC](https://discourse.julialang.org/t/bug-in-julia-zeros-side-effects/77046 "2022-02-26T09:48:14Z")

</div>

Julia Version 1.7.2 (2022-02-06) I experienced some side effects of the initialization with zeros. Good to know… buggy function compute\_k1!(nfft::Int64,kvec::Vector{ComplexF64}) kvec=zeros(ComplexF64,nfft) for i=1:n…

---

## [How to call functions defined in separate files in julia-1.6?](https://discourse.julialang.org/t/how-to-call-functions-defined-in-separate-files-in-julia-1-6/77098)

<div class="topic-metadata">

**Author:** [@jjdegruijter](https://discourse.julialang.org/u/jjdegruijter)\
**Replies:** 4\
**Last updated:** [February 26, 2022, 9:47am UTC](https://discourse.julialang.org/t/how-to-call-functions-defined-in-separate-files-in-julia-1-6/77098 "2022-02-26T09:47:46Z")

</div>

In julia-1.0 I called a function"readdata()" that I defined in a file called “readdata”, from a start-up code in another file “main”. In julia-1.6 that does not seem to work anymore. I get “UndefVarError: readdata not d…

---

## [(Book) Parallel Computing and Scientific Machine Learning (SciML): Methods and Applications](https://discourse.julialang.org/t/book-parallel-computing-and-scientific-machine-learning-sciml-methods-and-applications/75509)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 12\
**Last updated:** [February 26, 2022, 2:37am UTC](https://discourse.julialang.org/t/book-parallel-computing-and-scientific-machine-learning-sciml-methods-and-applications/75509 "2022-02-26T02:37:41Z")

</div>

This repository has been forked off of the popular GitHub - mitmath/18337: 18.337 - Parallel Computing and Scientific Machine Learning course website to serve as a “book”/collection of lecture notes that can continue t…

---

## [Fastest way to initialize StaticArray of dynamic size with state](https://discourse.julialang.org/t/fastest-way-to-initialize-staticarray-of-dynamic-size-with-state/77091)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 3\
**Last updated:** [February 26, 2022, 12:21am UTC](https://discourse.julialang.org/t/fastest-way-to-initialize-staticarray-of-dynamic-size-with-state/77091 "2022-02-26T00:21:49Z")

</div>

I’m constructing an SVector, but each value depends on the previous calculated value. This is still simple to do with sacollect, but then it has to box the input and so allocates (see example below). What is the optimal …

---

## [Warning dt\<dtmin in ODE Solver not solved with FAQ](https://discourse.julialang.org/t/warning-dt-dtmin-in-ode-solver-not-solved-with-faq/76999)

<div class="topic-metadata">

**Author:** [@gnicolosi](https://discourse.julialang.org/u/gnicolosi)\
**Replies:** 3\
**Last updated:** [February 25, 2022, 11:39pm UTC](https://discourse.julialang.org/t/warning-dt-dtmin-in-ode-solver-not-solved-with-faq/76999 "2022-02-25T23:39:12Z")

</div>

Dear all, I have run into the following issue, which is described in details also here: Frequently Asked Questions · DifferentialEquations.jl (sciml.ai). I have tried all suggestions on the link and made a great amount …

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

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