# Latest

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

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

**Page:** 1378

---

## [Generalizing the inputs of the nlsolve function in Julia](https://discourse.julialang.org/t/generalizing-the-inputs-of-the-nlsolve-function-in-julia/62012)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 0\
**Last updated:** [May 28, 2021, 7:32pm UTC](https://discourse.julialang.org/t/generalizing-the-inputs-of-the-nlsolve-function-in-julia/62012 "2021-05-28T19:32:08Z")

</div>

After an extensive process usyng the SymPy in Julia, I generated a system of nonlinear equations. My system is allocated in a matrix NxS. Something like this(NN = 2, S = 2). I would like to adapt the system to use th…

---

## [XLSX.jl: writing sheets from vectors](https://discourse.julialang.org/t/xlsx-jl-writing-sheets-from-vectors/62007)

<div class="topic-metadata">

**Author:** [@PaulMainwood](https://discourse.julialang.org/u/PaulMainwood)\
**Replies:** 1\
**Last updated:** [May 28, 2021, 6:56pm UTC](https://discourse.julialang.org/t/xlsx-jl-writing-sheets-from-vectors/62007 "2021-05-28T18:56:18Z")

</div>

In the package XLSX.jl, there is a useful capability of writing multiple excel sheets into a new file from several dataframes. From the documentation: XLSX.writetable("report.xlsx", REPORT\_A=( collect(DataFrames.eachcol…

---

## [How to avoid memory allocation when having long expression](https://discourse.julialang.org/t/how-to-avoid-memory-allocation-when-having-long-expression/61998)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 16\
**Last updated:** [May 28, 2021, 6:08pm UTC](https://discourse.julialang.org/t/how-to-avoid-memory-allocation-when-having-long-expression/61998 "2021-05-28T18:08:52Z")

</div>

const ⊕ = + const ⊗ = \* @. dTA\_dH += -KH2PO4 ⊗ KH3PO4 ⊗ TH3PO4 ⊗ (2 ⊗ H^3 ⊕ H^2 ⊗ KH3PO4 - KH2PO4 ⊗ KH3PO4 ⊗ KHPO4) / (H^3 ⊕ H^2 ⊗ KH3PO4 ⊕ H ⊗ KH2PO4 ⊗ KH3PO4 ⊕ KH2PO4 ⊗ KH3PO4 ⊗ KHPO4)^2 A…

---

## [AlphaGPU: an alphazero implementation wholly on gpu](https://discourse.julialang.org/t/alphagpu-an-alphazero-implementation-wholly-on-gpu/60030)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 11\
**Last updated:** [May 28, 2021, 4:46pm UTC](https://discourse.julialang.org/t/alphagpu-an-alphazero-implementation-wholly-on-gpu/60030 "2021-05-28T16:46:33Z")

</div>

For those interested i made a fully cuda implementation of alphazero for connect 4. It can train a network to a very strong level in 2 to 3 hours on a single GPU, thanks to being able to play 32000 games in parallel. I…

---

## [Makie - How to put contour3d and surface upon the same figure?](https://discourse.julialang.org/t/makie-how-to-put-contour3d-and-surface-upon-the-same-figure/62002)

<div class="topic-metadata">

**Author:** [@jmura](https://discourse.julialang.org/u/jmura)\
**Replies:** 1\
**Last updated:** [May 28, 2021, 4:46pm UTC](https://discourse.julialang.org/t/makie-how-to-put-contour3d-and-surface-upon-the-same-figure/62002 "2021-05-28T16:46:16Z")

</div>

Hi All, I’m trying to get a simple figure using this in a Jupyter notebook: using GLMakie, AbstractPlotting AbstractPlotting.inline!(true) ξ = LinRange(-1, 1, 50) η = LinRange(-1, 1, 50) ϕ₁(ξ) = (1 .- ξ)./2 ϕ₂(ξ) = …

---

## [Fitting a dynamic system with an exogenous input (nonhomogenous neural ode) via DiffEqFlux](https://discourse.julialang.org/t/fitting-a-dynamic-system-with-an-exogenous-input-nonhomogenous-neural-ode-via-diffeqflux/44934)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 33\
**Last updated:** [May 28, 2021, 4:35pm UTC](https://discourse.julialang.org/t/fitting-a-dynamic-system-with-an-exogenous-input-nonhomogenous-neural-ode-via-diffeqflux/44934 "2021-05-28T16:35:23Z")

</div>

Hello, I´m trying to fit a dynamic system (a hammerstein system, implemented below) with an exogenous input via DiffEqFlux, but actually I don´t know how to put the input excitation into the n-ode-problem. I first tried…

---

## [Combining two co-dependent modules into a single program](https://discourse.julialang.org/t/combining-two-co-dependent-modules-into-a-single-program/61881)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 20\
**Last updated:** [May 28, 2021, 3:33pm UTC](https://discourse.julialang.org/t/combining-two-co-dependent-modules-into-a-single-program/61881 "2021-05-28T15:33:43Z")

</div>

I’m struggling to understand how to combine modules at the moment, and am clearly missing something crucial. I have a module that uses another module, and also a method that calls another method of the same name but diff…

---

## [Small, fixed powers](https://discourse.julialang.org/t/small-fixed-powers/61991)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 5\
**Last updated:** [May 28, 2021, 2:41pm UTC](https://discourse.julialang.org/t/small-fixed-powers/61991 "2021-05-28T14:41:32Z")

</div>

Consider these two functions for computing the 4-th power: power4(x) = x^4 power31(x) = x \* x^3 The second is much speedier than the first because (looking at code\_llvm or code\_native) the first calls a general helper …

---

## [Global variables const by default?](https://discourse.julialang.org/t/global-variables-const-by-default/33138)

<div class="topic-metadata">

**Author:** [@stephancb](https://discourse.julialang.org/u/stephancb)\
**Replies:** 24\
**Last updated:** [May 28, 2021, 2:23pm UTC](https://discourse.julialang.org/t/global-variables-const-by-default/33138 "2021-05-28T14:23:41Z")

</div>

Relatively poor performance resulting from the use of non-const global variables comes up quite often in Julia context. Wouldn’t it be better if variables were const by default? Or at least global variables. If a non-con…

---

## [Cos() allocates and is slow in fastmath?](https://discourse.julialang.org/t/cos-allocates-and-is-slow-in-fastmath/61990)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 3\
**Last updated:** [May 28, 2021, 1:37pm UTC](https://discourse.julialang.org/t/cos-allocates-and-is-slow-in-fastmath/61990 "2021-05-28T13:37:22Z")

</div>

in v1.6.1, when --math-mode=fast: julia\> @btime cos($1.2); 217.234 ns (8 allocations: 576 bytes) julia\> @btime sin($1.2); 175.154 ns (6 allocations: 544 bytes) julia\> @btime tan($1.2); 188.837 ns (6 allocations: 5…

---

## [Engineering and Optics Roles at Metalenz \[Boston, MA\]](https://discourse.julialang.org/t/engineering-and-optics-roles-at-metalenz-boston-ma/61993)

<div class="topic-metadata">

**Author:** [@platawiec](https://discourse.julialang.org/u/platawiec)\
**Replies:** 0\
**Last updated:** [May 28, 2021, 1:58pm UTC](https://discourse.julialang.org/t/engineering-and-optics-roles-at-metalenz-boston-ma/61993 "2021-05-28T13:58:08Z")

</div>

Metalenz is a venture-backed startup developing next-generation sensing systems for consumer electronics with metasurface technology. We develop our design and simulation tooling in Julia. If you are interested in inver…

---

## [Hoeffding Dependence measure and test](https://discourse.julialang.org/t/hoeffding-dependence-measure-and-test/61987)

<div class="topic-metadata">

**Author:** [@Eric](https://discourse.julialang.org/u/Eric)\
**Replies:** 0\
**Last updated:** [May 28, 2021, 12:52pm UTC](https://discourse.julialang.org/t/hoeffding-dependence-measure-and-test/61987 "2021-05-28T12:52:45Z")

</div>

Hello there, I put together a Julia package implementing the Hoeffding Dependence measure for the ones that could be interested. There are some Matlab, R, Python, and SAS implementations, but I could not find one in Ju…

---

## [Does texw format still work in Weave.jl?](https://discourse.julialang.org/t/does-texw-format-still-work-in-weave-jl/61986)

<div class="topic-metadata">

**Author:** [@Minimum-Pollution-96](https://discourse.julialang.org/u/Minimum-Pollution-96)\
**Replies:** 0\
**Last updated:** [May 28, 2021, 12:40pm UTC](https://discourse.julialang.org/t/does-texw-format-still-work-in-weave-jl/61986 "2021-05-28T12:40:58Z")

</div>

I wanted to create a LaTeX document and tried using Weave.jl. But, the examples given there are broken (see: https://github.com/JunoLab/Weave.jl/issues/412 ). I would like to know whether someone had worked using that re…

---

## [How to have the same behaviour such as python's plt.plot()?](https://discourse.julialang.org/t/how-to-have-the-same-behaviour-such-as-pythons-plt-plot/61801)

<div class="topic-metadata">

**Author:** [@Vicodin96](https://discourse.julialang.org/u/Vicodin96)\
**Replies:** 11\
**Last updated:** [May 28, 2021, 8:52am UTC](https://discourse.julialang.org/t/how-to-have-the-same-behaviour-such-as-pythons-plt-plot/61801 "2021-05-28T08:52:18Z")

</div>

Hello to everyone, I’m new to Julia language and I come from Python. I’ve understood how to plot correctly, by using the display() function, but the plot, once created, immediately disappear. How can I have a blocking be…

---

## [Turing.jl: Confusion about random variables and draws from distributions](https://discourse.julialang.org/t/turing-jl-confusion-about-random-variables-and-draws-from-distributions/61912)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 3\
**Last updated:** [May 28, 2021, 7:48am UTC](https://discourse.julialang.org/t/turing-jl-confusion-about-random-variables-and-draws-from-distributions/61912 "2021-05-28T07:48:42Z")

</div>

Hi, I’m just starting out with probabilistic programming in general and Turing.jl specifically, so I am still in the process of wrapping my head around the logic of it. I want to build a simple model where a yes/no resp…

---

## [Access the contents of a mat file](https://discourse.julialang.org/t/access-the-contents-of-a-mat-file/61977)

<div class="topic-metadata">

**Author:** [@Deepa](https://discourse.julialang.org/u/Deepa)\
**Replies:** 1\
**Last updated:** [May 28, 2021, 7:47am UTC](https://discourse.julialang.org/t/access-the-contents-of-a-mat-file/61977 "2021-05-28T07:47:04Z")

</div>

Hi All, I’ve saved a matrix in mat file and I’m trying to load and access the matrix in Julia. file = matopen("mat1.mat") varnames = keys(file) println(varnames) println(typeof(file)) mat1 = # how can I access the va…

---

## [Performance of Ensemble Simulations on GPUs](https://discourse.julialang.org/t/performance-of-ensemble-simulations-on-gpus/61426)

<div class="topic-metadata">

**Author:** [@knn](https://discourse.julialang.org/u/knn)\
**Replies:** 4\
**Last updated:** [May 28, 2021, 7:13am UTC](https://discourse.julialang.org/t/performance-of-ensemble-simulations-on-gpus/61426 "2021-05-28T07:13:10Z")

</div>

We are currently analyzing the performance of ensemble simlations on CPUs and GPUs. In our case, we noticed that the ensemble simulation on the GPU with EnsembleGPUArray only stresses the GPU for about 6s. Nevertheless, …

---

## [For Julia programmers who also work with Rust: When you write in Rust, do you miss Julia's multiple dispatch, or are there features of Rust that make up for that loss?](https://discourse.julialang.org/t/for-julia-programmers-who-also-work-with-rust-when-you-write-in-rust-do-you-miss-julias-multiple-dispatch-or-are-there-features-of-rust-that-make-up-for-that-loss/61959)

<div class="topic-metadata">

**Author:** [@anon71627001](https://discourse.julialang.org/u/anon71627001)\
**Replies:** 4\
**Last updated:** [May 28, 2021, 6:28am UTC](https://discourse.julialang.org/t/for-julia-programmers-who-also-work-with-rust-when-you-write-in-rust-do-you-miss-julias-multiple-dispatch-or-are-there-features-of-rust-that-make-up-for-that-loss/61959 "2021-05-28T06:28:58Z")

</div>

Sorry if this is too off-topic, I’ll delete it if so.

---

## [How could I save and restore the status of random seed?](https://discourse.julialang.org/t/how-could-i-save-and-restore-the-status-of-random-seed/61941)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 3\
**Last updated:** [May 28, 2021, 6:23am UTC](https://discourse.julialang.org/t/how-could-i-save-and-restore-the-status-of-random-seed/61941 "2021-05-28T06:23:28Z")

</div>

as per the following, how could I make sure the random seed remains unchanged before and after calling the function? function f() rng0 = Random.default\_rng() # save the current seed ### section for determini…

---

## [Override foo{x}](https://discourse.julialang.org/t/override-foo-x/61969)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 4\
**Last updated:** [May 28, 2021, 5:37am UTC](https://discourse.julialang.org/t/override-foo-x/61969 "2021-05-28T05:37:40Z")

</div>

Is it possible to customize what happens when I do foo{x} for a particular type Foo or type X?

---

## [How to add a folder path in your .jl script](https://discourse.julialang.org/t/how-to-add-a-folder-path-in-your-jl-script/61901)

<div class="topic-metadata">

**Author:** [@sxd190026](https://discourse.julialang.org/u/sxd190026)\
**Replies:** 10\
**Last updated:** [May 28, 2021, 5:28am UTC](https://discourse.julialang.org/t/how-to-add-a-folder-path-in-your-jl-script/61901 "2021-05-28T05:28:47Z")

</div>

I recently moved from matlab to julia and I want to add a folder path in my script (similar to addpath(“folder path”) ) in my julia script, so that I can use any function files inside that folder? For example, I am usin…

---

## [Font & Tools to print Julia code listings?](https://discourse.julialang.org/t/font-tools-to-print-julia-code-listings/61934)

<div class="topic-metadata">

**Author:** [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Replies:** 5\
**Last updated:** [May 28, 2021, 4:14am UTC](https://discourse.julialang.org/t/font-tools-to-print-julia-code-listings/61934 "2021-05-28T04:14:59Z")

</div>

I have been struggling for a long time trying to find a way to print Julia code listing where Unicode characters are properly rendered. I have been using enscript for many years to print C++ code, however it does not sup…

---

## [Julia 1.7 feature freeze: June 1](https://discourse.julialang.org/t/julia-1-7-feature-freeze-june-1/61032)

<div class="topic-metadata">

**Author:** [@ararslan](https://discourse.julialang.org/u/ararslan)\
**Replies:** 10\
**Last updated:** [May 28, 2021, 3:37am UTC](https://discourse.julialang.org/t/julia-1-7-feature-freeze-june-1/61032 "2021-05-28T03:37:55Z")

</div>

We’ve set the feature freeze date for Julia 1.7 to Monday, June 1st. If there are any feature PRs you’d like to get into Julia 1.7, they’ll need to be in prior to that date.

---

## [Using JuMP in Python Environment](https://discourse.julialang.org/t/using-jump-in-python-environment/61165)

<div class="topic-metadata">

**Author:** [@asavasci](https://discourse.julialang.org/u/asavasci)\
**Replies:** 2\
**Last updated:** [May 28, 2021, 1:52am UTC](https://discourse.julialang.org/t/using-jump-in-python-environment/61165 "2021-05-28T01:52:48Z")

</div>

I am trying to embed JuMP-based Julia script into a Python-based computing framework using PyCall. However, I am facing problems when I define JuMP variable as from julia import Ipopt from julia.JuMP import Model from …

---

## [Julia gets mentioned in an article about FORTRAN](https://discourse.julialang.org/t/julia-gets-mentioned-in-an-article-about-fortran/60605)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 116\
**Last updated:** [May 27, 2021, 10:26pm UTC](https://discourse.julialang.org/t/julia-gets-mentioned-in-an-article-about-fortran/60605 "2021-05-27T22:26:05Z")

</div>

---

## [UndefKeywordError with multiple (overloaded) constructors](https://discourse.julialang.org/t/undefkeyworderror-with-multiple-overloaded-constructors/61961)

<div class="topic-metadata">

**Author:** [@bcon](https://discourse.julialang.org/u/bcon)\
**Replies:** 2\
**Last updated:** [May 27, 2021, 10:20pm UTC](https://discourse.julialang.org/t/undefkeyworderror-with-multiple-overloaded-constructors/61961 "2021-05-27T22:20:13Z")

</div>

I’d prefer to write multiple outer constructors for structs, so that the user can provide what they have and let the constructor make whatever conversions are needed. Running the mwe: module ConstructorTest struct …

---

## [Trying to adapt "remove redundancy" step of TDD in Julia from Java example](https://discourse.julialang.org/t/trying-to-adapt-remove-redundancy-step-of-tdd-in-julia-from-java-example/61587)

<div class="topic-metadata">

**Author:** [@danilo-bc](https://discourse.julialang.org/u/danilo-bc)\
**Replies:** 10\
**Last updated:** [May 27, 2021, 8:59pm UTC](https://discourse.julialang.org/t/trying-to-adapt-remove-redundancy-step-of-tdd-in-julia-from-java-example/61587 "2021-05-27T20:59:03Z")

</div>

I’ve become fond of the idea of TDD and started implementing a few ideas in Julia. The weird part about it is that most material is focused on class-based OOP ideas implemented in Java. This ends up creating a bit of con…

---

## [Using Binarybuilder binary](https://discourse.julialang.org/t/using-binarybuilder-binary/61952)

<div class="topic-metadata">

**Author:** [@HexSpin](https://discourse.julialang.org/u/HexSpin)\
**Replies:** 3\
**Last updated:** [May 27, 2021, 7:51pm UTC](https://discourse.julialang.org/t/using-binarybuilder-binary/61952 "2021-05-27T19:51:03Z")

</div>

A few weeks ago, @miguelraz , kindly unleashed binary builder magic to create primecount.jll, which reveals the number of primes below a given number very quickly. It’s been useful, but I’m still stumped by something…t…

---

## [Load 2 types of data from a folder](https://discourse.julialang.org/t/load-2-types-of-data-from-a-folder/61921)

<div class="topic-metadata">

**Author:** [@assia855](https://discourse.julialang.org/u/assia855)\
**Replies:** 3\
**Last updated:** [May 27, 2021, 7:47pm UTC](https://discourse.julialang.org/t/load-2-types-of-data-from-a-folder/61921 "2021-05-27T19:47:17Z")

</div>

Hello folks, I have 2 types of data in Data folder. I would like to loop through it. How can I make it work please. Data = glob("Data\_Weight") Load\_Data("Data\_Weight/Model\_Synthetic\_Star\_/\*", …

---

## [Ad-hoc tests of many tests](https://discourse.julialang.org/t/ad-hoc-tests-of-many-tests/61955)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 0\
**Last updated:** [May 27, 2021, 7:11pm UTC](https://discourse.julialang.org/t/ad-hoc-tests-of-many-tests/61955 "2021-05-27T19:11:42Z")

</div>

I have a bunch of random scripts that I’ve accumulated over the course of a few months. These are small things that I wrote to illustrate a half-baked idea while making meetings with my advisor. I want to make sure thes…

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

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