# Latest

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

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

**Page:** 798

---

## [Using @assert in loop within function](https://discourse.julialang.org/t/using-assert-in-loop-within-function/93761)

<div class="topic-metadata">

**Author:** [@ditfurth](https://discourse.julialang.org/u/ditfurth)\
**Replies:** 6\
**Last updated:** [January 30, 2023, 1:16pm UTC](https://discourse.julialang.org/t/using-assert-in-loop-within-function/93761 "2023-01-30T13:16:34Z")

</div>

Hi all, I am trying to include @assert into my loop to make sure my results are correct. I am trying to modify the error message: row = 1 for i in 1:size(markets,1) equals\_market(market::Int) = market == i …

---

## [Working with shared memory as one or more variables, what is a good approach?](https://discourse.julialang.org/t/working-with-shared-memory-as-one-or-more-variables-what-is-a-good-approach/93758)

<div class="topic-metadata">

**Author:** [@bcsj](https://discourse.julialang.org/u/bcsj)\
**Replies:** 2\
**Last updated:** [January 30, 2023, 1:14pm UTC](https://discourse.julialang.org/t/working-with-shared-memory-as-one-or-more-variables-what-is-a-good-approach/93758 "2023-01-30T13:14:29Z")

</div>

I’m somewhat new to writing gpu code, but I am working on a somewhat complicated kernel function, which involves a number of steps in which shared memory is used to speed up the computations. To be efficient I reuse the…

---

## [What's wrong with this system/circuit?](https://discourse.julialang.org/t/whats-wrong-with-this-system-circuit/93569)

<div class="topic-metadata">

**Author:** [@sh2pro](https://discourse.julialang.org/u/sh2pro)\
**Replies:** 7\
**Last updated:** [January 30, 2023, 11:52am UTC](https://discourse.julialang.org/t/whats-wrong-with-this-system-circuit/93569 "2023-01-30T11:52:08Z")

</div>

I’ve defined a system as follows: using ModelingToolkit, ModelingToolkitStandardLibrary using DifferentialEquations using ModelingToolkitStandardLibrary.Electrical using ModelingToolkitStandardLibrary.Blocks function C…

---

## [Using Serialization to store then load a lambdified function?](https://discourse.julialang.org/t/using-serialization-to-store-then-load-a-lambdified-function/85884)

<div class="topic-metadata">

**Author:** [@pluie](https://discourse.julialang.org/u/pluie)\
**Replies:** 7\
**Last updated:** [January 30, 2023, 11:08am UTC](https://discourse.julialang.org/t/using-serialization-to-store-then-load-a-lambdified-function/85884 "2023-01-30T11:08:26Z")

</div>

I have a lengthy symbolic expression that I find and lambdify in one function once. I hope to use this lambdified function repeatedly in a different function. It takes about a minute for lambdify to execute, so I do not …

---

## [\[ANN\]: TernaryDiagrams.jl](https://discourse.julialang.org/t/ann-ternarydiagrams-jl/92312)

<div class="topic-metadata">

**Author:** [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Replies:** 2\
**Last updated:** [January 30, 2023, 10:23am UTC](https://discourse.julialang.org/t/ann-ternarydiagrams-jl/92312 "2023-01-30T10:23:36Z")

</div>

Hi all! I made a small Makie recipe package that allows you to draw ternary plots like this: I am planning on eventually making a ternary axis properly (instead of co-opting the regular 2D axis like I do currently), …

---

## [Plotting in VSCode on two or more plot windows](https://discourse.julialang.org/t/plotting-in-vscode-on-two-or-more-plot-windows/93746)

<div class="topic-metadata">

**Author:** [@bionicinnovations](https://discourse.julialang.org/u/bionicinnovations)\
**Replies:** 3\
**Last updated:** [January 30, 2023, 9:47am UTC](https://discourse.julialang.org/t/plotting-in-vscode-on-two-or-more-plot-windows/93746 "2023-01-30T09:47:11Z")

</div>

I am analysing large data sets, with each analysis generating 10s of plots (Plots.jl with the plotly() backend). I want to compare these plots but generated under a separate condition. On VS Code it puts the plots in a …

---

## [Quadratic Program solver for Portfolio Optimization](https://discourse.julialang.org/t/quadratic-program-solver-for-portfolio-optimization/93264)

<div class="topic-metadata">

**Author:** [@maxchendt](https://discourse.julialang.org/u/maxchendt)\
**Replies:** 8\
**Last updated:** [January 30, 2023, 8:56am UTC](https://discourse.julialang.org/t/quadratic-program-solver-for-portfolio-optimization/93264 "2023-01-30T08:56:53Z")

</div>

Any recommendations? For portfolio selection problem with equality and inequality constraints, and lower and upper bounds for portfolio weights. So far, what I have tested ( I do not test commercial solver like Gurobi …

---

## [Constrain weights and biases to be positive](https://discourse.julialang.org/t/constrain-weights-and-biases-to-be-positive/93381)

<div class="topic-metadata">

**Author:** [@marco\_menarini](https://discourse.julialang.org/u/marco_menarini)\
**Replies:** 5\
**Last updated:** [January 30, 2023, 8:38am UTC](https://discourse.julialang.org/t/constrain-weights-and-biases-to-be-positive/93381 "2023-01-30T08:38:02Z")

</div>

Is it possible to use a custom constrained optimizer or to modify the gradients to only allow for positive weights and biases?

---

## [Help with Advent of Code exercise](https://discourse.julialang.org/t/help-with-advent-of-code-exercise/93641)

<div class="topic-metadata">

**Author:** [@thetathetatheta](https://discourse.julialang.org/u/thetathetatheta)\
**Replies:** 5\
**Last updated:** [January 30, 2023, 8:28am UTC](https://discourse.julialang.org/t/help-with-advent-of-code-exercise/93641 "2023-01-30T08:28:00Z")

</div>

Hi! I started to learn Julia by solving Advent of Code exercises from previous years. My background is R but I’m a hobbyist dealing mostly with text mining for fun. So far everything is fun and games, I go through AoC …

---

## [⸘How do I do "tensor slicing" in Flux and CUDA‽](https://discourse.julialang.org/t/how-do-i-do-tensor-slicing-in-flux-and-cuda/93590)

<div class="topic-metadata">

**Author:** [@Euhan](https://discourse.julialang.org/u/Euhan)\
**Replies:** 5\
**Last updated:** [January 30, 2023, 3:47am UTC](https://discourse.julialang.org/t/how-do-i-do-tensor-slicing-in-flux-and-cuda/93590 "2023-01-30T03:47:02Z")

</div>

If I have a tensor T ∈ ∏ ℝⁱₖ|k ∈ {1,…,m} and I want to drop some elements to get T̂ ∈ ∏ ℝⁿₖ|k ∈ {1,…,m}, nₖ = iₖ | k ∈ {1,…,m}\\{p| p ∈ ℕ, 1 ≤ p ≤ m} ∧ 1 ≤ nₖ ≤ iₖ | k = p, how should I then include that transformation in…

---

## [Problems with SpecialFunctions.jl](https://discourse.julialang.org/t/problems-with-specialfunctions-jl/93705)

<div class="topic-metadata">

**Author:** [@fda-tome](https://discourse.julialang.org/u/fda-tome)\
**Replies:** 8\
**Last updated:** [January 30, 2023, 2:08am UTC](https://discourse.julialang.org/t/problems-with-specialfunctions-jl/93705 "2023-01-30T02:08:50Z")

</div>

Hey guys, im having trouble using BigFloat variables on spherical bessel functions given by the SpecialFunctions,jl package. I’m using the following code and receiving the error below. Thanks beforehand :slight\_smile: f…

---

## [How to access the exit of MadNLP solver directly](https://discourse.julialang.org/t/how-to-access-the-exit-of-madnlp-solver-directly/93685)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 5\
**Last updated:** [January 29, 2023, 8:39pm UTC](https://discourse.julialang.org/t/how-to-access-the-exit-of-madnlp-solver-directly/93685 "2023-01-29T20:39:52Z")

</div>

Hi all, I wonder if it is possible to access the exit of a solver directly from JuMP0, i.e. the exit we get when not setting the JuMP model in silent as shown in the screenshot below. I would really appreciate it if you…

---

## [How to properly pass structs into GPU? (MWE included)](https://discourse.julialang.org/t/how-to-properly-pass-structs-into-gpu-mwe-included/93727)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 6\
**Last updated:** [January 29, 2023, 8:23pm UTC](https://discourse.julialang.org/t/how-to-properly-pass-structs-into-gpu-mwe-included/93727 "2023-01-29T20:23:50Z")

</div>

Hello! Lately I’ve been asking a few questions about how to program on GPU etc. and I’ve gotten some answers (thank you very much!), but of course it is hard to help me if I only provide a few line of codes. So this mor…

---

## [Interesting comments on someone's journey from R to Julia posted in hacker news](https://discourse.julialang.org/t/interesting-comments-on-someones-journey-from-r-to-julia-posted-in-hacker-news/93740)

<div class="topic-metadata">

**Author:** [@1153dent](https://discourse.julialang.org/u/1153dent)\
**Replies:** 4\
**Last updated:** [January 29, 2023, 7:55pm UTC](https://discourse.julialang.org/t/interesting-comments-on-someones-journey-from-r-to-julia-posted-in-hacker-news/93740 "2023-01-29T19:55:24Z")

</div>

I was reading the comments section. the article is interesting but the comments more so

---

## [Duality gap in Convex.jl](https://discourse.julialang.org/t/duality-gap-in-convex-jl/93741)

<div class="topic-metadata">

**Author:** [@ajd](https://discourse.julialang.org/u/ajd)\
**Replies:** 2\
**Last updated:** [January 29, 2023, 7:50pm UTC](https://discourse.julialang.org/t/duality-gap-in-convex-jl/93741 "2023-01-29T19:50:31Z")

</div>

Using the SCS solver with Convex.jl, the output of the solver includes in its printed output the duality gap: ------------------------------------------------------------------ SCS v3.2.1 - Splitting Conic Solve…

---

## [Using all independent variables with @formula in a multiple linear model](https://discourse.julialang.org/t/using-all-independent-variables-with-formula-in-a-multiple-linear-model/43691)

<div class="topic-metadata">

**Author:** [@pauloat](https://discourse.julialang.org/u/pauloat)\
**Replies:** 18\
**Last updated:** [January 29, 2023, 4:56pm UTC](https://discourse.julialang.org/t/using-all-independent-variables-with-formula-in-a-multiple-linear-model/43691 "2023-01-29T16:56:04Z")

</div>

Hi, I’m trying to learn how to do linear models and wanted to know if there something like in R, where you can use a dot (“.”) instead of writing all the indepent variables in a linear regression model, for example in R: …

---

## [Passing mutable struct to kernel](https://discourse.julialang.org/t/passing-mutable-struct-to-kernel/71948)

<div class="topic-metadata">

**Author:** [@lodygaw](https://discourse.julialang.org/u/lodygaw)\
**Replies:** 7\
**Last updated:** [January 29, 2023, 3:20pm UTC](https://discourse.julialang.org/t/passing-mutable-struct-to-kernel/71948 "2023-01-29T15:20:27Z")

</div>

Hi, I am looking for the best way to use structs inside the kernels and I am having hard time with understanding whole mutable/immutable/isbits/inline thing. My goal is to be able to pass struct as an argument to a kern…

---

## [How to share a dataframe across machines on a wired wan](https://discourse.julialang.org/t/how-to-share-a-dataframe-across-machines-on-a-wired-wan/93701)

<div class="topic-metadata">

**Author:** [@1153dent](https://discourse.julialang.org/u/1153dent)\
**Replies:** 6\
**Last updated:** [January 29, 2023, 1:49pm UTC](https://discourse.julialang.org/t/how-to-share-a-dataframe-across-machines-on-a-wired-wan/93701 "2023-01-29T13:49:40Z")

</div>

I want to share a realtime dataframe across a wired wan so others can READ the data ONLY. It’s my data and I don’t want it polluted by my python “colleagues” I have seen what they can do :slight\_smile: they are envious …

---

## [How to create the rotated cube with Makie.jl and GeometryBasics.jl](https://discourse.julialang.org/t/how-to-create-the-rotated-cube-with-makie-jl-and-geometrybasics-jl/93720)

<div class="topic-metadata">

**Author:** [@Mizu49](https://discourse.julialang.org/u/Mizu49)\
**Replies:** 3\
**Last updated:** [January 29, 2023, 12:44pm UTC](https://discourse.julialang.org/t/how-to-create-the-rotated-cube-with-makie-jl-and-geometrybasics-jl/93720 "2023-01-29T12:44:13Z")

</div>

I want to create the rotated cube with Makie.jl and GeometryBasics.jl. I made the following code, but it did not work well. using GLMakie, GeometryBasics # rotation matrix theta = pi/4 C = \[ 1 0 …

---

## [Using @parameters with DataDrivenDiffEq](https://discourse.julialang.org/t/using-parameters-with-datadrivendiffeq/91520)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [January 29, 2023, 12:33pm UTC](https://discourse.julialang.org/t/using-parameters-with-datadrivendiffeq/91520 "2023-01-29T12:33:15Z")

</div>

I have figured out how to fit functions defined by arrays of number using a Basis defined with ModelToolkit.jl and DataDrivenDiffEq.jl. However, I still do not understand the use of @parameters. I initially thought that …

---

## [Turing.jl Warning: The current proposal will be rejected due to numerical error(s). isfinite.((θ, r, ℓπ, ℓκ)) = (true, false, false, false)](https://discourse.julialang.org/t/turing-jl-warning-the-current-proposal-will-be-rejected-due-to-numerical-error-s-isfinite-r-true-false-false-false/93472)

<div class="topic-metadata">

**Author:** [@pfarndt](https://discourse.julialang.org/u/pfarndt)\
**Replies:** 4\
**Last updated:** [January 29, 2023, 12:26pm UTC](https://discourse.julialang.org/t/turing-jl-warning-the-current-proposal-will-be-rejected-due-to-numerical-error-s-isfinite-r-true-false-false-false/93472 "2023-01-29T12:26:14Z")

</div>

I slightly modifies the gdemo example in Turing.jl to accept more data to # Import packages. using Turing # Define a simple Normal model with unknown mean and variance. @model function gdemo(x) s² ~ InverseGamma(2,…

---

## [Lux.jl demo with Lotka-Voltera with UODE](https://discourse.julialang.org/t/lux-jl-demo-with-lotka-voltera-with-uode/91538)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 25\
**Last updated:** [January 29, 2023, 12:24pm UTC](https://discourse.julialang.org/t/lux-jl-demo-with-lotka-voltera-with-uode/91538 "2023-01-29T12:24:15Z")

</div>

@ChrisRackauckas Is there a tutorial or example of a universal differential equation which is mixture of deterministic and neural networks in the RHS, something like the Lotka-Volterra equations where the nonlinear term…

---

## [Fermi.jl: Quantum Chemistry in Julia](https://discourse.julialang.org/t/fermi-jl-quantum-chemistry-in-julia/74962)

<div class="topic-metadata">

**Author:** [@Aroeira](https://discourse.julialang.org/u/Aroeira)\
**Replies:** 3\
**Last updated:** [January 29, 2023, 12:19pm UTC](https://discourse.julialang.org/t/fermi-jl-quantum-chemistry-in-julia/74962 "2023-01-29T12:19:03Z")

</div>

Hello yall, Some coworkers and I have been working on building a quantum chemistry framework in Julia. The package has been registered for a while and I have already had several exchanges with members of the community a…

---

## [Reinterpret to existing vector](https://discourse.julialang.org/t/reinterpret-to-existing-vector/93706)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 16\
**Last updated:** [January 29, 2023, 9:55am UTC](https://discourse.julialang.org/t/reinterpret-to-existing-vector/93706 "2023-01-29T09:55:50Z")

</div>

Lets say I have a byte (UInt8) array that looks like this: source = reinterpret(UInt8, Int64\[10,11\]) 0x0a 0x00 0x00 0x00 .... And an existing allocated array of two integers target = zeros(Int64, 2) I basically w…

---

## [Implementing convolution from scratch](https://discourse.julialang.org/t/implementing-convolution-from-scratch/93723)

<div class="topic-metadata">

**Author:** [@skittishdev](https://discourse.julialang.org/u/skittishdev)\
**Replies:** 5\
**Last updated:** [January 29, 2023, 9:43am UTC](https://discourse.julialang.org/t/implementing-convolution-from-scratch/93723 "2023-01-29T09:43:23Z")

</div>

Hello, I already posted this question on Stackoverflow, but decided I’d ask here as well. Please find my question from Stackoverflow pasted below (verbatim). I am trying to implement convolution by hand in Julia. I’m …

---

## [\[ANN\] Pipebraces.jl – piping with braces](https://discourse.julialang.org/t/ann-pipebraces-jl-piping-with-braces/93718)

<div class="topic-metadata">

**Author:** [@qsong](https://discourse.julialang.org/u/qsong)\
**Replies:** 2\
**Last updated:** [January 29, 2023, 5:45am UTC](https://discourse.julialang.org/t/ann-pipebraces-jl-piping-with-braces/93718 "2023-01-29T05:45:49Z")

</div>

The idea of piping with curly braces was proposed two months ago. Here is another implementation in favor of |\> {} instead. https://github.com/ianqsong/Pipebraces.jl Take an example in the proposal post for quick compa…

---

## [Missing coverage data](https://discourse.julialang.org/t/missing-coverage-data/93715)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [January 29, 2023, 12:04am UTC](https://discourse.julialang.org/t/missing-coverage-data/93715 "2023-01-29T00:04:54Z")

</div>

I’m having trouble with figuring out why I’m not getting coverage data on a package I’m trying to get ready for submission to the General registry. This is what I’m doing: % git clone https://github.com/JuliaQuantumCon…

---

## [Macro to make a nested loop with threads](https://discourse.julialang.org/t/macro-to-make-a-nested-loop-with-threads/93717)

<div class="topic-metadata">

**Author:** [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Replies:** 0\
**Last updated:** [January 29, 2023, 12:55am UTC](https://discourse.julialang.org/t/macro-to-make-a-nested-loop-with-threads/93717 "2023-01-29T00:55:09Z")

</div>

This is a reoccurring question, but with a twist that I can’t figure out (as this is my first time fiddling with macros). I have gone through most of the threads here and on SO concerning using macro to conditionally us…

---

## [Vararg (sub)type parameter undocumented dispatch weirdness](https://discourse.julialang.org/t/vararg-sub-type-parameter-undocumented-dispatch-weirdness/87110)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 7\
**Last updated:** [January 29, 2023, 12:02am UTC](https://discourse.julialang.org/t/vararg-sub-type-parameter-undocumented-dispatch-weirdness/87110 "2023-01-29T00:02:59Z")

</div>

a1(::Integer...) = nothing a2(::I...) where {I \<: Integer} = nothing a3(::Vararg{Integer}) = nothing a4(::Vararg{\<:Integer}) = nothing a5(::Vararg{I}) where {I \<: Integer} = nothing b3(::NTuple{n, Integer}) where {n} = n…

---

## [UndefVarError: .\* not defined when grouping with DataframesMeta](https://discourse.julialang.org/t/undefvarerror-not-defined-when-grouping-with-dataframesmeta/93115)

<div class="topic-metadata">

**Author:** [@a.frist](https://discourse.julialang.org/u/a.frist)\
**Replies:** 5\
**Last updated:** [January 28, 2023, 11:45pm UTC](https://discourse.julialang.org/t/undefvarerror-not-defined-when-grouping-with-dataframesmeta/93115 "2023-01-28T23:45:38Z")

</div>

Hello all, I ran into a problem when running a Julia script. The following code produces an error: UndefVarError: .\* not defined The offending Code: group = groupby(my\_dataframe, \[:COLUMN\_1, :COLUMN\_2\]) bet…

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

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