# Latest

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

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

**Page:** 848

---

## [Passing values from an array in ModeliingToolkit framework](https://discourse.julialang.org/t/passing-values-from-an-array-in-modeliingtoolkit-framework/90976)

<div class="topic-metadata">

**Author:** [@Rohan\_Rajagopal](https://discourse.julialang.org/u/Rohan_Rajagopal)\
**Replies:** 3\
**Last updated:** [December 2, 2022, 2:35pm UTC](https://discourse.julialang.org/t/passing-values-from-an-array-in-modeliingtoolkit-framework/90976 "2022-12-02T14:35:46Z")

</div>

I have a previously solved system (dt=1/200, ~adaptive=false, tspan = (0, 50)), stored as an array say 'A.' I want to use these values in another modelingtoolkit setup. A is essentially like a sinusoidal signal. eqs =…

---

## [MethodError: no method matching translate! in Turing with SMC](https://discourse.julialang.org/t/methoderror-no-method-matching-translate-in-turing-with-smc/91115)

<div class="topic-metadata">

**Author:** [@jtraffic](https://discourse.julialang.org/u/jtraffic)\
**Replies:** 0\
**Last updated:** [December 1, 2022, 9:25pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-translate-in-turing-with-smc/91115 "2022-12-01T21:25:50Z")

</div>

Here is my full code, based on a Turing tutorial. using Turing, Turing.RandomMeasures using LinearAlgebra, Distributions using Plots, Random, CSV, DataFrames share\_1 = rand(Uniform(), 100) share\_2 = 1 .- share\_1 shar…

---

## [Some questions about function of function](https://discourse.julialang.org/t/some-questions-about-function-of-function/91144)

<div class="topic-metadata">

**Author:** [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Replies:** 2\
**Last updated:** [December 2, 2022, 2:03pm UTC](https://discourse.julialang.org/t/some-questions-about-function-of-function/91144 "2022-12-02T14:03:49Z")

</div>

I am not so familiar to Julia. I have a program as follows, it means function t2 is a parameter of t5. My question is that why it needs (args...; kwargs...) -\> begin in beginning of t5 , and why here is ;, if it is (a…

---

## [Invalidate precompilation cache](https://discourse.julialang.org/t/invalidate-precompilation-cache/90992)

<div class="topic-metadata">

**Author:** [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Replies:** 7\
**Last updated:** [December 2, 2022, 12:35pm UTC](https://discourse.julialang.org/t/invalidate-precompilation-cache/90992 "2022-12-02T12:35:59Z")

</div>

How can I invalidate the precompilation cache in a programmable way from within julia, to force precompilation upon restart ?

---

## [Out of memory error in Juniper.jl](https://discourse.julialang.org/t/out-of-memory-error-in-juniper-jl/91094)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 7\
**Last updated:** [December 2, 2022, 10:19am UTC](https://discourse.julialang.org/t/out-of-memory-error-in-juniper-jl/91094 "2022-12-02T10:19:02Z")

</div>

Unfortunately I cannot practically create a MWE for this issue. I build a rather large MINLP model, it has 33,331 variables (2,218 binary), 157,260 constraints, 7,818 non linear constraints. When optimising, after 10 min…

---

## [Optimize code by parallelization/GPU](https://discourse.julialang.org/t/optimize-code-by-parallelization-gpu/88578)

<div class="topic-metadata">

**Author:** [@Adegasel](https://discourse.julialang.org/u/Adegasel)\
**Replies:** 8\
**Last updated:** [October 12, 2022, 8:46pm UTC](https://discourse.julialang.org/t/optimize-code-by-parallelization-gpu/88578 "2022-10-12T20:46:14Z")

</div>

I have developed this transform method in order to assign vectors to previously computed centroids. It is currently taking ~20s on my machine, for 1M vectors and 256 clusters. Since I want to apply it to 1B vectors, this…

---

## [How to create sample random numbers from a custom distribution?](https://discourse.julialang.org/t/how-to-create-sample-random-numbers-from-a-custom-distribution/90744)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 12\
**Last updated:** [December 2, 2022, 9:59am UTC](https://discourse.julialang.org/t/how-to-create-sample-random-numbers-from-a-custom-distribution/90744 "2022-12-02T09:59:01Z")

</div>

I want to create a series of random numbers from a custom distribution. Suppose I have a data set named iris: julia\> using RDatasets julia\> iris = dataset("datasets", "iris"); Now I want to generate 100 random numbers…

---

## [Stochastic PDE with conservative noise](https://discourse.julialang.org/t/stochastic-pde-with-conservative-noise/90316)

<div class="topic-metadata">

**Author:** [@LuDc](https://discourse.julialang.org/u/LuDc)\
**Replies:** 6\
**Last updated:** [December 2, 2022, 9:55am UTC](https://discourse.julialang.org/t/stochastic-pde-with-conservative-noise/90316 "2022-12-02T09:55:29Z")

</div>

I am trying to simulate a simple stochastic pde using the DifferentialEquations package, the equation I want to simulate is a simple conservation equation with conservative noise in 2 dimensions, i.e. \\partial\_t \\rho = …

---

## [Help running notebooks in a server](https://discourse.julialang.org/t/help-running-notebooks-in-a-server/91131)

<div class="topic-metadata">

**Author:** [@runjaj](https://discourse.julialang.org/u/runjaj)\
**Replies:** 1\
**Last updated:** [December 2, 2022, 9:54am UTC](https://discourse.julialang.org/t/help-running-notebooks-in-a-server/91131 "2022-12-02T09:54:22Z")

</div>

I’m not 100 % sure that this is the place to make this question. The truth is that I’m quite lost… I’m creating a few interactive notebooks using Pluto and I would like that my students could use them. They are studying…

---

## [How to use a previous version of the Statistics or Linear Algebra Package from the Standard Library](https://discourse.julialang.org/t/how-to-use-a-previous-version-of-the-statistics-or-linear-algebra-package-from-the-standard-library/91126)

<div class="topic-metadata">

**Author:** [@vikram-s-narayan](https://discourse.julialang.org/u/vikram-s-narayan)\
**Replies:** 1\
**Last updated:** [December 2, 2022, 7:59am UTC](https://discourse.julialang.org/t/how-to-use-a-previous-version-of-the-statistics-or-linear-algebra-package-from-the-standard-library/91126 "2022-12-02T07:59:09Z")

</div>

I added a model called GEKPLS.jl to the Surrogates package a few months ago. GEKPLS uses the Linear Algebra and Statistics packages from the standard library. A few weeks ago, a few tests started failing without any cha…

---

## [Can't precompile Makie](https://discourse.julialang.org/t/cant-precompile-makie/91125)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 4\
**Last updated:** [December 2, 2022, 7:42am UTC](https://discourse.julialang.org/t/cant-precompile-makie/91125 "2022-12-02T07:42:26Z")

</div>

What is this? How can I solve it? julia\> using Makie # 0.18.3 \[ Info: Precompiling Makie \[ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a\] ERROR: LoadError: TypeError: in \<:, expected Type, got Vararg Stacktrace: \[1\] #s10#5 …

---

## [How to create a zero-based array?](https://discourse.julialang.org/t/how-to-create-a-zero-based-array/91127)

<div class="topic-metadata">

**Author:** [@Nathaniel](https://discourse.julialang.org/u/Nathaniel)\
**Replies:** 1\
**Last updated:** [December 2, 2022, 6:32am UTC](https://discourse.julialang.org/t/how-to-create-a-zero-based-array/91127 "2022-12-02T06:32:52Z")

</div>

I’d like to create a multidimensional array whose indexes start at 0 instead of 1. I know that this is possible, but I can’t seem to find a simple example of how. This page of the official documentation starts out promi…

---

## [Add a vertical line to an AoG plot](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [December 2, 2022, 4:54am UTC](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123 "2022-12-02T04:54:01Z")

</div>

In ggplot2, I can add a vertical line like this. How to do it in AoG? ggplot(df, aes(x=x, y=y)) + geom\_point() + geom\_vline(xintercept=10)

---

## [Use modern, secure, Windows API for dlopen](https://discourse.julialang.org/t/use-modern-secure-windows-api-for-dlopen/90171)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 5\
**Last updated:** [December 2, 2022, 4:48am UTC](https://discourse.julialang.org/t/use-modern-secure-windows-api-for-dlopen/90171 "2022-12-02T04:48:10Z")

</div>

Changing dlopen to use LOAD\_LIBRARY\_SEARCH\_DEFAULT\_DIRS rather than LOAD\_WITH\_ALTERED\_SEARCH\_PATH Currently, we use the windows “Alternate Search Order” to find DLLs. I propose that we use a new mechanism that is extensi…

---

## [Plot Sin (x) for - π or negative x-axis](https://discourse.julialang.org/t/plot-sin-x-for-or-negative-x-axis/90224)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 14\
**Last updated:** [December 2, 2022, 4:12am UTC](https://discourse.julialang.org/t/plot-sin-x-for-or-negative-x-axis/90224 "2022-12-02T04:12:08Z")

</div>

Hi all, I wonder why the sin(x) function can’t be plot for the domain of -π or the negative x-axis. This is my code: using Plots, LaTeXStrings gr() function pitick(start, stop, denom; mode=:text) a = Int(cld(star…

---

## [Rounding dates API](https://discourse.julialang.org/t/rounding-dates-api/91120)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [December 2, 2022, 1:16am UTC](https://discourse.julialang.org/t/rounding-dates-api/91120 "2022-12-02T01:16:59Z")

</div>

round(T, x) works like this julia\> round(Int16, float(pi)) 3 but for Dates it’s backwards: julia\> round(today(), Week) 2022-11-28 Why is this?

---

## [Generating a sparse matrix from a piecewise function](https://discourse.julialang.org/t/generating-a-sparse-matrix-from-a-piecewise-function/91119)

<div class="topic-metadata">

**Author:** [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)\
**Replies:** 2\
**Last updated:** [December 2, 2022, 12:36am UTC](https://discourse.julialang.org/t/generating-a-sparse-matrix-from-a-piecewise-function/91119 "2022-12-02T00:36:46Z")

</div>

I’m trying to generate a random sparse matrix R where each element in R can take on the following values: r\_{ij}= \\left\\{ \\begin{array}{ll} 1 & \\text{with probability } \\frac{1}{6}\\\\ 0 & \\text{with probab…

---

## [Null gradients with GANs](https://discourse.julialang.org/t/null-gradients-with-gans/91099)

<div class="topic-metadata">

**Author:** [@LucasMSpereira](https://discourse.julialang.org/u/LucasMSpereira)\
**Replies:** 1\
**Last updated:** [December 2, 2022, 12:41am UTC](https://discourse.julialang.org/t/null-gradients-with-gans/91099 "2022-12-02T00:41:10Z")

</div>

When trying to replicate a paper that uses GANs with unconventional loss calculations, I’m having problems with null gradients. The basic steps are the following: genOutput = gen(genInput) MSE(genOut, label) MAE(genOut…

---

## [How to make warning into error?](https://discourse.julialang.org/t/how-to-make-warning-into-error/5251)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 4\
**Last updated:** [December 1, 2022, 11:56pm UTC](https://discourse.julialang.org/t/how-to-make-warning-into-error/5251 "2022-12-01T23:56:32Z")

</div>

In C++, we can be pedantic and convert all warnings into errors during compilation: shell\> g++ -Werror Is there a similar feature in Julia? This switch could be very useful in Travis CI builds for mature packages. I am…

---

## [Warning stack trace](https://discourse.julialang.org/t/warning-stack-trace/67516)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 1\
**Last updated:** [December 1, 2022, 11:58pm UTC](https://discourse.julialang.org/t/warning-stack-trace/67516 "2022-12-01T23:58:58Z")

</div>

Is it possible to retrieve a warning’s stack trace, similar to errors? The reason I’m asking is that I want to trace the source of the warning, as now it shows the line where it’s being thrown, but not the actual code th…

---

## [Pkg.instantiate() error with multiple workers on 1 machine](https://discourse.julialang.org/t/pkg-instantiate-error-with-multiple-workers-on-1-machine/91022)

<div class="topic-metadata">

**Author:** [@jocklawrie](https://discourse.julialang.org/u/jocklawrie)\
**Replies:** 1\
**Last updated:** [December 1, 2022, 10:18pm UTC](https://discourse.julialang.org/t/pkg-instantiate-error-with-multiple-workers-on-1-machine/91022 "2022-12-01T22:18:53Z")

</div>

Hi there, This may well be user error, but thought I’d report it anyway in case there’s more to it. I’m running a simulation over multiple workers on the same machine. I get an error (see the image below) that indicate…

---

## [Installing Pardiso on Julia (Mac)](https://discourse.julialang.org/t/installing-pardiso-on-julia-mac/91014)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 18\
**Last updated:** [December 1, 2022, 10:18pm UTC](https://discourse.julialang.org/t/installing-pardiso-on-julia-mac/91014 "2022-12-01T22:18:33Z")

</div>

Hi everyone, I am trying to install Pardiso on Mac to be used through JuMP but I am a bit lost. I downloaded Pardison from the webpage and I have my academic license key but the file downloaded is “libpardiso600-MACOS-X…

---

## [Conditional Formatting in Pluto/Dataframes](https://discourse.julialang.org/t/conditional-formatting-in-pluto-dataframes/91113)

<div class="topic-metadata">

**Author:** [@lgmendes](https://discourse.julialang.org/u/lgmendes)\
**Replies:** 2\
**Last updated:** [December 1, 2022, 8:38pm UTC](https://discourse.julialang.org/t/conditional-formatting-in-pluto-dataframes/91113 "2022-12-01T20:38:15Z")

</div>

Is it possible to apply conditional formatting to dataframes on Pluto? Similar to what I possible with Pandas (Python) https://pandas.pydata.org/docs/user\_guide/style.html . In particular, I want to highlight some cells …

---

## [Matrix{Float64}\<:Matrix{Number} is false?](https://discourse.julialang.org/t/matrix-float64-matrix-number-is-false/91077)

<div class="topic-metadata">

**Author:** [@mgalenb](https://discourse.julialang.org/u/mgalenb)\
**Replies:** 8\
**Last updated:** [December 1, 2022, 8:26pm UTC](https://discourse.julialang.org/t/matrix-float64-matrix-number-is-false/91077 "2022-12-01T20:26:35Z")

</div>

Why is Matrix{Float64}\<:Matrix{Number} false?

---

## [BigInt to bytes](https://discourse.julialang.org/t/bigint-to-bytes/91107)

<div class="topic-metadata">

**Author:** [@iskyd](https://discourse.julialang.org/u/iskyd)\
**Replies:** 6\
**Last updated:** [December 1, 2022, 8:22pm UTC](https://discourse.julialang.org/t/bigint-to-bytes/91107 "2022-12-01T20:22:38Z")

</div>

I’m looking for a way to convert a BigInt number to bytes representation (in python this is done via (int).to\_bytes()). The only solution I came up with is doing BigInt → Hex → Bytes. For example: number::BigInt = par…

---

## [Broadcast over a multiple output function and receive a Tuple of Arrays](https://discourse.julialang.org/t/broadcast-over-a-multiple-output-function-and-receive-a-tuple-of-arrays/91111)

<div class="topic-metadata">

**Author:** [@bensetterholm](https://discourse.julialang.org/u/bensetterholm)\
**Replies:** 3\
**Last updated:** [December 1, 2022, 8:06pm UTC](https://discourse.julialang.org/t/broadcast-over-a-multiple-output-function-and-receive-a-tuple-of-arrays/91111 "2022-12-01T20:06:03Z")

</div>

Is there a convenient way to broadcast over a function that produces multiple outputs and receive a tuple of arrays instead of an array of tuples? For example, with the sincos function, I get the following output upon b…

---

## [Download file with multiple connections](https://discourse.julialang.org/t/download-file-with-multiple-connections/91110)

<div class="topic-metadata">

**Author:** [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Replies:** 0\
**Last updated:** [December 1, 2022, 6:18pm UTC](https://discourse.julialang.org/t/download-file-with-multiple-connections/91110 "2022-12-01T18:18:13Z")

</div>

Hey, while testing a downloading script in python, I also wanted to check if Julia behaves similarly, but could not figure out how to do a script that: downloads a big file from the internet (\>5GB) has a progress mete…

---

## [In julia import Pkg failed to precompiling. Why and how to solve this problem?](https://discourse.julialang.org/t/in-julia-import-pkg-failed-to-precompiling-why-and-how-to-solve-this-problem/91108)

<div class="topic-metadata">

**Author:** [@connect2robiul](https://discourse.julialang.org/u/connect2robiul)\
**Replies:** 1\
**Last updated:** [December 1, 2022, 5:31pm UTC](https://discourse.julialang.org/t/in-julia-import-pkg-failed-to-precompiling-why-and-how-to-solve-this-problem/91108 "2022-12-01T17:31:21Z")

</div>

---

## [How to obtain indices of an array satisfying boolean condition](https://discourse.julialang.org/t/how-to-obtain-indices-of-an-array-satisfying-boolean-condition/37780)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 20\
**Last updated:** [December 1, 2022, 5:23pm UTC](https://discourse.julialang.org/t/how-to-obtain-indices-of-an-array-satisfying-boolean-condition/37780 "2022-12-01T17:23:10Z")

</div>

I am trying to find the optimum way of obtaining the indices of an array which satisfy a certain boolean condition. For example, if a is of type Array{Float64,1}, i wish to obtain an array of indices i for which a\[i\]\>0. …

---

## [Reading binary file into a Vector of custom struct](https://discourse.julialang.org/t/reading-binary-file-into-a-vector-of-custom-struct/91097)

<div class="topic-metadata">

**Author:** [@bensetterholm](https://discourse.julialang.org/u/bensetterholm)\
**Replies:** 9\
**Last updated:** [December 1, 2022, 5:20pm UTC](https://discourse.julialang.org/t/reading-binary-file-into-a-vector-of-custom-struct/91097 "2022-12-01T17:20:12Z")

</div>

I am trying to find the best way to read a binary file directly into a vector of struct. The binary file has a format so that it could be read in as a vector of objects with format like so (where the file may have any n…

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

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