# Latest

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

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

**Page:** 1105

---

## [How to define a subset of some variables integers?](https://discourse.julialang.org/t/how-to-define-a-subset-of-some-variables-integers/77443)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [March 5, 2022, 5:53pm UTC](https://discourse.julialang.org/t/how-to-define-a-subset-of-some-variables-integers/77443 "2022-03-05T17:53:12Z")

</div>

I need to define some variables as integer based on input. The following code doesn’t work as the name x is already used, and at the same time I don’t know the syntax to add it as a constraint: for a in 1:nActivities …

---

## [Make Scatter Interpolation behave like Linear Interpolation?](https://discourse.julialang.org/t/make-scatter-interpolation-behave-like-linear-interpolation/77439)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 2\
**Last updated:** [March 5, 2022, 1:00pm UTC](https://discourse.julialang.org/t/make-scatter-interpolation-behave-like-linear-interpolation/77439 "2022-03-05T13:00:09Z")

</div>

Hi all! I have a very interesting Data set to interpolate and I need a bit of help. I have 5D knots and a Value that I need interpolated. The Columns are (just for you to know) Temperature Pressure Mineral\_%1 Mineral%2…

---

## [Initialising a Constructor with an Undef value](https://discourse.julialang.org/t/initialising-a-constructor-with-an-undef-value/77438)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 1\
**Last updated:** [March 5, 2022, 8:06am UTC](https://discourse.julialang.org/t/initialising-a-constructor-with-an-undef-value/77438 "2022-03-05T08:06:13Z")

</div>

Hi, I have two Struts where one struct requires and object of the other as one of it’s fields. I am wondering how to initialise with an undef value of it. Here is an example mutable struct Casualty id::Int pos::Tupl…

---

## [\[ANN\] OutlierDetection.jl - Outlier / Anomaly Detection Ecosystem](https://discourse.julialang.org/t/ann-outlierdetection-jl-outlier-anomaly-detection-ecosystem/77422)

<div class="topic-metadata">

**Author:** [@davnn](https://discourse.julialang.org/u/davnn)\
**Replies:** 3\
**Last updated:** [March 5, 2022, 6:55am UTC](https://discourse.julialang.org/t/ann-outlierdetection-jl-outlier-anomaly-detection-ecosystem/77422 "2022-03-05T06:55:51Z")

</div>

Hi everyone, I’m happy to announce that there exists an Outlier/Anomaly Detection ecosystem for Julia now :slight\_smile:! Julia is the perfect language to develop novel outlier detection algorithms, and I hope that mor…

---

## [How to use ForwardDiff?](https://discourse.julialang.org/t/how-to-use-forwarddiff/77434)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 1\
**Last updated:** [March 5, 2022, 5:29am UTC](https://discourse.julialang.org/t/how-to-use-forwarddiff/77434 "2022-03-05T05:29:48Z")

</div>

I’m trying to learn how to use autodifferentiation for the first time since that came up in something else. What am I doing wrong? using ForwardDiff f(x) = 2x g = x -\> ForwardDiff.gradient(f, x) g(2) # DimensionMismatch…

---

## [Evaluation time of generic gradient vs gradient at a particular input using Flux.jl](https://discourse.julialang.org/t/evaluation-time-of-generic-gradient-vs-gradient-at-a-particular-input-using-flux-jl/77001)

<div class="topic-metadata">

**Author:** [@Kishore\_Nori](https://discourse.julialang.org/u/Kishore_Nori)\
**Replies:** 4\
**Last updated:** [March 5, 2022, 3:54am UTC](https://discourse.julialang.org/t/evaluation-time-of-generic-gradient-vs-gradient-at-a-particular-input-using-flux-jl/77001 "2022-03-05T03:54:59Z")

</div>

I am beginner in ML coming from the scientific computing field and getting started with Flux.jl for a simple deep learning problem (not very deep actually) with an MLP Neural Network (NN). Like the usual training approac…

---

## [Plotting points on a map](https://discourse.julialang.org/t/plotting-points-on-a-map/77284)

<div class="topic-metadata">

**Author:** [@DaWa](https://discourse.julialang.org/u/DaWa)\
**Replies:** 4\
**Last updated:** [March 5, 2022, 1:16am UTC](https://discourse.julialang.org/t/plotting-points-on-a-map/77284 "2022-03-05T01:16:06Z")

</div>

Hello all, I have some points, (longitudes and latitudes) placed in germany/european union. I want to plot them with an underlying outline of the country/countries. Currently I am using plots with the gr backend, and i…

---

## [ERROR: expected the file \`src/\*\` to exist for package \`\*\*\` at \`/tmp/\*\*\`](https://discourse.julialang.org/t/error-expected-the-file-src-to-exist-for-package-at-tmp/57314)

<div class="topic-metadata">

**Author:** [@neo\_abs](https://discourse.julialang.org/u/neo_abs)\
**Replies:** 4\
**Last updated:** [March 5, 2022, 1:54am UTC](https://discourse.julialang.org/t/error-expected-the-file-src-to-exist-for-package-at-tmp/57314 "2022-03-05T01:54:51Z")

</div>

I tried to add my own package from github repo and locally. I get the following error: ERROR: expected the file \`src/Package.jl\` to exist for package \`Package.jl\` at \`/tmp/jl\_UTO0yG\` I tried following steps in 5. Creat…

---

## [Using ccall for C function with out-parameter pointer to pointer to struct](https://discourse.julialang.org/t/using-ccall-for-c-function-with-out-parameter-pointer-to-pointer-to-struct/50999)

<div class="topic-metadata">

**Author:** [@dmillard](https://discourse.julialang.org/u/dmillard)\
**Replies:** 4\
**Last updated:** [March 5, 2022, 12:50am UTC](https://discourse.julialang.org/t/using-ccall-for-c-function-with-out-parameter-pointer-to-pointer-to-struct/50999 "2022-03-05T00:50:35Z")

</div>

Hi, I’m wrapping libfreenect into Julia. The excellent BinaryBuilder maintainers have helped me get a jll into Yggdrasil, but now I’m working on a more Julian wrapper. One of the functions I’m wrapping takes a pointer t…

---

## [How to optimize multiple times in a run](https://discourse.julialang.org/t/how-to-optimize-multiple-times-in-a-run/75118)

<div class="topic-metadata">

**Author:** [@Anjinsan](https://discourse.julialang.org/u/Anjinsan)\
**Replies:** 4\
**Last updated:** [March 4, 2022, 11:43pm UTC](https://discourse.julialang.org/t/how-to-optimize-multiple-times-in-a-run/75118 "2022-03-04T23:43:52Z")

</div>

Hello, I’m completely new to Julia / JuMP. I’m working on writing least-cost dispatch code for a power system. I want to load in data for one year (8760 hours), but have the model optimize only one day at a time. Wha…

---

## [Information for Julia community in Ukraine](https://discourse.julialang.org/t/information-for-julia-community-in-ukraine/77118)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 10\
**Last updated:** [March 4, 2022, 11:34pm UTC](https://discourse.julialang.org/t/information-for-julia-community-in-ukraine/77118 "2022-03-04T23:34:48Z")

</div>

I live in Poland in Cracov and I still have one free room in my flat. If someone here is from Ukraine and need place to stay for himself/herself or they loved ones, feel free to write to me. I will try help as much as I …

---

## [Extract rpm from tachometer signal](https://discourse.julialang.org/t/extract-rpm-from-tachometer-signal/77329)

<div class="topic-metadata">

**Author:** [@cmtasso](https://discourse.julialang.org/u/cmtasso)\
**Replies:** 14\
**Last updated:** [March 4, 2022, 11:15pm UTC](https://discourse.julialang.org/t/extract-rpm-from-tachometer-signal/77329 "2022-03-04T23:15:11Z")

</div>

Hi guys… I need to extract a tachometer signal (pulses) and convert it to rpm. Would anyone know how to help write this script? In this case, the script is used within the Sigview software, which allows the use of the …

---

## [UndefVarError for Type Variable](https://discourse.julialang.org/t/undefvarerror-for-type-variable/77419)

<div class="topic-metadata">

**Author:** [@ps-pat](https://discourse.julialang.org/u/ps-pat)\
**Replies:** 6\
**Last updated:** [March 4, 2022, 9:50pm UTC](https://discourse.julialang.org/t/undefvarerror-for-type-variable/77419 "2022-03-04T21:50:19Z")

</div>

I’m sure I’m missing something obvious, but here we go. I defined methods that dispatch on the type of various “special matrices” from LinearAlgebra. Here is a MWE: using LinearAlgebra for type ∈ \[:Symmetric, :LowerTri…

---

## [Using \`plotlyjs\` backend inside Pluto notebook](https://discourse.julialang.org/t/using-plotlyjs-backend-inside-pluto-notebook/77420)

<div class="topic-metadata">

**Author:** [@amit1](https://discourse.julialang.org/u/amit1)\
**Replies:** 2\
**Last updated:** [March 4, 2022, 8:10pm UTC](https://discourse.julialang.org/t/using-plotlyjs-backend-inside-pluto-notebook/77420 "2022-03-04T20:10:17Z")

</div>

I have a Pluto notebook that grew somewhat in size, and now I want to plot some data in it. If I give plotlyjs() backend selection command in notebook I get error saying PlutoJS could not be found in environment. Which, …

---

## [Dispatch on enum](https://discourse.julialang.org/t/dispatch-on-enum/77398)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 7\
**Last updated:** [March 4, 2022, 5:17pm UTC](https://discourse.julialang.org/t/dispatch-on-enum/77398 "2022-03-04T17:17:40Z")

</div>

Hey all :slight\_smile: Is it possible to dispatch a function on different enum instances. Something like this: julia\> @enum E a b julia\> f(::Type{a}) = :a julia\> f(::Type{b}) = :b julia\> f(a) :a

---

## [Makie - Colorbar crashing saving figure](https://discourse.julialang.org/t/makie-colorbar-crashing-saving-figure/76983)

<div class="topic-metadata">

**Author:** [@Herve](https://discourse.julialang.org/u/Herve)\
**Replies:** 6\
**Last updated:** [March 4, 2022, 5:09pm UTC](https://discourse.julialang.org/t/makie-colorbar-crashing-saving-figure/76983 "2022-03-04T17:09:48Z")

</div>

Hi, I am using Makie for displaying finite element computations with Gridap.jl. Works fine with GLMakie, but the use of “colorbar” crashes with CairoMakie (with exactly the same code as for GLMakie). Any clue ?

---

## [Adjoint for Base.TwicePrecision](https://discourse.julialang.org/t/adjoint-for-base-twiceprecision/77052)

<div class="topic-metadata">

**Author:** [@lxvm](https://discourse.julialang.org/u/lxvm)\
**Replies:** 1\
**Last updated:** [March 4, 2022, 5:03pm UTC](https://discourse.julialang.org/t/adjoint-for-base-twiceprecision/77052 "2022-03-04T17:03:23Z")

</div>

Hello, I would like to define an adjoint for Base.TwicePrecision though I was wondering if it can be done given the following test julia\> using Zygote julia\> gradient(x -\> Float64(sum(map(i -\> i\*Base.TwicePrecision(x)…

---

## [Alternatives to zero-padding conv layers?](https://discourse.julialang.org/t/alternatives-to-zero-padding-conv-layers/73488)

<div class="topic-metadata">

**Author:** [@czexana](https://discourse.julialang.org/u/czexana)\
**Replies:** 3\
**Last updated:** [March 4, 2022, 4:59pm UTC](https://discourse.julialang.org/t/alternatives-to-zero-padding-conv-layers/73488 "2022-03-04T16:59:12Z")

</div>

Is there a way to use same-padding or reflection-padding in Flux convolutional layers, such as NNlib.jl supplies in https://github.com/FluxML/NNlib.jl/blob/master/src/padding.jl, rather than only using zero-padding? I’m…

---

## [Convert Symbolics.jl expression to plottable function](https://discourse.julialang.org/t/convert-symbolics-jl-expression-to-plottable-function/77411)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 1\
**Last updated:** [March 4, 2022, 4:12pm UTC](https://discourse.julialang.org/t/convert-symbolics-jl-expression-to-plottable-function/77411 "2022-03-04T16:12:28Z")

</div>

The solution here isn’t working for me. I am getting “not a valid function argument name” error when trying to use built function. julia\> using Symbolics, UnicodePlots julia\> @variables a x b 3-element Vector{Num}: a …

---

## [Conversion while constructing object](https://discourse.julialang.org/t/conversion-while-constructing-object/77401)

<div class="topic-metadata">

**Author:** [@KDr2](https://discourse.julialang.org/u/KDr2)\
**Replies:** 5\
**Last updated:** [March 4, 2022, 3:07pm UTC](https://discourse.julialang.org/t/conversion-while-constructing-object/77401 "2022-03-04T15:07:02Z")

</div>

Hi, does anyone know in the code below, why #2 has convert called and how to avoid it? struct S{T} i::T end mutable struct Box{T} i::T end function Base.convert(::Type{S{T1}}, d::S{T2}) where {T1, T2} prin…

---

## [Enforce interface implementation](https://discourse.julialang.org/t/enforce-interface-implementation/52872)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 26\
**Last updated:** [March 4, 2022, 3:01pm UTC](https://discourse.julialang.org/t/enforce-interface-implementation/52872 "2022-03-04T15:01:22Z")

</div>

I’m trying to refactor GenericInstruments.jl in order to play nicer with instrument front panels GUIs for our online university labs. The problem is the following: different instruments keep popping up and the code need…

---

## [Custom ChainRulesCore rrule with ReverseDiff](https://discourse.julialang.org/t/custom-chainrulescore-rrule-with-reversediff/77389)

<div class="topic-metadata">

**Author:** [@smharwood](https://discourse.julialang.org/u/smharwood)\
**Replies:** 2\
**Last updated:** [March 4, 2022, 2:50pm UTC](https://discourse.julialang.org/t/custom-chainrulescore-rrule-with-reversediff/77389 "2022-03-04T14:50:43Z")

</div>

I’m having trouble finding documentation to get ReverseDiff to use a custom adjoint defined using ChainRulesCore.rrule. MWE: import Zygote, ReverseDiff import ChainRulesCore function f(x) x'\*x end function ChainRulesC…

---

## [VS Code constant pain point](https://discourse.julialang.org/t/vs-code-constant-pain-point/77388)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [March 4, 2022, 2:43pm UTC](https://discourse.julialang.org/t/vs-code-constant-pain-point/77388 "2022-03-04T14:43:19Z")

</div>

I like a lot of things about Julia in VS Code, but one thing where it constantly falls short is lookup of symbols defined in user packages. Standard-library code is fine but the user code is always a problem As th…

---

## [Optimization Error:](https://discourse.julialang.org/t/optimization-error/77358)

<div class="topic-metadata">

**Author:** [@Eriklw](https://discourse.julialang.org/u/Eriklw)\
**Replies:** 4\
**Last updated:** [March 4, 2022, 2:26pm UTC](https://discourse.julialang.org/t/optimization-error/77358 "2022-03-04T14:26:02Z")

</div>

I am minimizing a function with the Optim package. I am supplying a gradient (that is calculated using AD). I am using the LBFGS() option. However the following error keeps occuring: AssertionError: isfinite(phi\_c) && i…

---

## [Importing data with ambiguous dates](https://discourse.julialang.org/t/importing-data-with-ambiguous-dates/77391)

<div class="topic-metadata">

**Author:** [@George\_Githinji](https://discourse.julialang.org/u/George_Githinji)\
**Replies:** 3\
**Last updated:** [March 4, 2022, 2:22pm UTC](https://discourse.julialang.org/t/importing-data-with-ambiguous-dates/77391 "2022-03-04T14:22:51Z")

</div>

I have a large data-set with date columns in the format yyyy-mm-dd. The challenge is that some of the rows have dates that are ambiguous and contain either the yyyy e.g. 2019 or yyyy-mm e.g. 2019-09. I would like to imp…

---

## [Using Unified Memory with oversubscription](https://discourse.julialang.org/t/using-unified-memory-with-oversubscription/77348)

<div class="topic-metadata">

**Author:** [@anscoil](https://discourse.julialang.org/u/anscoil)\
**Replies:** 3\
**Last updated:** [March 4, 2022, 2:07pm UTC](https://discourse.julialang.org/t/using-unified-memory-with-oversubscription/77348 "2022-03-04T14:07:24Z")

</div>

Hi, I recently learnt the existence of Unified Memory in Cuda, and I’m trying to explore what is possible to do with it in Julia. I would like to use it with oversubsciption, for instance by allocating one array that i…

---

## [GPU performance evaluation exceeds target peakflop using CUDA.jl](https://discourse.julialang.org/t/gpu-performance-evaluation-exceeds-target-peakflop-using-cuda-jl/59092)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 6\
**Last updated:** [March 4, 2022, 2:03pm UTC](https://discourse.julialang.org/t/gpu-performance-evaluation-exceeds-target-peakflop-using-cuda-jl/59092 "2022-03-04T14:03:12Z")

</div>

Hi, I use the following kernel (weirdly adding n\_{nin}\*(n\_{nin}-1)/2 to array elements) in order to evaluate the peak performance of my GPU : # CPU bound kernel for large enough values of nin function kernel\_compute\_bo…

---

## [Changing array values in place when embedding in C++](https://discourse.julialang.org/t/changing-array-values-in-place-when-embedding-in-c/77248)

<div class="topic-metadata">

**Author:** [@cloclo](https://discourse.julialang.org/u/cloclo)\
**Replies:** 4\
**Last updated:** [March 4, 2022, 1:52pm UTC](https://discourse.julialang.org/t/changing-array-values-in-place-when-embedding-in-c/77248 "2022-03-04T13:52:46Z")

</div>

Hello, I may be missing the obvious here, hopefully someone can point it out to me: when calling a custom julia function from C++ passing an array of doubles, the array values should be changed in place but is not. For…

---

## [Coverage and precompilation](https://discourse.julialang.org/t/coverage-and-precompilation/77324)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 6\
**Last updated:** [March 4, 2022, 12:46pm UTC](https://discourse.julialang.org/t/coverage-and-precompilation/77324 "2022-03-04T12:46:26Z")

</div>

Hi! When I add precompilation statements from SnoopCompile, I start to see weird coverage results. Take a look here: Everything seems fine when I remove those statements. I saw that this can be improved if I run Ju…

---

## [Best practice to use lots of pre-allocated arrays in a function](https://discourse.julialang.org/t/best-practice-to-use-lots-of-pre-allocated-arrays-in-a-function/77353)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 7\
**Last updated:** [March 4, 2022, 12:32pm UTC](https://discourse.julialang.org/t/best-practice-to-use-lots-of-pre-allocated-arrays-in-a-function/77353 "2022-03-04T12:32:10Z")

</div>

I am still quite new to Julia, working on numerical modeling and I am starting to write a bigger project than usual. I have a function that takes, as arguments, lots of pre-allocated arrays and parameters and update the…

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

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