# Latest

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

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

**Page:** 1350

---

## [Macro to automatically add method with default\_rng() for functions using RNGs](https://discourse.julialang.org/t/macro-to-automatically-add-method-with-default-rng-for-functions-using-rngs/63556)

<div class="topic-metadata">

**Author:** [@Luapulu](https://discourse.julialang.org/u/Luapulu)\
**Replies:** 1\
**Last updated:** [June 25, 2021, 3:57pm UTC](https://discourse.julialang.org/t/macro-to-automatically-add-method-with-default-rng-for-functions-using-rngs/63556 "2021-06-25T15:57:38Z")

</div>

Does anybody have a macro so I can write something like @with\_default\_rng function my\_func(rng::AbstractRNG, x, y, z) out = # do something with rng, x, y, z return out end and it will automatically add the met…

---

## [Cant compile CUDA v3.3.1 on PowerPC : TypeError in Atomic](https://discourse.julialang.org/t/cant-compile-cuda-v3-3-1-on-powerpc-typeerror-in-atomic/63537)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 2\
**Last updated:** [June 25, 2021, 3:35pm UTC](https://discourse.julialang.org/t/cant-compile-cuda-v3-3-1-on-powerpc-typeerror-in-atomic/63537 "2021-06-25T15:35:54Z")

</div>

Hi, running on a powerPC arch, I was previously with CUDA v3.2.1, upgrading to v3.3.1 I get ulia\> using CUDA \[ Info: Precompiling CUDA \[052768ef-5323-5732-b1bb-66c8b64840ba\] ERROR: LoadError: LoadError: TypeError: in At…

---

## [In place assignment of scalars vs vectors](https://discourse.julialang.org/t/in-place-assignment-of-scalars-vs-vectors/63542)

<div class="topic-metadata">

**Author:** [@lorenzo.a.ricciardi](https://discourse.julialang.org/u/lorenzo.a.ricciardi)\
**Replies:** 20\
**Last updated:** [June 25, 2021, 2:40pm UTC](https://discourse.julialang.org/t/in-place-assignment-of-scalars-vs-vectors/63542 "2021-06-25T14:40:06Z")

</div>

Hi all, I’m writing a performance critical function that will be called many times within an optimization loop. I have several questions regarding how to make it as efficient as possible, but I’ll break those down so t…

---

## [Error precompiling DataFrames: UndefVarError: ComposedFunction not defined](https://discourse.julialang.org/t/error-precompiling-dataframes-undefvarerror-composedfunction-not-defined/63555)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 2\
**Last updated:** [June 25, 2021, 2:39pm UTC](https://discourse.julialang.org/t/error-precompiling-dataframes-undefvarerror-composedfunction-not-defined/63555 "2021-06-25T14:39:03Z")

</div>

Dear folks, I work in a project using a specific Project.toml in which I have not updated the packages for a while because everything was working fine. When I start that project now and instantiate it with Pkg, there i…

---

## [Two y-axis overlaps in pyplot](https://discourse.julialang.org/t/two-y-axis-overlaps-in-pyplot/63540)

<div class="topic-metadata">

**Author:** [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Replies:** 4\
**Last updated:** [June 25, 2021, 1:13pm UTC](https://discourse.julialang.org/t/two-y-axis-overlaps-in-pyplot/63540 "2021-06-25T13:13:33Z")

</div>

I expect to have two y-axis one on the left and another on the right. but it shows overlapped y-axis on the left. @show backend() x = 1:10 y1 = log.(x) y2 = y1 + 0.05\*randn(10) plot(x, y1, xlabel="x", ylabel="log(x)", t…

---

## [How to plot alternating background colors with Plots.jl](https://discourse.julialang.org/t/how-to-plot-alternating-background-colors-with-plots-jl/63548)

<div class="topic-metadata">

**Author:** [@kaslusimoes](https://discourse.julialang.org/u/kaslusimoes)\
**Replies:** 1\
**Last updated:** [June 25, 2021, 1:01pm UTC](https://discourse.julialang.org/t/how-to-plot-alternating-background-colors-with-plots-jl/63548 "2021-06-25T13:01:07Z")

</div>

Hi, I want to plot a time series but visualize a few segments with different background colors. My idea of the code would be something like plot(\[1:4 5:8\], \[rand(4) rand(4)\], bg\_inside = \[:darkblue :red\]), but that sel…

---

## [Pull requests of new version of package stalled on the general registry](https://discourse.julialang.org/t/pull-requests-of-new-version-of-package-stalled-on-the-general-registry/63538)

<div class="topic-metadata">

**Author:** [@tencnivel](https://discourse.julialang.org/u/tencnivel)\
**Replies:** 1\
**Last updated:** [June 25, 2021, 12:26pm UTC](https://discourse.julialang.org/t/pull-requests-of-new-version-of-package-stalled-on-the-general-registry/63538 "2021-06-25T12:26:34Z")

</div>

Hi everyone, The pull request of the latest version of my package (PostgresORM v0.1.1) on the General registry is stalled. I submitted v0.1.1 with the exact same command as when submitting v0.1.0 which was the very f…

---

## [Writing GPU Shaders in Julia](https://discourse.julialang.org/t/writing-gpu-shaders-in-julia/60669)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 4\
**Last updated:** [June 25, 2021, 12:14pm UTC](https://discourse.julialang.org/t/writing-gpu-shaders-in-julia/60669 "2021-06-25T12:14:53Z")

</div>

I was going over the GLAbstraction tutorials to learn how do do simple animations on the GPU, and things work fairly well. One pain point, however, is that the shaders needs to be written in a special language, meaning …

---

## [Conditional array comprehension vs. simple for loop - 750k allocations vs. 1 allocation - why?](https://discourse.julialang.org/t/conditional-array-comprehension-vs-simple-for-loop-750k-allocations-vs-1-allocation-why/63249)

<div class="topic-metadata">

**Author:** [@jlawrie](https://discourse.julialang.org/u/jlawrie)\
**Replies:** 14\
**Last updated:** [June 25, 2021, 8:26am UTC](https://discourse.julialang.org/t/conditional-array-comprehension-vs-simple-for-loop-750k-allocations-vs-1-allocation-why/63249 "2021-06-25T08:26:54Z")

</div>

Hello! Thanks for taking a moment to have a look at my question :slight\_smile: Full disclosure: I’m only a few weeks into learning Julia, brand new to Discourse and an interdisciplinary engineer (not a computer scienti…

---

## [GRPC, ProtoBuf, and HTTP](https://discourse.julialang.org/t/grpc-protobuf-and-http/14547)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 5\
**Last updated:** [June 25, 2021, 10:34am UTC](https://discourse.julialang.org/t/grpc-protobuf-and-http/14547 "2021-06-25T10:34:15Z")

</div>

Hi all, I am wondering if anyone has had some experience writing a GRPC client and/or server using the ProtoBuf.jl and HTTP.jl packages (both of which appear to be in good working order for 1.0). I found an old GRPC.jl …

---

## [I just decided to migrate from Python+Fortran to Julia as Julia was faster in my test](https://discourse.julialang.org/t/i-just-decided-to-migrate-from-python-fortran-to-julia-as-julia-was-faster-in-my-test/61188)

<div class="topic-metadata">

**Author:** [@martin.d.maas](https://discourse.julialang.org/u/martin.d.maas)\
**Replies:** 37\
**Last updated:** [June 25, 2021, 10:29am UTC](https://discourse.julialang.org/t/i-just-decided-to-migrate-from-python-fortran-to-julia-as-julia-was-faster-in-my-test/61188 "2021-06-25T10:29:56Z")

</div>

Hello everyone! I just wanted to say hi and share what made me change my mind about my current setting. I am an applied mathematician working in scientific computing and geospatial data analysis. On the scientific comp…

---

## [Will the use of \`@code\_native\` compile and cache function?](https://discourse.julialang.org/t/will-the-use-of-code-native-compile-and-cache-function/63534)

<div class="topic-metadata">

**Author:** [@mobius-eng](https://discourse.julialang.org/u/mobius-eng)\
**Replies:** 1\
**Last updated:** [June 25, 2021, 9:42am UTC](https://discourse.julialang.org/t/will-the-use-of-code-native-compile-and-cache-function/63534 "2021-06-25T09:42:45Z")

</div>

I want to compile and cache some of the functions at the start of Julia session - I find it less disruptive compared to the slow first run. Will calling them with @code\_native and passing dummy arguments of appropriate …

---

## [Unexpected index of Unicode subscript \`char\` in \`string\`?](https://discourse.julialang.org/t/unexpected-index-of-unicode-subscript-char-in-string/63515)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 8\
**Last updated:** [June 25, 2021, 9:29am UTC](https://discourse.julialang.org/t/unexpected-index-of-unicode-subscript-char-in-string/63515 "2021-06-25T09:29:42Z")

</div>

It seems that in some cases the indexing of subscript char is wrong: julia\> "a₁"\[1\] 'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase) julia\> "a₁"\[2\] '₁': Unicode U+2081 (category No: Number, other) julia\> "α₁…

---

## [Tell the compiler that two code paths yield the same type](https://discourse.julialang.org/t/tell-the-compiler-that-two-code-paths-yield-the-same-type/63535)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 4\
**Last updated:** [June 25, 2021, 9:09am UTC](https://discourse.julialang.org/t/tell-the-compiler-that-two-code-paths-yield-the-same-type/63535 "2021-06-25T09:09:31Z")

</div>

Every now and then I have code like this: function calculate\_or\_lookup(...) if iscached(...) return load\_from\_cache(...) # cheap else return calculate(...) # expensive end end As a programme…

---

## [Pkg, private registries and corporate firewalls?](https://discourse.julialang.org/t/pkg-private-registries-and-corporate-firewalls/63065)

<div class="topic-metadata">

**Author:** [@gleyland](https://discourse.julialang.org/u/gleyland)\
**Replies:** 8\
**Last updated:** [June 25, 2021, 8:44am UTC](https://discourse.julialang.org/t/pkg-private-registries-and-corporate-firewalls/63065 "2021-06-25T08:44:46Z")

</div>

Hi, At work we’re behind a firewall, we build Julia code into docker images, and we now have a private registry and some packages on Bitbucket (thanks to LocalRegistry.jl!) This combination, along with some documented …

---

## [Nested access of DataFrame](https://discourse.julialang.org/t/nested-access-of-dataframe/63525)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 8\
**Last updated:** [June 25, 2021, 7:45am UTC](https://discourse.julialang.org/t/nested-access-of-dataframe/63525 "2021-06-25T07:45:30Z")

</div>

Hi, I’m looking forward to dealing with nested access of DataFrame. For example, julia\> using DataFrames julia\> xs = \[Dict(:x =\> 1, :y =\> 1)\] 1-element Vector{Dict{Symbol, Int64}}: Dict(:y =\> 1, :x =\> 1) julia\> pus…

---

## [(Plots.jl) linked (aligned) x-axis figures with outer legends](https://discourse.julialang.org/t/plots-jl-linked-aligned-x-axis-figures-with-outer-legends/63523)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 9\
**Last updated:** [June 25, 2021, 7:33am UTC](https://discourse.julialang.org/t/plots-jl-linked-aligned-x-axis-figures-with-outer-legends/63523 "2021-06-25T07:33:27Z")

</div>

I’m trying to align x-axis of subfigures where the subfigures have legends at e.g. :outerlefttop. For example, inner legends imply aligned x-axis subfigures. However, outer legends do not.

---

## [\[ANN\] SchwarzschildGeo.jl](https://discourse.julialang.org/t/ann-schwarzschildgeo-jl/63463)

<div class="topic-metadata">

**Author:** [@inokawazu](https://discourse.julialang.org/u/inokawazu)\
**Replies:** 4\
**Last updated:** [June 25, 2021, 5:23am UTC](https://discourse.julialang.org/t/ann-schwarzschildgeo-jl/63463 "2021-06-25T05:23:07Z")

</div>

Hello everyone. I just completed a small package to render a Schwarzschild Black hole with various backgrounds. https://github.com/inokawazu/SchwarzschildGeo.jl

---

## [How to turn this code snippet into a "callable struct with functions"?](https://discourse.julialang.org/t/how-to-turn-this-code-snippet-into-a-callable-struct-with-functions/63504)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 4\
**Last updated:** [June 25, 2021, 4:40am UTC](https://discourse.julialang.org/t/how-to-turn-this-code-snippet-into-a-callable-struct-with-functions/63504 "2021-06-25T04:40:47Z")

</div>

Hi, My first Julia code below is a simple array-based priority queue with some performance tests for push and pop. Next step would be to make this into something callable like pq1 = pq(Float64,Any) push\_pq!(pq1, 1.1…

---

## [How to accomplish \`\[x\*y for x in 1:y, y in 1:5\]\`?](https://discourse.julialang.org/t/how-to-accomplish-x-y-for-x-in-1-y-y-in-1-5/63522)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 2\
**Last updated:** [June 25, 2021, 2:36am UTC](https://discourse.julialang.org/t/how-to-accomplish-x-y-for-x-in-1-y-y-in-1-5/63522 "2021-06-25T02:36:50Z")

</div>

How can I make a nested list comprehension where the inner iterator depends on the outer one? Using a for loop, I can do res = \[\] for y in 1:5, x in 1:y push!(res, x\*y) end but I would like to accomplish the same …

---

## [Is there a Julia equivalent for this Python syntax](https://discourse.julialang.org/t/is-there-a-julia-equivalent-for-this-python-syntax/63439)

<div class="topic-metadata">

**Author:** [@james-garfield](https://discourse.julialang.org/u/james-garfield)\
**Replies:** 17\
**Last updated:** [June 25, 2021, 12:47am UTC](https://discourse.julialang.org/t/is-there-a-julia-equivalent-for-this-python-syntax/63439 "2021-06-25T00:47:09Z")

</div>

I like how in python I can set a variable in a function as None if I don’t always need to use it. And if the function does end up being called with that variable passed in I can check in the function body by doing: id =…

---

## [Agents OSM not working](https://discourse.julialang.org/t/agents-osm-not-working/63481)

<div class="topic-metadata">

**Author:** [@Rajith\_Vidanaarachch](https://discourse.julialang.org/u/Rajith_Vidanaarachch)\
**Replies:** 8\
**Last updated:** [June 24, 2021, 11:50am UTC](https://discourse.julialang.org/t/agents-osm-not-working/63481 "2021-06-24T11:50:28Z")

</div>

All the methods in OSM submodule aren’t being recognised. However, the deprecated methods are recognised. This is my help? output when I search for OSM. help?\> OSM search: OSMSpace OSMAgent osm\_road osm\_latlon osm\_plan…

---

## [Suggestions for discrete event simulation](https://discourse.julialang.org/t/suggestions-for-discrete-event-simulation/63497)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 2\
**Last updated:** [June 24, 2021, 10:45pm UTC](https://discourse.julialang.org/t/suggestions-for-discrete-event-simulation/63497 "2021-06-24T22:45:25Z")

</div>

I’m trying to put together a simple discrete event simulation of a transport network. You can think of the model as a set of nodes, with shipments between nodes based on random orders coming into each node at each point…

---

## [Problems scaling jl\_alloc\_array\_2d C API](https://discourse.julialang.org/t/problems-scaling-jl-alloc-array-2d-c-api/63341)

<div class="topic-metadata">

**Author:** [@sdeoras](https://discourse.julialang.org/u/sdeoras)\
**Replies:** 18\
**Last updated:** [June 24, 2021, 10:29pm UTC](https://discourse.julialang.org/t/problems-scaling-jl-alloc-array-2d-c-api/63341 "2021-06-24T22:29:00Z")

</div>

I am observing a strange behavior with jl\_alloc\_array\_2d C API when matrix size is \> 300x300 float64. This is very strange because I am not seeing any issue creating a matrix and passing to a function for sizes lower tha…

---

## [Are arrays the same as lists in Julia?](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511)

<div class="topic-metadata">

**Author:** [@Galaxy\_Being](https://discourse.julialang.org/u/Galaxy_Being)\
**Replies:** 5\
**Last updated:** [June 24, 2021, 8:48pm UTC](https://discourse.julialang.org/t/are-arrays-the-same-as-lists-in-julia/63511 "2021-06-24T20:48:32Z")

</div>

Coming from Scheme, Lisp, Haskell, lists are very important and used a lot. Is a Julia array the Julia version of a list, ie, use the same way as a list would be in Haskell or scheme?

---

## [Where to write a command](https://discourse.julialang.org/t/where-to-write-a-command/63512)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 4\
**Last updated:** [June 24, 2021, 8:35pm UTC](https://discourse.julialang.org/t/where-to-write-a-command/63512 "2021-06-24T20:35:35Z")

</div>

Hello, I am trying to implement the same steps as in: But I didnot know where to write this command: $ for n in 1 2 4 8 16; do JULIA\_NUM\_THREADS=$n ./julia psort.jl; done is it in the PowerShell? Thanks

---

## [Serialization/Deserialization what am I doing wrong?](https://discourse.julialang.org/t/serialization-deserialization-what-am-i-doing-wrong/63513)

<div class="topic-metadata">

**Author:** [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)\
**Replies:** 1\
**Last updated:** [June 24, 2021, 8:15pm UTC](https://discourse.julialang.org/t/serialization-deserialization-what-am-i-doing-wrong/63513 "2021-06-24T20:15:17Z")

</div>

When I enter the following in REPL, using Serialization buffer = IOBuffer() serialize(buffer, \[1,2,3\]) deserialize(buffer) I get this error: ERROR: EOFError: read end of file Stacktrace: \[1\] read @ ./iobuffer.jl:2…

---

## [Numpy to Julia conversion questions](https://discourse.julialang.org/t/numpy-to-julia-conversion-questions/63509)

<div class="topic-metadata">

**Author:** [@Phil\_Tomson](https://discourse.julialang.org/u/Phil_Tomson)\
**Replies:** 1\
**Last updated:** [June 24, 2021, 6:02pm UTC](https://discourse.julialang.org/t/numpy-to-julia-conversion-questions/63509 "2021-06-24T18:02:07Z")

</div>

As an exercise I’m converting this Python Differential Evolution tutorial code to Julia (https://machinelearningmastery.com/differential-evolution-from-scratch-in-python/) Here’s enough of the python to get going: fro…

---

## [ILU preconditioned GMRES inside TRBDF2 for ODEs generated by NetworkDynamics.jl](https://discourse.julialang.org/t/ilu-preconditioned-gmres-inside-trbdf2-for-odes-generated-by-networkdynamics-jl/63385)

<div class="topic-metadata">

**Author:** [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Replies:** 6\
**Last updated:** [June 24, 2021, 4:47pm UTC](https://discourse.julialang.org/t/ilu-preconditioned-gmres-inside-trbdf2-for-odes-generated-by-networkdynamics-jl/63385 "2021-06-24T16:47:29Z")

</div>

We are solving differential equations defined on a graph using NetworkDynamics.jl and DifferentialEquations.jl. In this context we have the two questions outlined below. Thx. Domenico Lahaye. 1/ Switching the automatic…

---

## [Problem with installing installing HiddenMarkovModels.jl](https://discourse.julialang.org/t/problem-with-installing-installing-hiddenmarkovmodels-jl/63390)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 13\
**Last updated:** [June 24, 2021, 4:17pm UTC](https://discourse.julialang.org/t/problem-with-installing-installing-hiddenmarkovmodels-jl/63390 "2021-06-24T16:17:48Z")

</div>

I was trying to install the HiddenMarkovModels.jl package, by copy pasting the command julia\> Pkg.add("HiddenMarkovModels") But it throws the error ERROR: The following package names could not be resolved: \* HiddenMa…

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

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