# Latest

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

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

**Page:** 1204

---

## [IntelliSense for a package](https://discourse.julialang.org/t/intellisense-for-a-package/71667)

<div class="topic-metadata">

**Author:** [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)\
**Replies:** 0\
**Last updated:** [November 17, 2021, 3:45pm UTC](https://discourse.julialang.org/t/intellisense-for-a-package/71667 "2021-11-17T15:45:53Z")

</div>

How do I enable intellisense when downloading a package from the internet? Say, for instance, if I clone https://github.com/JuliaWeb/HTTP.jl and open its folder by vscode, then the IDE displays the info message “Setting …

---

## [Sorting multidimensional arrays](https://discourse.julialang.org/t/sorting-multidimensional-arrays/71657)

<div class="topic-metadata">

**Author:** [@rolim.gustavo](https://discourse.julialang.org/u/rolim.gustavo)\
**Replies:** 3\
**Last updated:** [November 17, 2021, 3:45pm UTC](https://discourse.julialang.org/t/sorting-multidimensional-arrays/71657 "2021-11-17T15:45:48Z")

</div>

Hi, I am currently working on a scheduling problem which has a solution represented by a multidimensional array called Sol. For instance, Sol = \[\[4, 1, 5, 2\], \[3, 6, 10, 9, 7, 8\]\]. Each row is represented by a permutat…

---

## [Reading an unknown number of lines from a socket using asynchronous IO](https://discourse.julialang.org/t/reading-an-unknown-number-of-lines-from-a-socket-using-asynchronous-io/71609)

<div class="topic-metadata">

**Author:** [@Paulo\_Jabardo](https://discourse.julialang.org/u/Paulo_Jabardo)\
**Replies:** 3\
**Last updated:** [November 17, 2021, 3:19pm UTC](https://discourse.julialang.org/t/reading-an-unknown-number-of-lines-from-a-socket-using-asynchronous-io/71609 "2021-11-17T15:19:53Z")

</div>

I have an instrument (pressure scanner) that measures pressure and communicates using TCP/IP. I’m having difficulty with asynchronous IO: some operations when reading the instrument return several lines of text and I don…

---

## [BenchmarkTools setup isn't run between each iteration?](https://discourse.julialang.org/t/benchmarktools-setup-isnt-run-between-each-iteration/36258)

<div class="topic-metadata">

**Author:** [@DNF](https://discourse.julialang.org/u/DNF)\
**Replies:** 6\
**Last updated:** [November 17, 2021, 2:37pm UTC](https://discourse.julialang.org/t/benchmarktools-setup-isnt-run-between-each-iteration/36258 "2021-11-17T14:37:02Z")

</div>

Can someone explain to me what’s going on here? I would not expect the error that happens for the short input vector: julia\> using BenchmarkTools julia\> @btime pop!(v) setup=(v=rand(1000)); 8.295 ns (0 allocations: 0…

---

## [Creating dataframe with arrays of different length](https://discourse.julialang.org/t/creating-dataframe-with-arrays-of-different-length/71642)

<div class="topic-metadata">

**Author:** [@jnewbie](https://discourse.julialang.org/u/jnewbie)\
**Replies:** 12\
**Last updated:** [November 17, 2021, 2:02pm UTC](https://discourse.julialang.org/t/creating-dataframe-with-arrays-of-different-length/71642 "2021-11-17T14:02:46Z")

</div>

Hi, I have 3 arrays with which I´d like to make a dataframe where each column corresponds to an array ( column 1 = abc, column 2 = def, column 3 = ghi) and the column names to the names of the arrays. I tried hcat but …

---

## [CUDA eigenvalues of a sparse matrix](https://discourse.julialang.org/t/cuda-eigenvalues-of-a-sparse-matrix/46851)

<div class="topic-metadata">

**Author:** [@8me](https://discourse.julialang.org/u/8me)\
**Replies:** 8\
**Last updated:** [November 17, 2021, 1:51pm UTC](https://discourse.julialang.org/t/cuda-eigenvalues-of-a-sparse-matrix/46851 "2021-11-17T13:51:20Z")

</div>

I’m trying to optimize the eigenvalue (and eigenvector) calculation for a neutrino oscillation package which is currently under development (https://github.com/KM3NeT/Neurthino.jl). The problem consists of a lot of smal…

---

## [Addprocs(\["ip.ip.ip.ip"\], ...) hangs on Windows, works on Linux VM on same machine](https://discourse.julialang.org/t/addprocs-ip-ip-ip-ip-hangs-on-windows-works-on-linux-vm-on-same-machine/71659)

<div class="topic-metadata">

**Author:** [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Replies:** 0\
**Last updated:** [November 17, 2021, 1:31pm UTC](https://discourse.julialang.org/t/addprocs-ip-ip-ip-ip-hangs-on-windows-works-on-linux-vm-on-same-machine/71659 "2021-11-17T13:31:19Z")

</div>

I have 3 Julia instances, Windows, Linux in a QEMU VM on the same machine and remote Linux. I mention the Remote / VM thing to eliminate network issues. The same happens from the Windows machine to the VM. Julia on Wi…

---

## [Unix2datetime issue?](https://discourse.julialang.org/t/unix2datetime-issue/71645)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 4\
**Last updated:** [November 17, 2021, 1:30pm UTC](https://discourse.julialang.org/t/unix2datetime-issue/71645 "2021-11-17T13:30:16Z")

</div>

Take the following timestamp: 1634587200000 Convert it with: unix2datetime(1634587200000) 53768-01-03T08:00:00 If I go to: Unix Time Stamp - Epoch Converter, the result is Mon Oct 18 2021 20:00:00 GMT+0000 What am I …

---

## [Can not update registry because download fails for "unexpected end of data"](https://discourse.julialang.org/t/can-not-update-registry-because-download-fails-for-unexpected-end-of-data/67041)

<div class="topic-metadata">

**Author:** [@melonedo](https://discourse.julialang.org/u/melonedo)\
**Replies:** 2\
**Last updated:** [November 17, 2021, 1:05pm UTC](https://discourse.julialang.org/t/can-not-update-registry-because-download-fails-for-unexpected-end-of-data/67041 "2021-11-17T13:05:50Z")

</div>

When I try to install a package or update, package manager errors because downloaded file is corrupted (I checked with 7-zip and it complains with unexpected end of data too). Contrasted to download failure, pkg errors o…

---

## [UndefVarError from macro](https://discourse.julialang.org/t/undefvarerror-from-macro/71630)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [November 17, 2021, 12:53pm UTC](https://discourse.julialang.org/t/undefvarerror-from-macro/71630 "2021-11-17T12:53:32Z")

</div>

How can I fix this error? using MacroTools: postwalk macro mymac(e) postwalk(x -\> (x isa Expr && x.head isa Symbol && x.head == :. ? esc(:($x isa String ? (return $x) : $x isa Int ? $(x).val : throw("invalid"…

---

## [Printing output on screen](https://discourse.julialang.org/t/printing-output-on-screen/71656)

<div class="topic-metadata">

**Author:** [@Dan.phi](https://discourse.julialang.org/u/Dan.phi)\
**Replies:** 1\
**Last updated:** [November 17, 2021, 12:53pm UTC](https://discourse.julialang.org/t/printing-output-on-screen/71656 "2021-11-17T12:53:31Z")

</div>

Consider the following small example: for i in 1:10 println("Iteration: $(i)/10") end This shows up on the screen as follows: In each iteration, a new line is added. Is there any way that would ensure that visua…

---

## [\[ANN\] TerminalClock.jl](https://discourse.julialang.org/t/ann-terminalclock-jl/71650)

<div class="topic-metadata">

**Author:** [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Replies:** 0\
**Last updated:** [November 17, 2021, 11:34am UTC](https://discourse.julialang.org/t/ann-terminalclock-jl/71650 "2021-11-17T11:34:49Z")

</div>

Hello everyone. I’m happy to announce the release of TerminalClock.jl :mantelpiece\_clock:. You can install it via: \] add TerminalClock This package provides us the following functionalities: What time is it now? …

---

## [How to Maximize CPU Utilization - @spawn Assigning to Busy Workers - Use pmap Instead](https://discourse.julialang.org/t/how-to-maximize-cpu-utilization-spawn-assigning-to-busy-workers-use-pmap-instead/53648)

<div class="topic-metadata">

**Author:** [@dburch](https://discourse.julialang.org/u/dburch)\
**Replies:** 17\
**Last updated:** [November 17, 2021, 12:29pm UTC](https://discourse.julialang.org/t/how-to-maximize-cpu-utilization-spawn-assigning-to-busy-workers-use-pmap-instead/53648 "2021-11-17T12:29:31Z")

</div>

This is partially a performance question. I have a parallel process that is working. However, by using @spawn, all of the tasks are spawned to the available workers before any of the tasks start running. It doesn’t seem …

---

## [2D nested loop gives big performance hit in interpolation routine while it should not](https://discourse.julialang.org/t/2d-nested-loop-gives-big-performance-hit-in-interpolation-routine-while-it-should-not/71651)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 2\
**Last updated:** [November 17, 2021, 12:29pm UTC](https://discourse.julialang.org/t/2d-nested-loop-gives-big-performance-hit-in-interpolation-routine-while-it-should-not/71651 "2021-11-17T12:29:22Z")

</div>

I have written a macro that generates fast trilinear interpolation functions for 2x2x2 upsampling with threading. The code runs fine and is on average an order of magnitude faster than Interpolations.jl (which I probably…

---

## [How to benchmark append!?](https://discourse.julialang.org/t/how-to-benchmark-append/47272)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 13\
**Last updated:** [November 17, 2021, 11:43am UTC](https://discourse.julialang.org/t/how-to-benchmark-append/47272 "2021-11-17T11:43:50Z")

</div>

I am trying to benchmark a code that calls append, but the results do not seem to make sense. The minimal working example which I do not understand is: julia\> using BenchmarkTools julia\> x = \[0\]; y = zeros(100); @btime …

---

## [Comparison between MPI.jl and Distributed.jl](https://discourse.julialang.org/t/comparison-between-mpi-jl-and-distributed-jl/71646)

<div class="topic-metadata">

**Author:** [@thudjx](https://discourse.julialang.org/u/thudjx)\
**Replies:** 1\
**Last updated:** [November 17, 2021, 10:49am UTC](https://discourse.julialang.org/t/comparison-between-mpi-jl-and-distributed-jl/71646 "2021-11-17T10:49:35Z")

</div>

What is the difference between MPI.jl and Distributed.jl? Are they designed for different usage? If not, which one should I go deep?

---

## [Use pmap(f,x) when f takes multiple arguments?](https://discourse.julialang.org/t/use-pmap-f-x-when-f-takes-multiple-arguments/65761)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 3\
**Last updated:** [November 17, 2021, 9:44am UTC](https://discourse.julialang.org/t/use-pmap-f-x-when-f-takes-multiple-arguments/65761 "2021-11-17T09:44:22Z")

</div>

How can I call pmap(f,x) where f is a function that takes additional parameters? I have a function f(x,y) where y is always known and I want to run pmap on elements of x. Here is an example that works (without distribu…

---

## [When compiler decide it will use generated function](https://discourse.julialang.org/t/when-compiler-decide-it-will-use-generated-function/71636)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 3\
**Last updated:** [November 17, 2021, 9:31am UTC](https://discourse.julialang.org/t/when-compiler-decide-it-will-use-generated-function/71636 "2021-11-17T09:31:36Z")

</div>

Hello, I am reading and experimenting with generated functions. The docs mention to give the compiler an option to use or not use the generated function using the construction function foo(x) if @generated :(x+…

---

## [Getting function signature expression from method instance](https://discourse.julialang.org/t/getting-function-signature-expression-from-method-instance/71639)

<div class="topic-metadata">

**Author:** [@disberd](https://discourse.julialang.org/u/disberd)\
**Replies:** 0\
**Last updated:** [November 17, 2021, 9:08am UTC](https://discourse.julialang.org/t/getting-function-signature-expression-from-method-instance/71639 "2021-11-17T09:08:20Z")

</div>

Is there an existing function to get a method definition expression from the Method instance? As example, I would like to have some function signature\_expression such that: ff(a::T, b::C, c::Tuple{Real,Real}) where {T \<…

---

## [How to add norm of gradient to a loss function?](https://discourse.julialang.org/t/how-to-add-norm-of-gradient-to-a-loss-function/69873)

<div class="topic-metadata">

**Author:** [@AlexLewandowski](https://discourse.julialang.org/u/AlexLewandowski)\
**Replies:** 16\
**Last updated:** [November 17, 2021, 7:56am UTC](https://discourse.julialang.org/t/how-to-add-norm-of-gradient-to-a-loss-function/69873 "2021-11-17T07:56:08Z")

</div>

I am trying to add a gradient norm penalty to a loss function similar to WGAN-GP (\[1704.00028\] Improved Training of Wasserstein GANs, Alg 1, Lines 7-9). However, I am running into problems with mutation. Is there another…

---

## [How to store data from a nested for loop?](https://discourse.julialang.org/t/how-to-store-data-from-a-nested-for-loop/71602)

<div class="topic-metadata">

**Author:** [@Mitch](https://discourse.julialang.org/u/Mitch)\
**Replies:** 5\
**Last updated:** [November 17, 2021, 8:08am UTC](https://discourse.julialang.org/t/how-to-store-data-from-a-nested-for-loop/71602 "2021-11-17T08:08:25Z")

</div>

Hello! I have a nested for loop, which should result in a vector of vectors. Unfortunately, I’m only getting the end result, rather than each iteration. I’m probably missing something obvious about nested for loops; min…

---

## [Broadcasting sampling of the variable size](https://discourse.julialang.org/t/broadcasting-sampling-of-the-variable-size/71632)

<div class="topic-metadata">

**Author:** [@Oko](https://discourse.julialang.org/u/Oko)\
**Replies:** 1\
**Last updated:** [November 17, 2021, 8:02am UTC](https://discourse.julialang.org/t/broadcasting-sampling-of-the-variable-size/71632 "2021-11-17T08:02:13Z")

</div>

I would like to use broadcast to do repetitive sampling from an array with the added twist that samples are of variable sizes. In plain English I would like to replace the following for loop with a fancy code using Stat…

---

## [Unable to precompile DifferentialEquations.jl in Juno IDE in new environment and empty project](https://discourse.julialang.org/t/unable-to-precompile-differentialequations-jl-in-juno-ide-in-new-environment-and-empty-project/71608)

<div class="topic-metadata">

**Author:** [@yewalenikhil65](https://discourse.julialang.org/u/yewalenikhil65)\
**Replies:** 7\
**Last updated:** [November 17, 2021, 7:08am UTC](https://discourse.julialang.org/t/unable-to-precompile-differentialequations-jl-in-juno-ide-in-new-environment-and-empty-project/71608 "2021-11-17T07:08:30Z")

</div>

I am trying to precompile DifferentialEquations.jl into an empty environment , but i am encountering following error suddenly julia\> new environment at \`~/nikhil/s rao reduction of chem reaction/model\_red\_julia/Projec…

---

## [How can I easily skip indices in an array?](https://discourse.julialang.org/t/how-can-i-easily-skip-indices-in-an-array/70317)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 16\
**Last updated:** [November 17, 2021, 6:40am UTC](https://discourse.julialang.org/t/how-can-i-easily-skip-indices-in-an-array/70317 "2021-11-17T06:40:19Z")

</div>

I have arrays with 2 dimensions. Elements in the arrays are only considered valid for certain values on the indices. For example, consider the arrays A and B below: A = round.(rand(10, 2) .\* 100) A\[1:3, 2\] .= NaN B = ro…

---

## [Broadcasting and the function keyword arguments](https://discourse.julialang.org/t/broadcasting-and-the-function-keyword-arguments/71629)

<div class="topic-metadata">

**Author:** [@Oko](https://discourse.julialang.org/u/Oko)\
**Replies:** 2\
**Last updated:** [November 17, 2021, 6:13am UTC](https://discourse.julialang.org/t/broadcasting-and-the-function-keyword-arguments/71629 "2021-11-17T06:13:52Z")

</div>

In the lieu of the fact that the broadcast is faster than the dot syntax I would like to replace the following code snippet #!/usr/bin/julia using Graphs n = 10 p = 0.1:0.01:0.5 erdos\_renyi.(n,p;is\_directed=true, see…

---

## [Juno -- start-up directory?](https://discourse.julialang.org/t/juno-start-up-directory/18284)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 5\
**Last updated:** [November 17, 2021, 5:09am UTC](https://discourse.julialang.org/t/juno-start-up-directory/18284 "2021-11-17T05:09:49Z")

</div>

Probably a stupid questions… but where do I set the start-up directory of REPL in Juno? The default start-up directory appears in the top of the Juno window… but where can I change it? Probably, the ideal would be th…

---

## [How can I improve the spacing in this layout with multiple axis of aspect ratio 1?](https://discourse.julialang.org/t/how-can-i-improve-the-spacing-in-this-layout-with-multiple-axis-of-aspect-ratio-1/71634)

<div class="topic-metadata">

**Author:** [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Replies:** 4\
**Last updated:** [November 17, 2021, 5:02am UTC](https://discourse.julialang.org/t/how-can-i-improve-the-spacing-in-this-layout-with-multiple-axis-of-aspect-ratio-1/71634 "2021-11-17T05:02:45Z")

</div>

Hi! Do you have any advice to make this layout look nicer? I am perturbed by the different row gap between rows 1-2 and 2-3, but I cannot make them even. Original code: using CairoMakie set\_theme!(fontsize = 30, Axi…

---

## [Question: Function not returning a value?](https://discourse.julialang.org/t/question-function-not-returning-a-value/71590)

<div class="topic-metadata">

**Author:** [@mdhe1248](https://discourse.julialang.org/u/mdhe1248)\
**Replies:** 9\
**Last updated:** [November 17, 2021, 3:38am UTC](https://discourse.julialang.org/t/question-function-not-returning-a-value/71590 "2021-11-17T03:38:39Z")

</div>

Could anyone help with this function? I would like to get a return value, but it returns nothing. The below is my function: function retrieve(dict, key\_of\_interest, value\_of\_interest) for (key, value) in dict if k…

---

## [Parametric surface plot of custom indexed array](https://discourse.julialang.org/t/parametric-surface-plot-of-custom-indexed-array/71359)

<div class="topic-metadata">

**Author:** [@Oko](https://discourse.julialang.org/u/Oko)\
**Replies:** 1\
**Last updated:** [November 16, 2021, 9:37pm UTC](https://discourse.julialang.org/t/parametric-surface-plot-of-custom-indexed-array/71359 "2021-11-16T21:37:59Z")

</div>

I am struggling with something which seems pretty trivial problem. Namely, I have a stochastic process on a random graph depending on the two parameters. The first parameter is the probability of an edge between two node…

---

## [Flux: no method matching ndims(::ChainRulesCore.NoTangent)](https://discourse.julialang.org/t/flux-no-method-matching-ndims-chainrulescore-notangent/71479)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 3\
**Last updated:** [November 17, 2021, 2:06am UTC](https://discourse.julialang.org/t/flux-no-method-matching-ndims-chainrulescore-notangent/71479 "2021-11-17T02:06:49Z")

</div>

Consider the MWE below. using Flux model = Chain( RNN(1, 128), Dense(128, 1) ); # one feature, sequence length = 3, batch size = 6 x = \[rand(Float32, 1, 6) for \_ = 1:3\] y = rand(Float32, 1, 6) function loss(…

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

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