# Latest

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

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

**Page:** 811

---

## [Difference b/w @threads and @spawn macros](https://discourse.julialang.org/t/difference-b-w-threads-and-spawn-macros/92984)

<div class="topic-metadata">

**Author:** [@sajjad\_khan](https://discourse.julialang.org/u/sajjad_khan)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 8:28am UTC](https://discourse.julialang.org/t/difference-b-w-threads-and-spawn-macros/92984 "2023-01-17T08:28:11Z")

</div>

What the difference b/w @threads and @spawn? It’s mentioned somewhere that @spawn spawns just one task thread. If so then how it can be different than @threads?

---

## [I want to plot a Sphere with Two Parallel Planes with PlotlyJS in 3D](https://discourse.julialang.org/t/i-want-to-plot-a-sphere-with-two-parallel-planes-with-plotlyjs-in-3d/93070)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 7:48am UTC](https://discourse.julialang.org/t/i-want-to-plot-a-sphere-with-two-parallel-planes-with-plotlyjs-in-3d/93070 "2023-01-17T07:48:27Z")

</div>

Hi all, I want to plot a sphere and two planes that are parallel to each other, here is how it looks like from the slice of the sphere, the circle: I try to read this: this is my code and unable to plot the planes…

---

## [Flux on gpu and inference optimization](https://discourse.julialang.org/t/flux-on-gpu-and-inference-optimization/93016)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 7:38am UTC](https://discourse.julialang.org/t/flux-on-gpu-and-inference-optimization/93016 "2023-01-17T07:38:59Z")

</div>

Hi, I’m currently running an Alphazero replica with Flux. As you may know most of the time is spent during selfplay and essentially doing neural network inferences. I’m currently using a batchsize of 512 and when mesuri…

---

## [Symbolics and ModelingToolkit](https://discourse.julialang.org/t/symbolics-and-modelingtoolkit/93010)

<div class="topic-metadata">

**Author:** [@Daniel\_Lewis](https://discourse.julialang.org/u/Daniel_Lewis)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 6:59am UTC](https://discourse.julialang.org/t/symbolics-and-modelingtoolkit/93010 "2023-01-17T06:59:13Z")

</div>

hi, i’m trying to simulate a cart pole using the code example taken from this topic. my code looks like this: using Symbolics, Plots, DifferentialEquations, ModelingToolkit n = 2 # number of general coordinates vars…

---

## [How to use Parametric Structs with Unitful](https://discourse.julialang.org/t/how-to-use-parametric-structs-with-unitful/93049)

<div class="topic-metadata">

**Author:** [@FelixHeox](https://discourse.julialang.org/u/FelixHeox)\
**Replies:** 3\
**Last updated:** [January 17, 2023, 6:55am UTC](https://discourse.julialang.org/t/how-to-use-parametric-structs-with-unitful/93049 "2023-01-17T06:55:36Z")

</div>

I am trying to create a package that solves the kinematics of a closed mechanism. The mechanism type consists of a list of link types that I have also defined parametricly: abstract type Link end struct BarLink{T} \<: L…

---

## [Is there a way to remove a certain type from a Union of types?](https://discourse.julialang.org/t/is-there-a-way-to-remove-a-certain-type-from-a-union-of-types/42094)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [January 17, 2023, 6:48am UTC](https://discourse.julialang.org/t/is-there-a-way-to-remove-a-certain-type-from-a-union-of-types/42094 "2023-01-17T06:48:21Z")

</div>

Eg. given Union{Int,Float64,String} I want to obtain Union{Int,Float64} by removing String. Is there a way to carry this out?

---

## [Aligning Multi-line Text (in Makie)](https://discourse.julialang.org/t/aligning-multi-line-text-in-makie/93012)

<div class="topic-metadata">

**Author:** [@Whyborn](https://discourse.julialang.org/u/Whyborn)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 4:44am UTC](https://discourse.julialang.org/t/aligning-multi-line-text-in-makie/93012 "2023-01-17T04:44:32Z")

</div>

Hi, Is it possible to do multiline text alignment in Makie plots LaTeX equation style? For example, describing some fluid conditions, I would like to write text something like: text!(ax, location, text = "p=100kPa\\nT=3…

---

## [LibSSL Undefined Symbol error when installing Genie Builder](https://discourse.julialang.org/t/libssl-undefined-symbol-error-when-installing-genie-builder/92637)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 2:04am UTC](https://discourse.julialang.org/t/libssl-undefined-symbol-error-when-installing-genie-builder/92637 "2023-01-17T02:04:52Z")

</div>

I am trying to install the Genie web framework and use the Genie Builder extension in VSCode. But I am hitting an error, and I can’t quite tell if it is a Genie issue or a more generic Julia issue. The core of the error …

---

## [Tuple with conditional entries](https://discourse.julialang.org/t/tuple-with-conditional-entries/93052)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 3\
**Last updated:** [January 17, 2023, 2:02am UTC](https://discourse.julialang.org/t/tuple-with-conditional-entries/93052 "2023-01-17T02:02:39Z")

</div>

Is it possible create a tuple with the existence of entries conditioned on some variables? I.e. what I want is something like mytuple = (42 if condition1, pi condition2 ) # == (42, pi) if condition1 and condition2 are …

---

## [How to onehot encode batches of sequences?](https://discourse.julialang.org/t/how-to-onehot-encode-batches-of-sequences/33237)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 12:37am UTC](https://discourse.julialang.org/t/how-to-onehot-encode-batches-of-sequences/33237 "2023-01-17T00:37:40Z")

</div>

Is there a recommended way to one-hot encode a batch of sequences? More precisely, I am modelling sequences from an alphabet with q letters. A sequence of length N can be one-hot encoded as a q x N one-hot matrix (e.g.,…

---

## [WARNING: both IntervalArithmetic and Measurements export "±"](https://discourse.julialang.org/t/warning-both-intervalarithmetic-and-measurements-export/93053)

<div class="topic-metadata">

**Author:** [@conalbrown](https://discourse.julialang.org/u/conalbrown)\
**Replies:** 3\
**Last updated:** [January 16, 2023, 11:39pm UTC](https://discourse.julialang.org/t/warning-both-intervalarithmetic-and-measurements-export/93053 "2023-01-16T23:39:51Z")

</div>

I trying to learn about intervals in a Pluto notebook using both IntervalArithmetic and Measurements. I understandably get the error in the thread title when I try to use ± to replicate the notebook extract here: https…

---

## [Constant propagation of function of type](https://discourse.julialang.org/t/constant-propagation-of-function-of-type/92963)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 3\
**Last updated:** [January 16, 2023, 11:34pm UTC](https://discourse.julialang.org/t/constant-propagation-of-function-of-type/92963 "2023-01-16T23:34:58Z")

</div>

Suppose I have a function function f(args...) X = g(typeof(args)) # do stuff with X and args.. end The function g is fairly complicated (performs a recursive walk of a tuple type-type), but ultimately it is p…

---

## [Axis labels in makie.jl 3d plots](https://discourse.julialang.org/t/axis-labels-in-makie-jl-3d-plots/93050)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 0\
**Last updated:** [January 16, 2023, 9:19pm UTC](https://discourse.julialang.org/t/axis-labels-in-makie-jl-3d-plots/93050 "2023-01-16T21:19:42Z")

</div>

I have a very basic question about plotting 3D data using Makie.jl. How to set the axes labels? An MWE is provided below: using CairoMakie using Random fig = scatter(rand(10), rand(10), rand(10)) xlabel!("label-1") yl…

---

## [State of Diffractor.jl](https://discourse.julialang.org/t/state-of-diffractor-jl/92959)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 4\
**Last updated:** [January 16, 2023, 7:27pm UTC](https://discourse.julialang.org/t/state-of-diffractor-jl/92959 "2023-01-16T19:27:40Z")

</div>

Hello everyone, does someone know whats the state of Diffractor.jl is? I saw many posts from 2021, saying that it would be soon avaible. The current versioin of Diffractor.jl in the repo has a julia version depencey of…

---

## [Flux Conv layer method error](https://discourse.julialang.org/t/flux-conv-layer-method-error/92937)

<div class="topic-metadata">

**Author:** [@zeio](https://discourse.julialang.org/u/zeio)\
**Replies:** 4\
**Last updated:** [January 16, 2023, 9:46pm UTC](https://discourse.julialang.org/t/flux-conv-layer-method-error/92937 "2023-01-16T21:46:03Z")

</div>

Hi, I am trying to implement a simple train loop in julia to process images, but can’t make my model work. I create the model using the following code: model = Chain( Conv((3, 3), 3 =\> 32, relu; pad = (1, 1), bias =…

---

## [Questions about string](https://discourse.julialang.org/t/questions-about-string/88604)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 21\
**Last updated:** [January 16, 2023, 8:23pm UTC](https://discourse.julialang.org/t/questions-about-string/88604 "2023-01-16T20:23:06Z")

</div>

I want the number before the string c= “9S8M13S” 's S and then return 9 and 13.And I tried following. julia\> c="9S8M13S" "9S8M13S" julia\> fs=findall(r"\\d\*S",c) 2-element Vector{UnitRange{Int64}}: 1:2 5:7 julia\> first…

---

## [Random memory access performance - how to hint compiler/runtime to preload/cache/plan](https://discourse.julialang.org/t/random-memory-access-performance-how-to-hint-compiler-runtime-to-preload-cache-plan/93046)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 0\
**Last updated:** [January 16, 2023, 8:04pm UTC](https://discourse.julialang.org/t/random-memory-access-performance-how-to-hint-compiler-runtime-to-preload-cache-plan/93046 "2023-01-16T20:04:42Z")

</div>

Hi, I have some constant size matrices (so I use StaticArrays package, verified it’s faster than Array/Vector) which I access many times randomly in a loop. After random reads/writes, I need to copy a part of one array…

---

## [PlotlyJS/WebIO on AWS SageMaker Studio](https://discourse.julialang.org/t/plotlyjs-webio-on-aws-sagemaker-studio/93045)

<div class="topic-metadata">

**Author:** [@sh2pro](https://discourse.julialang.org/u/sh2pro)\
**Replies:** 0\
**Last updated:** [January 16, 2023, 7:44pm UTC](https://discourse.julialang.org/t/plotlyjs-webio-on-aws-sagemaker-studio/93045 "2023-01-16T19:44:14Z")

</div>

Hi, I’m trying to set up a Julia environment on SageMaker Studio. I’ve set up an image, basically taken from this sample. However, I’m having difficultly in getting PlotlyJS to work. My Dockerfile is essentially: FR…

---

## [Creating a Binary Vector from a ZIP File](https://discourse.julialang.org/t/creating-a-binary-vector-from-a-zip-file/93044)

<div class="topic-metadata">

**Author:** [@maxstb11](https://discourse.julialang.org/u/maxstb11)\
**Replies:** 0\
**Last updated:** [January 16, 2023, 7:42pm UTC](https://discourse.julialang.org/t/creating-a-binary-vector-from-a-zip-file/93044 "2023-01-16T19:42:28Z")

</div>

Hello everyone, I have an Issue getting the correct binary Vector of a ZIP File when using the Package ZipFile.jl I want to use the GoogleCloud.jl Package to upload a zip file. Since the insert method only allows to pa…

---

## [How to create a non-standard string literal with parameters in Julia?](https://discourse.julialang.org/t/how-to-create-a-non-standard-string-literal-with-parameters-in-julia/93037)

<div class="topic-metadata">

**Author:** [@Flavio\_Barros](https://discourse.julialang.org/u/Flavio_Barros)\
**Replies:** 8\
**Last updated:** [January 16, 2023, 7:29pm UTC](https://discourse.julialang.org/t/how-to-create-a-non-standard-string-literal-with-parameters-in-julia/93037 "2023-01-16T19:29:59Z")

</div>

Can someone answer my question o Stack Overflow: How to create a non-standard string literal with parameters in Julia?

---

## [Create API endpoint to run arbitrary Julia code](https://discourse.julialang.org/t/create-api-endpoint-to-run-arbitrary-julia-code/92246)

<div class="topic-metadata">

**Author:** [@Flavio\_Barros](https://discourse.julialang.org/u/Flavio_Barros)\
**Replies:** 5\
**Last updated:** [January 16, 2023, 6:53pm UTC](https://discourse.julialang.org/t/create-api-endpoint-to-run-arbitrary-julia-code/92246 "2023-01-16T18:53:58Z")

</div>

Hello, I’m learning Julia and didn’t find in my research a way to solve a problem: I need to create an API endpoint that receives Julia code, run it on the server and return the output as JSON for example. In R I use Rse…

---

## [Gradient calculation in PINN](https://discourse.julialang.org/t/gradient-calculation-in-pinn/61525)

<div class="topic-metadata">

**Author:** [@JunichiFukui](https://discourse.julialang.org/u/JunichiFukui)\
**Replies:** 5\
**Last updated:** [January 16, 2023, 6:02pm UTC](https://discourse.julialang.org/t/gradient-calculation-in-pinn/61525 "2023-01-16T18:02:50Z")

</div>

Hi, everyone, I am trying to build a Physics Informed Neural Network (PINN) for solving the Navier-Stokes equations like NVidia SimNet using Flux. The input of the neural network is the position X\_i, Y\_i, Z\_i of each po…

---

## [Associate Research Physicist (post-doc) in stellarator modeling/HPC developer at PPPL](https://discourse.julialang.org/t/associate-research-physicist-post-doc-in-stellarator-modeling-hpc-developer-at-pppl/93035)

<div class="topic-metadata">

**Author:** [@benjaminfaber](https://discourse.julialang.org/u/benjaminfaber)\
**Replies:** 0\
**Last updated:** [January 16, 2023, 5:53pm UTC](https://discourse.julialang.org/t/associate-research-physicist-post-doc-in-stellarator-modeling-hpc-developer-at-pppl/93035 "2023-01-16T17:53:14Z")

</div>

The Princeton Plasma Physics Laboratory (PPPL) is hiring a post-doc to join the M3D-C1 team and lead the development of new stellarator modeling capabilities in M3D-C1. The initial focus will be on implementing a model f…

---

## [Defining a history function for Delay Differential Equations using past data points](https://discourse.julialang.org/t/defining-a-history-function-for-delay-differential-equations-using-past-data-points/92935)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 3\
**Last updated:** [January 16, 2023, 3:52pm UTC](https://discourse.julialang.org/t/defining-a-history-function-for-delay-differential-equations-using-past-data-points/92935 "2023-01-16T15:52:58Z")

</div>

I was trying to figure out how to define delay differential equations using DifferentialEquations.jl, but even after reading through the documentation, I am somewhat confused on how to define the history function. I am s…

---

## [Extracting ODEProblem formulas and passing them to JuMP NLExpressions](https://discourse.julialang.org/t/extracting-odeproblem-formulas-and-passing-them-to-jump-nlexpressions/92910)

<div class="topic-metadata">

**Author:** [@zornsllama](https://discourse.julialang.org/u/zornsllama)\
**Replies:** 4\
**Last updated:** [January 16, 2023, 3:52pm UTC](https://discourse.julialang.org/t/extracting-odeproblem-formulas-and-passing-them-to-jump-nlexpressions/92910 "2023-01-16T15:52:21Z")

</div>

I am trying to write a code that extracts a model’s equations from a DiffEq.jl ODEProblem or ModelingToolkit.jl ODESystem and copies them into JuMP.jl NLExpressions for use in nonlinear programming. In particular, I need…

---

## [SVD on a matrix that does not fit into memory](https://discourse.julialang.org/t/svd-on-a-matrix-that-does-not-fit-into-memory/92802)

<div class="topic-metadata">

**Author:** [@aasdelat](https://discourse.julialang.org/u/aasdelat)\
**Replies:** 20\
**Last updated:** [January 16, 2023, 3:44pm UTC](https://discourse.julialang.org/t/svd-on-a-matrix-that-does-not-fit-into-memory/92802 "2023-01-16T15:44:17Z")

</div>

I am looking for a function that makes a SVD on a matrix that does not fit into memory. I am interested in using just one computer, although an answer for a cluster can be useful for other users. The python dask package…

---

## [3 yaxes with Makie?](https://discourse.julialang.org/t/3-yaxes-with-makie/93032)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [January 16, 2023, 3:42pm UTC](https://discourse.julialang.org/t/3-yaxes-with-makie/93032 "2023-01-16T15:42:36Z")

</div>

Is it possible to make 3 or more y-axes with Makie.jl? You can plot the data but how to move the spines? fig=Figure() ax11 = Axis(fig\[1,1\], ylabel="Series 1") lines!(cumsum(randn(1000))) ax12 = Axis(fig\[1,1\], yticklabel…

---

## [How do I make sure that GPU functions use the maximum potential config for performance?](https://discourse.julialang.org/t/how-do-i-make-sure-that-gpu-functions-use-the-maximum-potential-config-for-performance/92989)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 3\
**Last updated:** [January 16, 2023, 3:13pm UTC](https://discourse.julialang.org/t/how-do-i-make-sure-that-gpu-functions-use-the-maximum-potential-config-for-performance/92989 "2023-01-16T15:13:07Z")

</div>

Hello! I am doing some programming on GPU using CUDA. Instead of writing kernels I am doing the recommended approach of using commonly available functions for GPU programming in CUDA.jl such as “.”, “map” etc. I notic…

---

## [How to get username?](https://discourse.julialang.org/t/how-to-get-username/93023)

<div class="topic-metadata">

**Author:** [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Replies:** 6\
**Last updated:** [January 16, 2023, 2:52pm UTC](https://discourse.julialang.org/t/how-to-get-username/93023 "2023-01-16T14:52:02Z")

</div>

How do I get the username of the user running the julia process? On Linux I can do ENV\["USER"\] and on Windows: ENV\["USERNAME"\] But I don’t know what to do on other operating systems. What is the os-independent way …

---

## [Code obfuscation | Using the \`--strip-ir\` option in PackageCompiler.jl](https://discourse.julialang.org/t/code-obfuscation-using-the-strip-ir-option-in-packagecompiler-jl/91426)

<div class="topic-metadata">

**Author:** [@hayk](https://discourse.julialang.org/u/hayk)\
**Replies:** 2\
**Last updated:** [January 16, 2023, 2:09pm UTC](https://discourse.julialang.org/t/code-obfuscation-using-the-strip-ir-option-in-packagecompiler-jl/91426 "2023-01-16T14:09:24Z")

</div>

I would like to distribute my package while hiding the source code. I came across PackageCompiler.jl and julia’s --strip-ir option to help, but when I load a sysimage generated using that option, I get an error that some…

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

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