# Latest

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

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

**Page:** 1017

---

## [Type Sudoku (test if object is a struct)](https://discourse.julialang.org/t/type-sudoku-test-if-object-is-a-struct/66139)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 21\
**Last updated:** [June 8, 2022, 9:43am UTC](https://discourse.julialang.org/t/type-sudoku-test-if-object-is-a-struct/66139 "2022-06-08T09:43:32Z")

</div>

This is NOT to complain about Julia, rather a learning experience, so bear with me… Dispatching to a struct type seems like the match of the last resort - after a lot of not this, not that, not really testable. And cont…

---

## [Julia equivalence tf.nn.l2\_loss(x) in Flux](https://discourse.julialang.org/t/julia-equivalence-tf-nn-l2-loss-x-in-flux/82420)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 9:39am UTC](https://discourse.julialang.org/t/julia-equivalence-tf-nn-l2-loss-x-in-flux/82420 "2022-06-08T09:39:08Z")

</div>

Which is the function inside the Flux package that is equivalent to Python tensorflow.python.ops.nn.l2\_loss()?

---

## [DataType to String](https://discourse.julialang.org/t/datatype-to-string/82405)

<div class="topic-metadata">

**Author:** [@chiion](https://discourse.julialang.org/u/chiion)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 9:38am UTC](https://discourse.julialang.org/t/datatype-to-string/82405 "2022-06-08T09:38:46Z")

</div>

Hi All, I’m writing a module with a function that converts an internal DataType into a string. However, without importing/exporting the DataType, the module name is added to the string. Example: module A struct T…

---

## [Assigning a concentrated load to a specific point in the boundary](https://discourse.julialang.org/t/assigning-a-concentrated-load-to-a-specific-point-in-the-boundary/82419)

<div class="topic-metadata">

**Author:** [@refauhx](https://discourse.julialang.org/u/refauhx)\
**Replies:** 0\
**Last updated:** [June 8, 2022, 9:27am UTC](https://discourse.julialang.org/t/assigning-a-concentrated-load-to-a-specific-point-in-the-boundary/82419 "2022-06-08T09:27:05Z")

</div>

Hi everyone, I am a beginner in Julia and I want to assign a concentrated load pointed downwards into the middle point of the boundary of my model. Unfortunately, this code gives me some results just when my tag used is…

---

## [Ability to move past unstable points in parameter space](https://discourse.julialang.org/t/ability-to-move-past-unstable-points-in-parameter-space/82272)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 8\
**Last updated:** [June 8, 2022, 8:54am UTC](https://discourse.julialang.org/t/ability-to-move-past-unstable-points-in-parameter-space/82272 "2022-06-08T08:54:50Z")

</div>

Hi, This is a fairly general question but I can provide some more concrete code if needed. Say I have 100 samples in a n dimensional parameter space between upper and lower bounds these bounds say 30% away from a “trut…

---

## [Problem with ForardDiff](https://discourse.julialang.org/t/problem-with-forarddiff/82412)

<div class="topic-metadata">

**Author:** [@Nikos\_Mourdoukoutas](https://discourse.julialang.org/u/Nikos_Mourdoukoutas)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 8:42am UTC](https://discourse.julialang.org/t/problem-with-forarddiff/82412 "2022-06-08T08:42:00Z")

</div>

I am trying to use ForwardDIff to compute the gradient of a function. My code is very simple: buffer1 = 1. buffer2 = 1.0-buffer1 buffers = \[buffer1; buffer2\]; K0 = \[\[100., 200.\] \[0.01, 0.001\]\]; q\_sat = \[100, 150\]; K =…

---

## [Detecting \`Tuple{Type{some type}}\`](https://discourse.julialang.org/t/detecting-tuple-type-some-type/82406)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 3\
**Last updated:** [June 8, 2022, 7:32am UTC](https://discourse.julialang.org/t/detecting-tuple-type-some-type/82406 "2022-06-08T07:32:39Z")

</div>

I’d like to check if a variabe is of the form Tuple{Type{Complex}} or Tuple{Type{Float64}} or anything else where the inner-most thing is a type. Here are a couple of my failed attempts: julia\> Tuple{Type{Complex}} isa …

---

## [Using eval to evaluate a variable inside an expression when string interpolation is not ok](https://discourse.julialang.org/t/using-eval-to-evaluate-a-variable-inside-an-expression-when-string-interpolation-is-not-ok/82356)

<div class="topic-metadata">

**Author:** [@mikeliux](https://discourse.julialang.org/u/mikeliux)\
**Replies:** 5\
**Last updated:** [June 8, 2022, 5:56am UTC](https://discourse.julialang.org/t/using-eval-to-evaluate-a-variable-inside-an-expression-when-string-interpolation-is-not-ok/82356 "2022-06-08T05:56:24Z")

</div>

I am learning Julia and I am trying to create a function to shuffle an n-dimensional array X along a desired dimension. This same strategy will be used later to split an array into 2 subarrays along a desired dimension. …

---

## [How to solve \`no method matching real(::String)\` when solving ODEs?](https://discourse.julialang.org/t/how-to-solve-no-method-matching-real-string-when-solving-odes/82294)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 4\
**Last updated:** [June 8, 2022, 5:50am UTC](https://discourse.julialang.org/t/how-to-solve-no-method-matching-real-string-when-solving-odes/82294 "2022-06-08T05:50:11Z")

</div>

Hello, I am simulating a microbial consortium (2 bacteria, 2 phages) but I get a MethodError during the solving step. Since I have duplicated items (two growth rates, two infection rates etc) I used vectors of 2 element…

---

## [Links to the source in the documentation](https://discourse.julialang.org/t/links-to-the-source-in-the-documentation/82385)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 4:52am UTC](https://discourse.julialang.org/t/links-to-the-source-in-the-documentation/82385 "2022-06-08T04:52:48Z")

</div>

How does one get the links to the source to show up in the documentation? Like this one:

---

## [One objective instead of stage objective with SDDP.jl](https://discourse.julialang.org/t/one-objective-instead-of-stage-objective-with-sddp-jl/82396)

<div class="topic-metadata">

**Author:** [@chenr86](https://discourse.julialang.org/u/chenr86)\
**Replies:** 8\
**Last updated:** [June 8, 2022, 3:56am UTC](https://discourse.julialang.org/t/one-objective-instead-of-stage-objective-with-sddp-jl/82396 "2022-06-08T03:56:07Z")

</div>

Hello, I’m new to optimization problem. I find SDDP.jl closed to what I want to do. There are state variable, control variables, random variables. But with SDDP.jl, we need to define the stage objective for each node, I…

---

## [Get latest frame from VideoIO.opencamera() buffer](https://discourse.julialang.org/t/get-latest-frame-from-videoio-opencamera-buffer/82400)

<div class="topic-metadata">

**Author:** [@arnief3](https://discourse.julialang.org/u/arnief3)\
**Replies:** 0\
**Last updated:** [June 8, 2022, 2:44am UTC](https://discourse.julialang.org/t/get-latest-frame-from-videoio-opencamera-buffer/82400 "2022-06-08T02:44:09Z")

</div>

Is it possible to grab the latest frame from the VideoIO.opencamera() buffer. Can I flush the buffer so that read(cam) waits for a new frame? Right now I am forced to close and reopen the camera each time I want to grab …

---

## [Is there a trick to input an \`Expr\` into a macro?](https://discourse.julialang.org/t/is-there-a-trick-to-input-an-expr-into-a-macro/82383)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 2:27am UTC](https://discourse.julialang.org/t/is-there-a-trick-to-input-an-expr-into-a-macro/82383 "2022-06-08T02:27:08Z")

</div>

AFAIK a macro only works like a “tag” on source code that is parsed to input expressions for the macro. Is there a way to make a macro work on an Expr instance? I’m aware that this might be a problem because macros are …

---

## [Regular grid](https://discourse.julialang.org/t/regular-grid/82371)

<div class="topic-metadata">

**Author:** [@sbrisard](https://discourse.julialang.org/u/sbrisard)\
**Replies:** 9\
**Last updated:** [June 8, 2022, 1:34am UTC](https://discourse.julialang.org/t/regular-grid/82371 "2022-06-08T01:34:25Z")

</div>

Hello there, I’m implementing Siddon’s algorithm for the calculation of the radiological path through an array of voxels. I was wondering what would be the most Juliesque way to define a regular grid? As an array of Ste…

---

## [What data structure do I need? (and is it implemented in Julia?)](https://discourse.julialang.org/t/what-data-structure-do-i-need-and-is-it-implemented-in-julia/82378)

<div class="topic-metadata">

**Author:** [@JAgho](https://discourse.julialang.org/u/JAgho)\
**Replies:** 5\
**Last updated:** [June 7, 2022, 7:43pm UTC](https://discourse.julialang.org/t/what-data-structure-do-i-need-and-is-it-implemented-in-julia/82378 "2022-06-07T19:43:46Z")

</div>

I have a collection of coordinates which is a fixed set. I collect these into groups using some arbitrary clustering scheme. Consequently I now hold some collection of arrays. I need to be able to merge groups together, …

---

## ["bad line xxx of yyy.nl file" error with AmplNLWriter (but solves with Ipopt.jl)](https://discourse.julialang.org/t/bad-line-xxx-of-yyy-nl-file-error-with-amplnlwriter-but-solves-with-ipopt-jl/82372)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [June 7, 2022, 9:25pm UTC](https://discourse.julialang.org/t/bad-line-xxx-of-yyy-nl-file-error-with-amplnlwriter-but-solves-with-ipopt-jl/82372 "2022-06-07T21:25:29Z")

</div>

The following code solves correctly using the Ipopt.jl Ipopt interface, but returns an error “bad line xxx of yyy.nl file” when I try to use the AmplNLWriter.jl interface (both using Ipopt and Ipopt\_jll). Other “basic” …

---

## [Row-wise quantile](https://discourse.julialang.org/t/row-wise-quantile/82386)

<div class="topic-metadata">

**Author:** [@gjh](https://discourse.julialang.org/u/gjh)\
**Replies:** 6\
**Last updated:** [June 7, 2022, 8:31pm UTC](https://discourse.julialang.org/t/row-wise-quantile/82386 "2022-06-07T20:31:28Z")

</div>

How can I use the quantile! function row-wise on a dataframe? df = DataFrame(A = 1:4, B = 5:8, C = 1:4, D = 5:8) For example, I would like to add a column with the 0.15 percentile for each row. Thank you for the help! …

---

## [MIT licensed code writing file in GPL licensed format](https://discourse.julialang.org/t/mit-licensed-code-writing-file-in-gpl-licensed-format/82308)

<div class="topic-metadata">

**Author:** [@Jae-Mo\_Lihm](https://discourse.julialang.org/u/Jae-Mo_Lihm)\
**Replies:** 4\
**Last updated:** [June 7, 2022, 8:14pm UTC](https://discourse.julialang.org/t/mit-licensed-code-writing-file-in-gpl-licensed-format/82308 "2022-06-07T20:14:55Z")

</div>

There is a file format whose specification is written only in a GPL-licensed code. Is it okay for me to look at that code and create a function that writes in the same format in an MIT-licensed package?

---

## [Documentation with interactive WGLMakie visualizations](https://discourse.julialang.org/t/documentation-with-interactive-wglmakie-visualizations/82300)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 5\
**Last updated:** [June 7, 2022, 8:03pm UTC](https://discourse.julialang.org/t/documentation-with-interactive-wglmakie-visualizations/82300 "2022-06-07T20:03:23Z")

</div>

I am trying to migrate all examples of Meshes.jl documentation to use WGLMakie.jl instead of CairoMakie.jl. When I generate the docs locally the visualizations show up and work nicely with interaction. However, on GitHub…

---

## [What is the equivalent of this OpenMP Directive in Julia?](https://discourse.julialang.org/t/what-is-the-equivalent-of-this-openmp-directive-in-julia/82014)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 14\
**Last updated:** [June 7, 2022, 7:13pm UTC](https://discourse.julialang.org/t/what-is-the-equivalent-of-this-openmp-directive-in-julia/82014 "2022-06-07T19:13:09Z")

</div>

What is the equivalent to the below command in Julia, in which I can run a specific code (or function) on a specific CPU core? !$OMP PARALLEL # Code !$OMP END PARALLEL

---

## [Looping over subset of array indices: Julia vs Python](https://discourse.julialang.org/t/looping-over-subset-of-array-indices-julia-vs-python/37964)

<div class="topic-metadata">

**Author:** [@snowgum](https://discourse.julialang.org/u/snowgum)\
**Replies:** 10\
**Last updated:** [June 7, 2022, 6:55pm UTC](https://discourse.julialang.org/t/looping-over-subset-of-array-indices-julia-vs-python/37964 "2022-06-07T18:55:48Z")

</div>

I am new to Julia and currently trying to emulate some practices I’m used to in Python. One problem I am struggling with is how to best iterate over some of the indices of an array. For example, consider an array with si…

---

## [Read LP files](https://discourse.julialang.org/t/read-lp-files/6877)

<div class="topic-metadata">

**Author:** [@Andrey\_Stroil](https://discourse.julialang.org/u/Andrey_Stroil)\
**Replies:** 8\
**Last updated:** [June 7, 2022, 6:47pm UTC](https://discourse.julialang.org/t/read-lp-files/6877 "2022-06-07T18:47:21Z")

</div>

Hello, I have a huge stochastic optimization model and JuMP is not fast enough to deal with it. I want to write the lp model in a file and then solve it. Does JuMP have a method like read\_LP(“file.lp”)? Or is there a be…

---

## [ProgressMeter while using DataFrame commands?](https://discourse.julialang.org/t/progressmeter-while-using-dataframe-commands/65405)

<div class="topic-metadata">

**Author:** [@joonp](https://discourse.julialang.org/u/joonp)\
**Replies:** 2\
**Last updated:** [June 7, 2022, 6:38pm UTC](https://discourse.julialang.org/t/progressmeter-while-using-dataframe-commands/65405 "2022-06-07T18:38:09Z")

</div>

Hi, I have a code chunk that uses DataFrame groupby() and combine() and that requires heavy computation for each group. I would like to see its progress such as out of n groups… how many groups have finished the computa…

---

## [Why is Traceur Warning: is assigned as Union{Nothing, Tuple{Int64, Int64}}?](https://discourse.julialang.org/t/why-is-traceur-warning-is-assigned-as-union-nothing-tuple-int64-int64/82322)

<div class="topic-metadata">

**Author:** [@peter.wolf](https://discourse.julialang.org/u/peter.wolf)\
**Replies:** 2\
**Last updated:** [June 7, 2022, 2:41pm UTC](https://discourse.julialang.org/t/why-is-traceur-warning-is-assigned-as-union-nothing-tuple-int64-int64/82322 "2022-06-07T14:41:17Z")

</div>

Hello, I am optimizing my code. I have made all the types stable according to @code\_warntype, but @trace is still giving me this warning throughout my code Warning: is assigned as Union{Nothing, Tuple{Int64, Int64}} …

---

## [Sorting Policy](https://discourse.julialang.org/t/sorting-policy/71865)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 10\
**Last updated:** [June 7, 2022, 2:29pm UTC](https://discourse.julialang.org/t/sorting-policy/71865 "2022-06-07T14:29:51Z")

</div>

What we have now: Right now Base/Sort.jl has a sorting policy implementation that is somewhat counterintuitive to me. I see three levels of function call, Keyword: sort(\[2,3,7\], by=x-\>floor(sqrt(x)), rev=true) with 1…

---

## [Small changes on large arrays of custom types: mutable or immutable? shallow or deepcopy?](https://discourse.julialang.org/t/small-changes-on-large-arrays-of-custom-types-mutable-or-immutable-shallow-or-deepcopy/82335)

<div class="topic-metadata">

**Author:** [@skraemer](https://discourse.julialang.org/u/skraemer)\
**Replies:** 3\
**Last updated:** [June 7, 2022, 12:56pm UTC](https://discourse.julialang.org/t/small-changes-on-large-arrays-of-custom-types-mutable-or-immutable-shallow-or-deepcopy/82335 "2022-06-07T12:56:51Z")

</div>

(I have previously asked this on the New to Julia category, but I think might rather belong here) There are a few things somehow all related about the following situation concerning mutability to which I can not find a …

---

## [Why the time consumed of LAPACK.potrf! increase hugely when the dimension is bigger than a special number](https://discourse.julialang.org/t/why-the-time-consumed-of-lapack-potrf-increase-hugely-when-the-dimension-is-bigger-than-a-special-number/82270)

<div class="topic-metadata">

**Author:** [@wly](https://discourse.julialang.org/u/wly)\
**Replies:** 4\
**Last updated:** [June 7, 2022, 12:51pm UTC](https://discourse.julialang.org/t/why-the-time-consumed-of-lapack-potrf-increase-hugely-when-the-dimension-is-bigger-than-a-special-number/82270 "2022-06-07T12:51:21Z")

</div>

When I use LAPACK.potrf! do Cholesky decomposition, I met this question. using StaticArrays using TimerOutputs using LinearAlgebra function test3\_1(Quu) @timeit "LAPACK.potrf!" LAPACK.potrf!('U',Quu) end n = 16 Quu1…

---

## [Selecting rows](https://discourse.julialang.org/t/selecting-rows/82369)

<div class="topic-metadata">

**Author:** [@gjh](https://discourse.julialang.org/u/gjh)\
**Replies:** 1\
**Last updated:** [June 7, 2022, 12:44pm UTC](https://discourse.julialang.org/t/selecting-rows/82369 "2022-06-07T12:44:26Z")

</div>

With this df what is an efficient way to get a new df with two copies of the x==2 row and one copy of x==3 using a needed\_rows vector? x=\[1,2,3\] y=\[“a”,“b”,“c”\] df=DataFrame(x=x, y=y) needed\_rows=\[2,2,3\] The new df …

---

## [Evaluate julia code blocks while using Markdown VSCode preview](https://discourse.julialang.org/t/evaluate-julia-code-blocks-while-using-markdown-vscode-preview/82368)

<div class="topic-metadata">

**Author:** [@natema](https://discourse.julialang.org/u/natema)\
**Replies:** 0\
**Last updated:** [June 7, 2022, 12:22pm UTC](https://discourse.julialang.org/t/evaluate-julia-code-blocks-while-using-markdown-vscode-preview/82368 "2022-06-07T12:22:56Z")

</div>

I would like to edit a .jmd file in Markdown language mode on VSCode while still being able to send cells to the REPL as when I set Julia Markdown language mode. More context. The great advantage of working with .jmd in…

---

## [Prepare self-hosted runner on Windows 10 for Github Actions and Julia private registry and packages](https://discourse.julialang.org/t/prepare-self-hosted-runner-on-windows-10-for-github-actions-and-julia-private-registry-and-packages/82367)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 0\
**Last updated:** [June 7, 2022, 12:18pm UTC](https://discourse.julialang.org/t/prepare-self-hosted-runner-on-windows-10-for-github-actions-and-julia-private-registry-and-packages/82367 "2022-06-07T12:18:01Z")

</div>

Leaving this here just as an instruction for others. I’ve tried to add Windows self-hosted runner to build and test my private package and got the following error: \> Run julia-actions/add-julia-registry@v1 C:\\Windows\\S…

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

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