# Latest

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

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

**Page:** 1023

---

## [Adding Type to (working) Union{...} bricks it](https://discourse.julialang.org/t/adding-type-to-working-union-bricks-it/82041)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 8\
**Last updated:** [June 2, 2022, 7:39am UTC](https://discourse.julialang.org/t/adding-type-to-working-union-bricks-it/82041 "2022-06-02T07:39:16Z")

</div>

I’ve got a type defined as Union{Dict{Union{UInt8, String}, Number}, Nothing}. This works, but as soon as I add String to this Union it breaks and does not accept the initially working values anymore. See MWE below. The…

---

## [Are "inline assignments" inside loop predicates bad for type inference?](https://discourse.julialang.org/t/are-inline-assignments-inside-loop-predicates-bad-for-type-inference/81855)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 4\
**Last updated:** [June 2, 2022, 12:55am UTC](https://discourse.julialang.org/t/are-inline-assignments-inside-loop-predicates-bad-for-type-inference/81855 "2022-06-02T00:55:36Z")

</div>

I was playing with JET and noticed that it does not like notation like while (i=f())!==nothing ... while it is perfectly happy with i=f(); while i!==nothing .... f is a function that returns Union{Int,Nothing}. It seems …

---

## [How to add the path?](https://discourse.julialang.org/t/how-to-add-the-path/82097)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 1\
**Last updated:** [June 2, 2022, 12:12am UTC](https://discourse.julialang.org/t/how-to-add-the-path/82097 "2022-06-02T00:12:34Z")

</div>

jill will: 1) install Julia 1.8.0-rc1 for mac-x86\_64 into /Applications 2) make symlinks in /Users/zhangdeliang/.local/bin You may need to manually add /Users/zhangdeliang/.local/bin to PATH How to manually add /Us…

---

## [Question about two variables?](https://discourse.julialang.org/t/question-about-two-variables/82094)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 6\
**Last updated:** [June 1, 2022, 11:45pm UTC](https://discourse.julialang.org/t/question-about-two-variables/82094 "2022-06-01T23:45:15Z")

</div>

Dear all, What is the difference between foo and bar below? julia\> foo = \[1, 2, 3\] 3-element Vector{Int64}: 1 2 3 julia\> bar = \[1; 2; 3\] 3-element Vector{Int64}: 1 2 3 julia\> foo === bar false julia\> varinfo()…

---

## [Proof of concept - Verifiability of scientific articles on blockchains using the Julia programming language](https://discourse.julialang.org/t/proof-of-concept-verifiability-of-scientific-articles-on-blockchains-using-the-julia-programming-language/82092)

<div class="topic-metadata">

**Author:** [@anon29721930](https://discourse.julialang.org/u/anon29721930)\
**Replies:** 2\
**Last updated:** [June 1, 2022, 11:14pm UTC](https://discourse.julialang.org/t/proof-of-concept-verifiability-of-scientific-articles-on-blockchains-using-the-julia-programming-language/82092 "2022-06-01T23:14:37Z")

</div>

Hi all! 1. What Is a Blockchain? A blockchain is a distributed database that is shared among the nodes of a computer network. As a database, a blockchain stores information electronically in digital format. Blockchains …

---

## [Question about Foo or foo?](https://discourse.julialang.org/t/question-about-foo-or-foo/82091)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 3\
**Last updated:** [June 1, 2022, 11:10pm UTC](https://discourse.julialang.org/t/question-about-foo-or-foo/82091 "2022-06-01T23:10:33Z")

</div>

Dear all, I am new to Julia. And I often see many people using Foo or foo in their codes. So what does Foo or foo mean? Why so many people like to use it?

---

## [Does anybody wanna help me make a Hypernetworks package?](https://discourse.julialang.org/t/does-anybody-wanna-help-me-make-a-hypernetworks-package/82093)

<div class="topic-metadata">

**Author:** [@afishy](https://discourse.julialang.org/u/afishy)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 11:06pm UTC](https://discourse.julialang.org/t/does-anybody-wanna-help-me-make-a-hypernetworks-package/82093 "2022-06-01T23:06:31Z")

</div>

Hypernetworks are an increasingly popular tool for several applications, including continual learning, generative modeling etc. Naively, I’d think it would be relatively easy to create a simple interface to create an arb…

---

## [Run a loop for a set amount of time](https://discourse.julialang.org/t/run-a-loop-for-a-set-amount-of-time/82026)

<div class="topic-metadata">

**Author:** [@Adi\_Rai](https://discourse.julialang.org/u/Adi_Rai)\
**Replies:** 6\
**Last updated:** [June 1, 2022, 10:41pm UTC](https://discourse.julialang.org/t/run-a-loop-for-a-set-amount-of-time/82026 "2022-06-01T22:41:40Z")

</div>

Hi Everyone, I was converting some MATLAB code to Julia. In MATLAB to run a while loop for a set period is done using tic and toc functions. I was struggling with implementing the same thing in Julia. My question in sh…

---

## [How to count heap allocations easily?](https://discourse.julialang.org/t/how-to-count-heap-allocations-easily/68285)

<div class="topic-metadata">

**Author:** [@JeffFessler](https://discourse.julialang.org/u/JeffFessler)\
**Replies:** 4\
**Last updated:** [June 1, 2022, 10:31pm UTC](https://discourse.julialang.org/t/how-to-count-heap-allocations-easily/68285 "2022-06-01T22:31:52Z")

</div>

The manual recommends using @time and @allocated to examine memory use: https://docs.julialang.org/en/v1/manual/profile/#Memory-allocation-analysis It appears that both of those macros measure both stack and heap alloc…

---

## [Precompute some values of a function](https://discourse.julialang.org/t/precompute-some-values-of-a-function/82079)

<div class="topic-metadata">

**Author:** [@raphaelchinchilla](https://discourse.julialang.org/u/raphaelchinchilla)\
**Replies:** 7\
**Last updated:** [June 1, 2022, 8:46pm UTC](https://discourse.julialang.org/t/precompute-some-values-of-a-function/82079 "2022-06-01T20:46:20Z")

</div>

Consider the following MWE: d=rand(10^8); f(x,d) = x + sum(d) g(x) = f(x,d) If I run @benchmark f(1,d) and @benchmark g(1) (in the REPL), both take the same amount of time to run (which is what I kind of excepted). Is …

---

## [Plot of transient heat conduction](https://discourse.julialang.org/t/plot-of-transient-heat-conduction/81860)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 2\
**Last updated:** [June 1, 2022, 8:45pm UTC](https://discourse.julialang.org/t/plot-of-transient-heat-conduction/81860 "2022-06-01T20:45:00Z")

</div>

using Plots Δt=0.0001;Δz=0.0001; m=100; l=100 t=zeros(l);z=zeros(l);θ=zeros(l,l) z\[1\]=0;z\[l\]=1;θ\[1,l\]=0;θ\[l,1\]=1; θ\[:,end\]=θ\[:,end-1\] p=plot(); for i in 2:l-1 ,n in 2:l-1 z\[i\]=i\*Δz f=1/(z\[i\]-1) θ\[n,i\]=round(θ\[n+…

---

## [Is it possible to have multiple Manifest.toml files for the same project, corresponding to different Julia versions?](https://discourse.julialang.org/t/is-it-possible-to-have-multiple-manifest-toml-files-for-the-same-project-corresponding-to-different-julia-versions/82064)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [June 1, 2022, 8:00pm UTC](https://discourse.julialang.org/t/is-it-possible-to-have-multiple-manifest-toml-files-for-the-same-project-corresponding-to-different-julia-versions/82064 "2022-06-01T20:00:18Z")

</div>

I am testing my code on julia 1.8 parallelly with 1.7, and instantiating the environment on 1.8 gives me a warning that the packages have been resolved using julia 1.7, which might lead to unpredictable results. On the o…

---

## [Intermittent "WebIO not detected" after refreshing jupyter notebook (IJulia and PlotlyJS.jl)](https://discourse.julialang.org/t/intermittent-webio-not-detected-after-refreshing-jupyter-notebook-ijulia-and-plotlyjs-jl/82080)

<div class="topic-metadata">

**Author:** [@alicedb](https://discourse.julialang.org/u/alicedb)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 7:51pm UTC](https://discourse.julialang.org/t/intermittent-webio-not-detected-after-refreshing-jupyter-notebook-ijulia-and-plotlyjs-jl/82080 "2022-06-01T19:51:27Z")

</div>

I have this weird problem where after refreshing the page in the browser where the jupyter notebook lives WebIO starts complaining about not being detected in certain situations, but is still detected in others. I don’t …

---

## [JuMP broadcasting in @constraint involving expressions throws error](https://discourse.julialang.org/t/jump-broadcasting-in-constraint-involving-expressions-throws-error/82044)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 1\
**Last updated:** [June 1, 2022, 7:48pm UTC](https://discourse.julialang.org/t/jump-broadcasting-in-constraint-involving-expressions-throws-error/82044 "2022-06-01T19:48:46Z")

</div>

An example is given below. using JuMP model = JuMP.Model() @expression(model, x, zeros(AffExpr, 1, 4)) @expression(model, y, zeros(AffExpr, 2, 4)) @constraint(model, y .\>= x) # A: OK @constraint(model, x .\<= y) # B: …

---

## [Can't install any packages at all](https://discourse.julialang.org/t/cant-install-any-packages-at-all/82076)

<div class="topic-metadata">

**Author:** [@Vitali1sParadox](https://discourse.julialang.org/u/Vitali1sParadox)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 7:20pm UTC](https://discourse.julialang.org/t/cant-install-any-packages-at-all/82076 "2022-06-01T19:20:19Z")

</div>

Hey guys, I had been using Julia on Ubuntu 21.10 with a good experience until I just switched to OpenSUSE Tumbleweed a few days ago, that I don’t want to explain more detailed. I want to run Julia as a kernel n VSCode o…

---

## ["stack order" in Gadfly histogram](https://discourse.julialang.org/t/stack-order-in-gadfly-histogram/82065)

<div class="topic-metadata">

**Author:** [@Brinkhuis](https://discourse.julialang.org/u/Brinkhuis)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 5:03pm UTC](https://discourse.julialang.org/t/stack-order-in-gadfly-histogram/82065 "2022-06-01T17:03:23Z")

</div>

When plotting a “stacked histogram”, I would like the “stack order” to be the same as the legend order - Fair (first / bottom) and Ideal (last / top) - so that the colors are in order from light to dark. Like in this exa…

---

## [How does Eirene deal with unconnected nodes when using the distance matrix input?](https://discourse.julialang.org/t/how-does-eirene-deal-with-unconnected-nodes-when-using-the-distance-matrix-input/81941)

<div class="topic-metadata">

**Author:** [@MariaBras](https://discourse.julialang.org/u/MariaBras)\
**Replies:** 1\
**Last updated:** [June 1, 2022, 5:56pm UTC](https://discourse.julialang.org/t/how-does-eirene-deal-with-unconnected-nodes-when-using-the-distance-matrix-input/81941 "2022-06-01T17:56:05Z")

</div>

Hi, I’m new to Julia, and I’m trying to use Eirene to perform persistent homology on a (not directed, not weighted) network, plot the persistence barcode and diagrams. I use the distance matrix from csv input option. I…

---

## [OpenGL rendering with CUDA](https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063)

<div class="topic-metadata">

**Author:** [@Lads-oxygen](https://discourse.julialang.org/u/Lads-oxygen)\
**Replies:** 2\
**Last updated:** [June 1, 2022, 5:05pm UTC](https://discourse.julialang.org/t/opengl-rendering-with-cuda/82063 "2022-06-01T17:05:48Z")

</div>

I am currently working on a personal project on fractals to be specific, and have used CUDA to implement the computational aspect for a number of reasons. I haven’t optimised my kernel yet, although it runs fast enough f…

---

## [How to run noisy circuits in \`Yao.jl\`](https://discourse.julialang.org/t/how-to-run-noisy-circuits-in-yao-jl/81775)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 6\
**Last updated:** [June 1, 2022, 4:53pm UTC](https://discourse.julialang.org/t/how-to-run-noisy-circuits-in-yao-jl/81775 "2022-06-01T16:53:04Z")

</div>

I want to run simulations of noisy circuits (e.g. with a random Pauli error \[I, X, Y, Z\] with weights \[1-3p, p, p, p\] after each gate) in Yao.jl. My first thought was to use full density matrix simulations, but it seems…

---

## [Grid layouts stopped working with 3D Axis](https://discourse.julialang.org/t/grid-layouts-stopped-working-with-3d-axis/82059)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 7\
**Last updated:** [June 1, 2022, 4:02pm UTC](https://discourse.julialang.org/t/grid-layouts-stopped-working-with-3d-axis/82059 "2022-06-01T16:02:12Z")

</div>

This grid layout code used to work in 2D and 3D: using Meshes, MeshViz import CairoMakie as Mke # define a cube in R^3 points = Point3\[(0,0,0),(1,0,0),(1,1,0),(0,1,0),(0,0,1),(1,0,1),(1,1,1),(0,1,1)\] connec = connect.(…

---

## [Package load time regressions in v1.8-beta3](https://discourse.julialang.org/t/package-load-time-regressions-in-v1-8-beta3/78875)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 21\
**Last updated:** [June 1, 2022, 1:44pm UTC](https://discourse.julialang.org/t/package-load-time-regressions-in-v1-8-beta3/78875 "2022-06-01T13:44:53Z")

</div>

Did a quick test of 1.8-beta3 in comparison to 1.7.2. Results: Package load time (@time using KiteModels): Julia 1.7.2 3.3 s Julia 1.8 beta 3.8 s Execution time of the function loop(): Julia 1.7.2 910 ns Julia…

---

## [Julia Artifact Download Problem: How to tell Julia to follow 301-redirected downloads?](https://discourse.julialang.org/t/julia-artifact-download-problem-how-to-tell-julia-to-follow-301-redirected-downloads/82003)

<div class="topic-metadata">

**Author:** [@braza2](https://discourse.julialang.org/u/braza2)\
**Replies:** 9\
**Last updated:** [June 1, 2022, 2:04pm UTC](https://discourse.julialang.org/t/julia-artifact-download-problem-how-to-tell-julia-to-follow-301-redirected-downloads/82003 "2022-06-01T14:04:08Z")

</div>

Hi, as some other fellow Julia users I want to use Julia behind a corporate firewall which in some cases intercepts downloads, analyzes the content and then downloads the files. Therefore in the beginning I was not able…

---

## [Julia v1.8.0-rc1 is now available](https://discourse.julialang.org/t/julia-v1-8-0-rc1-is-now-available/82021)

<div class="topic-metadata">

**Author:** [@ararslan](https://discourse.julialang.org/u/ararslan)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 12:18am UTC](https://discourse.julialang.org/t/julia-v1-8-0-rc1-is-now-available/82021 "2022-06-01T00:18:26Z")

</div>

The Julia developers are pleased to announce that the first release candidate for Julia v1.8.0 is now available. Binaries are available at https://julialang.org/downloads/ in the “upcoming release” section for the follow…

---

## [Copycols in DataFrame and CSV package not working in julia 1.7.2](https://discourse.julialang.org/t/copycols-in-dataframe-and-csv-package-not-working-in-julia-1-7-2/82054)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 11\
**Last updated:** [June 1, 2022, 1:37pm UTC](https://discourse.julialang.org/t/copycols-in-dataframe-and-csv-package-not-working-in-julia-1-7-2/82054 "2022-06-01T13:37:17Z")

</div>

Hello, Good Morning I’m trying to make a immutable dataframe from a csv, but seems copycols = false parameter is not working on julia 1.7.2. Am I did in an obsolete way? data\_immutable = CSV.read("purchaseData.csv", c…

---

## [FigShare's API](https://discourse.julialang.org/t/figshares-api/81987)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [June 1, 2022, 12:55pm UTC](https://discourse.julialang.org/t/figshares-api/81987 "2022-06-01T12:55:39Z")

</div>

Depending on how easy it is, I would like to programmatically upload data to FigShare using their API. They have a Jupyter notebook showing how to do so here. It looks like they stream the data in chunks. Has anyone tri…

---

## [ModelingToolkit.jl trows error: statement is ambigous](https://discourse.julialang.org/t/modelingtoolkit-jl-trows-error-statement-is-ambigous/82045)

<div class="topic-metadata">

**Author:** [@Davide\_Degavi](https://discourse.julialang.org/u/Davide_Degavi)\
**Replies:** 3\
**Last updated:** [June 1, 2022, 11:56am UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-trows-error-statement-is-ambigous/82045 "2022-06-01T11:56:25Z")

</div>

Hi everyone, I’m new to Julia so maybe the problem that I’ve anecountered is preatty trivial. Basically I have two main problem with the simple symbolic equation expressing the kinetic energy of a rigid body satellite. …

---

## [Remove leading zeros from string to int](https://discourse.julialang.org/t/remove-leading-zeros-from-string-to-int/82048)

<div class="topic-metadata">

**Author:** [@Billpete002](https://discourse.julialang.org/u/Billpete002)\
**Replies:** 1\
**Last updated:** [June 1, 2022, 11:43am UTC](https://discourse.julialang.org/t/remove-leading-zeros-from-string-to-int/82048 "2022-06-01T11:43:40Z")

</div>

So my data looks like: Stay Duration string3? ------- 001 012 missing 002 What I would like is someway to convert these to Int: Stay Duration Int64 ------- 1 12 missing 2 My normal method of converting a string to in…

---

## [CUDA arrays not working well with broadcast!(), and other in-place operations inside a loop](https://discourse.julialang.org/t/cuda-arrays-not-working-well-with-broadcast-and-other-in-place-operations-inside-a-loop/81965)

<div class="topic-metadata">

**Author:** [@ayushinav](https://discourse.julialang.org/u/ayushinav)\
**Replies:** 4\
**Last updated:** [June 1, 2022, 10:56am UTC](https://discourse.julialang.org/t/cuda-arrays-not-working-well-with-broadcast-and-other-in-place-operations-inside-a-loop/81965 "2022-06-01T10:56:23Z")

</div>

Hey guys, I was working on using GPUs for my codes, and came across this unusual anomaly. I am using Flux.jl along with CUDA.jl. Let’s define the variables first: rickfg= fill(0 .+ im\*0., nf, 1, 1, 1, 1, 1) |\>gpu; # F…

---

## [Just cleaned up 17G of registries](https://discourse.julialang.org/t/just-cleaned-up-17g-of-registries/82049)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 10:51am UTC](https://discourse.julialang.org/t/just-cleaned-up-17g-of-registries/82049 "2022-06-01T10:51:08Z")

</div>

Until today, running Pkg.update() each time took nearly 2 minutes just for the step “Updating registry” on my laptop. I thought this was the case for all Julia users, until I found some discussions on this issue after se…

---

## [How to improve type-inference in Folds.map?](https://discourse.julialang.org/t/how-to-improve-type-inference-in-folds-map/82040)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [June 1, 2022, 8:59am UTC](https://discourse.julialang.org/t/how-to-improve-type-inference-in-folds-map/82040 "2022-06-01T08:59:33Z")

</div>

Eg julia\> @code\_warntype Folds.map(1:10) do i i^2 end MethodInstance for Folds.map(::var"#3#4", ::UnitRange{Int64}) from map(f, itr; kwargs...) in Folds.Implementations at /home/jishnu/.julia/packages/Fo…

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

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