# Latest

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

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

**Page:** 813

---

## [It work, \`global VAR = include("global\_var.jl")\` but is it correct?](https://discourse.julialang.org/t/it-work-global-var-include-global-var-jl-but-is-it-correct/92972)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 1\
**Last updated:** [January 15, 2023, 2:34am UTC](https://discourse.julialang.org/t/it-work-global-var-include-global-var-jl-but-is-it-correct/92972 "2023-01-15T02:34:58Z")

</div>

\# global\_var.jl : \[ 1, 2, 3, # ... \] global VAR = include("global\_var.jl") it work, but is it correct ?

---

## [Get the decimal part of a number](https://discourse.julialang.org/t/get-the-decimal-part-of-a-number/78282)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 7\
**Last updated:** [January 15, 2023, 2:14am UTC](https://discourse.julialang.org/t/get-the-decimal-part-of-a-number/78282 "2023-01-15T02:14:07Z")

</div>

Is there a function in Base Julia to get the decimal part of a number? I feel like I’ve seen that function before, but now I can’t find it. For example, I would like the following: julia\> x = 12.345; julia\> foo(x) 0.34…

---

## [How is the type of a heterogeneous vector determined when splatting and doing list comprehension?](https://discourse.julialang.org/t/how-is-the-type-of-a-heterogeneous-vector-determined-when-splatting-and-doing-list-comprehension/92572)

<div class="topic-metadata">

**Author:** [@arnelg](https://discourse.julialang.org/u/arnelg)\
**Replies:** 9\
**Last updated:** [January 15, 2023, 1:48am UTC](https://discourse.julialang.org/t/how-is-the-type-of-a-heterogeneous-vector-determined-when-splatting-and-doing-list-comprehension/92572 "2023-01-15T01:48:09Z")

</div>

Consider the type of the resulting Vector in these three cases: \[1, 1.0\] # case 1: Vector{Float64}, elements are promoted v = Any\[1, 1.0\] \[v...\] # case 2: gives identical result to case 1 \[x for x in v\] # case 3: Vec…

---

## [How to "reduce" an array?](https://discourse.julialang.org/t/how-to-reduce-an-array/92945)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 19\
**Last updated:** [January 14, 2023, 10:58pm UTC](https://discourse.julialang.org/t/how-to-reduce-an-array/92945 "2023-01-14T22:58:13Z")

</div>

Hello The wording is a bit bad in the title and I struggle to explain what I want to do properly, but basically what I want to do is; Suppose I have an array I consisting of indices: I = \[1 1 1 2 2 2 3 3 3\] And an ar…

---

## [Unitful.jl: typeof() vs manually given types](https://discourse.julialang.org/t/unitful-jl-typeof-vs-manually-given-types/92957)

<div class="topic-metadata">

**Author:** [@DOT](https://discourse.julialang.org/u/DOT)\
**Replies:** 4\
**Last updated:** [January 14, 2023, 8:38pm UTC](https://discourse.julialang.org/t/unitful-jl-typeof-vs-manually-given-types/92957 "2023-01-14T20:38:22Z")

</div>

Taking typeof() of some quantity, vs copy+pasting the output as a type definition – these two don’t seem to be equivalent: \> typeof(1.0s) Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}} \> 1.0s isa typeof(1.0s…

---

## [Rounding the coefficients of a minimax polynomial](https://discourse.julialang.org/t/rounding-the-coefficients-of-a-minimax-polynomial/92873)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 19\
**Last updated:** [January 14, 2023, 7:05pm UTC](https://discourse.julialang.org/t/rounding-the-coefficients-of-a-minimax-polynomial/92873 "2023-01-14T19:05:46Z")

</div>

I’m making a Julia package for automating implementation of univariate real functions using polynomial approximation, but I’m having trouble with rounding the coefficients after a minimax polynomial is found, while prese…

---

## [Exception in Sankey Diagram in Pluto](https://discourse.julialang.org/t/exception-in-sankey-diagram-in-pluto/92955)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 3\
**Last updated:** [January 14, 2023, 2:36pm UTC](https://discourse.julialang.org/t/exception-in-sankey-diagram-in-pluto/92955 "2023-01-14T14:36:05Z")

</div>

I am getting this exception in Pluto while using SankeyPlots. Although i am getting correct sankey plot. Failed to guesstimate plot size exception MethodError: no method matching length(::Nothing) Closest candidates…

---

## [Writing a static function](https://discourse.julialang.org/t/writing-a-static-function/92882)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 22\
**Last updated:** [January 14, 2023, 2:28pm UTC](https://discourse.julialang.org/t/writing-a-static-function/92882 "2023-01-14T14:28:21Z")

</div>

Is it possible to write a static function in Julia with functionality similar to that in C++? function tst\_static() static int count = 0 count = count + 1 println("count = ", count) end for i in \[1,2,3\]:…

---

## [More informative Project.toml or partial Manifest.toml](https://discourse.julialang.org/t/more-informative-project-toml-or-partial-manifest-toml/92804)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 4\
**Last updated:** [January 14, 2023, 9:08am UTC](https://discourse.julialang.org/t/more-informative-project-toml-or-partial-manifest-toml/92804 "2023-01-14T09:08:44Z")

</div>

In the realm of unregisted and local packages, it’s quite common to always carry around the Manifest.toml file. That is because it’s the only way to inform julia about the whereabouts of a package that is not in the publ…

---

## [Suppressing numbers in Franklin as default behavior](https://discourse.julialang.org/t/suppressing-numbers-in-franklin-as-default-behavior/92907)

<div class="topic-metadata">

**Author:** [@guille](https://discourse.julialang.org/u/guille)\
**Replies:** 2\
**Last updated:** [January 14, 2023, 6:20am UTC](https://discourse.julialang.org/t/suppressing-numbers-in-franklin-as-default-behavior/92907 "2023-01-14T06:20:58Z")

</div>

I was wondering if it was possible to universally suppress numberings of equations in Franklin, by chance? In particular, it would be awesome if there was a way to have the behavior of KaTeX and/or Franklin mimic the usu…

---

## [Let statement cannot use return](https://discourse.julialang.org/t/let-statement-cannot-use-return/92948)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 1\
**Last updated:** [January 14, 2023, 2:36am UTC](https://discourse.julialang.org/t/let-statement-cannot-use-return/92948 "2023-01-14T02:36:24Z")

</div>

I am trying to understand the let statement. Particularly how to get variables from within the let scope. julia\> j = 2 2 julia\> c,d = let a = j x = 5a y = 7a return x, y end…

---

## [How to alias a function to have maximum speed](https://discourse.julialang.org/t/how-to-alias-a-function-to-have-maximum-speed/92918)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 8\
**Last updated:** [January 14, 2023, 1:33am UTC](https://discourse.julialang.org/t/how-to-alias-a-function-to-have-maximum-speed/92918 "2023-01-14T01:33:07Z")

</div>

I have a function, say f(x,y,z)=x+y+z In many situations, I would like to fix one of the parameters, say letting z=10, and give it another name. To do this, I can think of several different ways. g1(x,y)=f(x,y,10) g2=…

---

## [Can't precompile some packages on Github Codespaces](https://discourse.julialang.org/t/cant-precompile-some-packages-on-github-codespaces/92761)

<div class="topic-metadata">

**Author:** [@br0wnelvis](https://discourse.julialang.org/u/br0wnelvis)\
**Replies:** 9\
**Last updated:** [January 13, 2023, 9:18pm UTC](https://discourse.julialang.org/t/cant-precompile-some-packages-on-github-codespaces/92761 "2023-01-13T21:18:39Z")

</div>

I’m using Julia 1.8.4 on Github Codespaces. I’ve tried to install a couple of packages that I will need for my project, but some of them just won’t precompile. I’ve done it in a macOS Mojave (10.14.3) and It wouldn’t wo…

---

## [Why are strings immutable (historical records request)](https://discourse.julialang.org/t/why-are-strings-immutable-historical-records-request/92115)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 4\
**Last updated:** [January 12, 2023, 5:00pm UTC](https://discourse.julialang.org/t/why-are-strings-immutable-historical-records-request/92115 "2023-01-12T17:00:01Z")

</div>

At some point it was decided that Strings would be immutable in Julia. Is there a record of that conversation (e.g. a mailing list or GitHub thread)? Failing that, is there a record of the conversations that led core la…

---

## [Map data from one dictionary into another](https://discourse.julialang.org/t/map-data-from-one-dictionary-into-another/92890)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 5\
**Last updated:** [January 13, 2023, 8:30pm UTC](https://discourse.julialang.org/t/map-data-from-one-dictionary-into-another/92890 "2023-01-13T20:30:08Z")

</div>

I have data from two APIs in JSON format and parsing them into 2 dictionaries (d1, d2). I need to derive two additional fields FieldName(from d2), attrVal from d1() by mapping subAttrDefId present in d1(“attrValues”) wi…

---

## [Medical CT image alignment/registration](https://discourse.julialang.org/t/medical-ct-image-alignment-registration/91187)

<div class="topic-metadata">

**Author:** [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Replies:** 2\
**Last updated:** [January 13, 2023, 6:53pm UTC](https://discourse.julialang.org/t/medical-ct-image-alignment-registration/91187 "2023-01-13T18:53:37Z")

</div>

I have two DICOM images from two different CBCT scanners of the same dental anatomy. I can open these images in Horos. How can I align/register these two images to each other using free (in any sense) software?

---

## [Why does this type instability lead to allocations?](https://discourse.julialang.org/t/why-does-this-type-instability-lead-to-allocations/92821)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 3\
**Last updated:** [January 13, 2023, 6:48pm UTC](https://discourse.julialang.org/t/why-does-this-type-instability-lead-to-allocations/92821 "2023-01-13T18:48:15Z")

</div>

I previously posted a question about dynamic dispatch leading to allocations. The answer I got was that the type instability that leads to dynamic dispatch also leads to the allocations - at least that’s what I understoo…

---

## [Problem linking HDF5.jl to system libhdf5](https://discourse.julialang.org/t/problem-linking-hdf5-jl-to-system-libhdf5/92931)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 8\
**Last updated:** [January 13, 2023, 6:25pm UTC](https://discourse.julialang.org/t/problem-linking-hdf5-jl-to-system-libhdf5/92931 "2023-01-13T18:25:01Z")

</div>

I am trying to use HDF5.jl with the system-provided libhdf5 (in order to use MPI), following the instructions here: Home · HDF5.jl. I get an error about ‘failing to find libhdf5’, even though the library is present in t…

---

## [How to use data for training and tests with glm?](https://discourse.julialang.org/t/how-to-use-data-for-training-and-tests-with-glm/92928)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 5\
**Last updated:** [January 13, 2023, 5:07pm UTC](https://discourse.julialang.org/t/how-to-use-data-for-training-and-tests-with-glm/92928 "2023-01-13T17:07:07Z")

</div>

Hello, good morning. I’m having troubles to separate and use my data for training and tests with glm. Once I have tests and training data, I had fit my model with train data, but can’t understand how to predic with my t…

---

## [Could not start the Julia language server. Make sure the \`julia.environmentPath\` setting is valid](https://discourse.julialang.org/t/could-not-start-the-julia-language-server-make-sure-the-julia-environmentpath-setting-is-valid/87794)

<div class="topic-metadata">

**Author:** [@tryjulia](https://discourse.julialang.org/u/tryjulia)\
**Replies:** 9\
**Last updated:** [January 13, 2023, 3:20pm UTC](https://discourse.julialang.org/t/could-not-start-the-julia-language-server-make-sure-the-julia-environmentpath-setting-is-valid/87794 "2023-01-13T15:20:27Z")

</div>

Hi, I’m new to MacOs, and currently want to use VS Code to run julia into the system but there’s notification: Could not start the Julia language server. Make sure the julia.environmentPath setting is valid. I’ve …

---

## [Advice needed on multithreaded processing for live data from a UDP socket](https://discourse.julialang.org/t/advice-needed-on-multithreaded-processing-for-live-data-from-a-udp-socket/91948)

<div class="topic-metadata">

**Author:** [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Replies:** 2\
**Last updated:** [January 13, 2023, 3:10pm UTC](https://discourse.julialang.org/t/advice-needed-on-multithreaded-processing-for-live-data-from-a-udp-socket/91948 "2023-01-13T15:10:11Z")

</div>

I have an application which receives data from a sensor via UDP, does some processing and displays the results. The data is read in a separate thread and buffered using a Channel. It’s important that the receiver thread …

---

## [How to capture model output with loss in Flux.withgradient](https://discourse.julialang.org/t/how-to-capture-model-output-with-loss-in-flux-withgradient/92766)

<div class="topic-metadata">

**Author:** [@reachtarunhere](https://discourse.julialang.org/u/reachtarunhere)\
**Replies:** 3\
**Last updated:** [January 13, 2023, 2:54pm UTC](https://discourse.julialang.org/t/how-to-capture-model-output-with-loss-in-flux-withgradient/92766 "2023-01-13T14:54:59Z")

</div>

Here is the sample code for my training loop function train() @showprogress for i in 1:10 l, grads = Flux.withgradient(m -\> lossfn(m(X), Y), model) fmap(model, grads\[1\]) do p, g p .= p .-…

---

## [MySQL Connection closes when writing to database from multiple workers](https://discourse.julialang.org/t/mysql-connection-closes-when-writing-to-database-from-multiple-workers/92916)

<div class="topic-metadata">

**Author:** [@SanAlphaTau](https://discourse.julialang.org/u/SanAlphaTau)\
**Replies:** 1\
**Last updated:** [January 13, 2023, 2:26pm UTC](https://discourse.julialang.org/t/mysql-connection-closes-when-writing-to-database-from-multiple-workers/92916 "2023-01-13T14:26:12Z")

</div>

Heya, I am trying to write data generated by a compute intensive function into a database for storage and later analysis. I have been trying to use MySQL.jl to manage the connection. I am running into an issue where wh…

---

## [Creating a List of 100 Binomial Distributed Values](https://discourse.julialang.org/t/creating-a-list-of-100-binomial-distributed-values/92903)

<div class="topic-metadata">

**Author:** [@BadBoy](https://discourse.julialang.org/u/BadBoy)\
**Replies:** 9\
**Last updated:** [January 13, 2023, 2:22pm UTC](https://discourse.julialang.org/t/creating-a-list-of-100-binomial-distributed-values/92903 "2023-01-13T14:22:21Z")

</div>

I want a list x it contain 1 and -1, if rand(Binomial(1,0.5),1)\[1\] == 1 is true the value in that position of x is 1 and if it is not true then the value is -1 . i need to do this for 100 many times, so my length of x sh…

---

## [Need help implementing non-allocating normal distribution with StaticArrays](https://discourse.julialang.org/t/need-help-implementing-non-allocating-normal-distribution-with-staticarrays/92919)

<div class="topic-metadata">

**Author:** [@vpetukhov](https://discourse.julialang.org/u/vpetukhov)\
**Replies:** 2\
**Last updated:** [January 13, 2023, 2:12pm UTC](https://discourse.julialang.org/t/need-help-implementing-non-allocating-normal-distribution-with-staticarrays/92919 "2023-01-13T14:12:37Z")

</div>

I’m trying to implement a zero-allocating version of a normal distribution pdf, but get some unexpected allocations. Below is my code for a script ./test\_allocations.jl, which could be ran to test allocations quickly. u…

---

## [Machine Learning Classification](https://discourse.julialang.org/t/machine-learning-classification/92915)

<div class="topic-metadata">

**Author:** [@BadBoy](https://discourse.julialang.org/u/BadBoy)\
**Replies:** 3\
**Last updated:** [January 13, 2023, 1:41pm UTC](https://discourse.julialang.org/t/machine-learning-classification/92915 "2023-01-13T13:41:27Z")

</div>

How can I find the best subset of the predictors for a classification problem?? Any kind of help will be appreciated. Thanks in advance.

---

## [How to return in-place two variables from fetch?](https://discourse.julialang.org/t/how-to-return-in-place-two-variables-from-fetch/92880)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 5\
**Last updated:** [January 13, 2023, 1:39pm UTC](https://discourse.julialang.org/t/how-to-return-in-place-two-variables-from-fetch/92880 "2023-01-13T13:39:49Z")

</div>

I have two issues please: 1- How can I mutate in-place x\_1&x\_2 by the returns of fetch ( Z and Y ) to avoid the below error? A = \[1,2,3,4,5\] x\_1 = zeros(5); x\_2 = zeros(5); thr = Threads.@spawn begin Z = A .+ 1; Y …

---

## [\`twiny\` in Plots somehow break the subplot margin](https://discourse.julialang.org/t/twiny-in-plots-somehow-break-the-subplot-margin/92901)

<div class="topic-metadata">

**Author:** [@babaq](https://discourse.julialang.org/u/babaq)\
**Replies:** 0\
**Last updated:** [January 12, 2023, 11:53pm UTC](https://discourse.julialang.org/t/twiny-in-plots-somehow-break-the-subplot-margin/92901 "2023-01-12T23:53:15Z")

</div>

Hi, For a subplot to have tight margins, i did this and plot looks fine. p=plot(layout=(1,3),leg=false) for i in 1:3 leftmargin = i==1 ? 6Plots.mm : -4Plots.mm heatmap!(p\[i\],rand(10,10),yticks=\[\];leftmargin) en…

---

## [Jupyter kernel not found when rendering with Quarto](https://discourse.julialang.org/t/jupyter-kernel-not-found-when-rendering-with-quarto/86205)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 13\
**Last updated:** [January 13, 2023, 11:28am UTC](https://discourse.julialang.org/t/jupyter-kernel-not-found-when-rendering-with-quarto/86205 "2023-01-13T11:28:33Z")

</div>

I am trying to use Quarto to render the following known example file (ex2\_Julia.qmd): --- title: "Plots Demo" author: "Norah Jones" date: "5/22/2021" format: html: code-fold: true jupyter: julia-1.8.0 --- ## Para…

---

## [How to achieve perfect scaling with Threads (Julia 1.7.1)](https://discourse.julialang.org/t/how-to-achieve-perfect-scaling-with-threads-julia-1-7-1/92603)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 33\
**Last updated:** [January 13, 2023, 11:07am UTC](https://discourse.julialang.org/t/how-to-achieve-perfect-scaling-with-threads-julia-1-7-1/92603 "2023-01-13T11:07:20Z")

</div>

Hi everyone, I am currently investigating a scaling bottleneck in one of my codes which seems a bit elusive to me. In my investigation to get a MWE, I have tried to produce a somewhat representative example, which shou…

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

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