# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=450

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

**Page:** 451

---

## [Debugger hanging in \`broadcast()\` function call](https://discourse.julialang.org/t/debugger-hanging-in-broadcast-function-call/80909)

<div class="topic-metadata">

**Author:** [@ckumarad](https://discourse.julialang.org/u/ckumarad)\
**Replies:** 4\
**Last updated:** [May 13, 2022, 1:15am UTC](https://discourse.julialang.org/t/debugger-hanging-in-broadcast-function-call/80909 "2022-05-13T01:15:46Z")

</div>

When interactively stepping over some code I’ve written, using the VSCode debugging mode, the debugger does not step over the blockRF\[...\] = ... line (I have waiting several minutes). Setting a breakpoint at any point af…

---

## [Failed to precompile Ipopt](https://discourse.julialang.org/t/failed-to-precompile-ipopt/80758)

<div class="topic-metadata">

**Author:** [@liuwa666](https://discourse.julialang.org/u/liuwa666)\
**Replies:** 14\
**Last updated:** [May 12, 2022, 11:25pm UTC](https://discourse.julialang.org/t/failed-to-precompile-ipopt/80758 "2022-05-12T23:25:39Z")

</div>

One of my project is dependent on PowerDynamics.jl, and PowerDynamics.jl is dependent on Ipopt.jl. Today when I was updating this project, the following situation occurs: pkg\> precompile Precompiling project... ✗ Ipop…

---

## [Adding constant size vectors](https://discourse.julialang.org/t/adding-constant-size-vectors/80958)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 6\
**Last updated:** [May 12, 2022, 9:40pm UTC](https://discourse.julialang.org/t/adding-constant-size-vectors/80958 "2022-05-12T21:40:46Z")

</div>

I need to add two vectors of size 256. What would be the fastest way to do this? It needs to be as much optimized as possible as it will be inside an alpha-beta search. Sub questions would it be much faster if I use in…

---

## [Transducers/FLoops equivalent for mapreduce with dims arg (on GPU)](https://discourse.julialang.org/t/transducers-floops-equivalent-for-mapreduce-with-dims-arg-on-gpu/80767)

<div class="topic-metadata">

**Author:** [@Alex\_Ellison](https://discourse.julialang.org/u/Alex_Ellison)\
**Replies:** 9\
**Last updated:** [May 12, 2022, 7:41pm UTC](https://discourse.julialang.org/t/transducers-floops-equivalent-for-mapreduce-with-dims-arg-on-gpu/80767 "2022-05-12T19:41:30Z")

</div>

Hi all, Is it possible to write an equivalent of mapreduce(; dims) using either Transducers or FLoops? I’m interested in the NVidia GPU context. I want to do something like: julia\> begin using CUDA, LazyArrays …

---

## [Making Plots with discrete dots over sphere](https://discourse.julialang.org/t/making-plots-with-discrete-dots-over-sphere/80973)

<div class="topic-metadata">

**Author:** [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Replies:** 0\
**Last updated:** [May 12, 2022, 6:33pm UTC](https://discourse.julialang.org/t/making-plots-with-discrete-dots-over-sphere/80973 "2022-05-12T18:33:36Z")

</div>

I’m trying to make a plot similar to this in Makie With the details that I know the size of each little circle, and they have a probability attach to them. My attempt fig, axis = meshscatter(V\[1,:\], V\[2,:\], V\[3,:\], …

---

## [Converting units of time deltas](https://discourse.julialang.org/t/converting-units-of-time-deltas/63944)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 4\
**Last updated:** [May 12, 2022, 6:22pm UTC](https://discourse.julialang.org/t/converting-units-of-time-deltas/63944 "2022-05-12T18:22:40Z")

</div>

Let’s say I want to get the fractional hours elapsed between two times. I often have code that looks something like function hours\_elapsed(start, stop) millis = (stop - start).value return millis / (1000 \* 60 \* …

---

## [A question about parallel performance in multithreading](https://discourse.julialang.org/t/a-question-about-parallel-performance-in-multithreading/80743)

<div class="topic-metadata">

**Author:** [@Andrea\_Vigliotti](https://discourse.julialang.org/u/Andrea_Vigliotti)\
**Replies:** 10\
**Last updated:** [May 12, 2022, 5:25pm UTC](https://discourse.julialang.org/t/a-question-about-parallel-performance-in-multithreading/80743 "2022-05-12T17:25:36Z")

</div>

Hi all, I am trying to understand why do I get such poor performances from multithreading. The context is a finite element program, I need to loop over all the elements of the model and evaluate the residual force vect…

---

## [VSCode environments getting mixed up](https://discourse.julialang.org/t/vscode-environments-getting-mixed-up/80889)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 9\
**Last updated:** [May 12, 2022, 2:23pm UTC](https://discourse.julialang.org/t/vscode-environments-getting-mixed-up/80889 "2022-05-12T14:23:28Z")

</div>

I have chosen an environment, as shown by the downward arrow. However, when I execute the file, it gets executed in the wrong environment: it is the environment I got by “open folder”. Is this a bug, or am I doing …

---

## [Convert torch tensor in julia type with PyCall.jl](https://discourse.julialang.org/t/convert-torch-tensor-in-julia-type-with-pycall-jl/80899)

<div class="topic-metadata">

**Author:** [@FedericoCM](https://discourse.julialang.org/u/FedericoCM)\
**Replies:** 2\
**Last updated:** [May 12, 2022, 1:14pm UTC](https://discourse.julialang.org/t/convert-torch-tensor-in-julia-type-with-pycall-jl/80899 "2022-05-12T13:14:43Z")

</div>

Hi everybody, It’s my first time that I use PyCall and I have a problem that I could not manage to solve. I’m using julia to simulate biological neural networks and I’m trying to use a program written in python (that u…

---

## [Is there a function similar to numpy unique with inverse?](https://discourse.julialang.org/t/is-there-a-function-similar-to-numpy-unique-with-inverse/80949)

<div class="topic-metadata">

**Author:** [@Minimum-Pollution-96](https://discourse.julialang.org/u/Minimum-Pollution-96)\
**Replies:** 5\
**Last updated:** [May 12, 2022, 12:11pm UTC](https://discourse.julialang.org/t/is-there-a-function-similar-to-numpy-unique-with-inverse/80949 "2022-05-12T12:11:16Z")

</div>

In python numpy, I can write my code as, unique\_vals, reverse\_ids = np.unique(vals, return\_inverse=True) Here, reverse\_ids is the list of indices such that, unique\_vals\[reverse\_ids\] == vals Is there something similar…

---

## [Genie initializers is exit](https://discourse.julialang.org/t/genie-initializers-is-exit/80927)

<div class="topic-metadata">

**Author:** [@YANTAN520](https://discourse.julialang.org/u/YANTAN520)\
**Replies:** 2\
**Last updated:** [May 12, 2022, 9:30am UTC](https://discourse.julialang.org/t/genie-initializers-is-exit/80927 "2022-05-12T09:30:55Z")

</div>

when I use Genie’app, REPL will exit. Why is this? Genie V4.18.0 SearchLight v2.2.0

---

## [Easiest way to deploy a Pluto notebook for others to play around with?](https://discourse.julialang.org/t/easiest-way-to-deploy-a-pluto-notebook-for-others-to-play-around-with/79086)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 3\
**Last updated:** [May 12, 2022, 9:06am UTC](https://discourse.julialang.org/t/easiest-way-to-deploy-a-pluto-notebook-for-others-to-play-around-with/79086 "2022-05-12T09:06:50Z")

</div>

Hello everyone! I have created a Pluto notebook, which I would like to make publicly available so that people can use it and check it out. It seems that the easiest way would be to use Pluto on Binder, but I had difficu…

---

## [GDAL/OGR documentation problem (S-57)](https://discourse.julialang.org/t/gdal-ogr-documentation-problem-s-57/80551)

<div class="topic-metadata">

**Author:** [@frits45](https://discourse.julialang.org/u/frits45)\
**Replies:** 2\
**Last updated:** [May 12, 2022, 8:54am UTC](https://discourse.julialang.org/t/gdal-ogr-documentation-problem-s-57/80551 "2022-05-12T08:54:13Z")

</div>

Hello, I have a Python-program to analyse data and I am rewriting it in Julia. The Python version needs over 14 hours, Julia will probably end in under 2 hours. Now my problem. The result needs to be plotted on a marit…

---

## [Interrupting Flux.jl training without killing kernel](https://discourse.julialang.org/t/interrupting-flux-jl-training-without-killing-kernel/80858)

<div class="topic-metadata">

**Author:** [@Jollywatt](https://discourse.julialang.org/u/Jollywatt)\
**Replies:** 7\
**Last updated:** [May 12, 2022, 7:36am UTC](https://discourse.julialang.org/t/interrupting-flux-jl-training-without-killing-kernel/80858 "2022-05-12T07:36:21Z")

</div>

Hello. My informal Flux workflow involves running training routines such as the following in the REPL or Jupyter cells: # example training loop function train\_discriminator() showloss = Flux.throttle(2) do batch, lo…

---

## [\[Makie.jl\] All the symbols shown as boxes](https://discourse.julialang.org/t/makie-jl-all-the-symbols-shown-as-boxes/80933)

<div class="topic-metadata">

**Author:** [@kunzaatko](https://discourse.julialang.org/u/kunzaatko)\
**Replies:** 3\
**Last updated:** [May 12, 2022, 7:30am UTC](https://discourse.julialang.org/t/makie-jl-all-the-symbols-shown-as-boxes/80933 "2022-05-12T07:30:20Z")

</div>

Yesterday, Makie started showing boxes instead of all symbols in my plots. I tried everything that I could think of and don’t know what else to try to fix it. Can you point me in a direction? I tried downgrading Makie …

---

## [Support for non-Int indices](https://discourse.julialang.org/t/support-for-non-int-indices/80920)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 4\
**Last updated:** [May 12, 2022, 4:58am UTC](https://discourse.julialang.org/t/support-for-non-int-indices/80920 "2022-05-12T04:58:27Z")

</div>

What is the current level of support for array indices other than Int? other than Integer? What are the plans going forward to support (or not) these?

---

## [Interpolations with Unitful Vectors](https://discourse.julialang.org/t/interpolations-with-unitful-vectors/80919)

<div class="topic-metadata">

**Author:** [@dmoored4](https://discourse.julialang.org/u/dmoored4)\
**Replies:** 1\
**Last updated:** [May 11, 2022, 11:50pm UTC](https://discourse.julialang.org/t/interpolations-with-unitful-vectors/80919 "2022-05-11T23:50:40Z")

</div>

Often I need to perform interpolations of unit-aware vectors and I would prefer to have the flexibility to use the interpolation functions offered by Dierckx, Interpolations etc. I haven’t found this in docs or discours…

---

## [How to take the mean of entries across an array of DataFrames conditional upon the value of a separate column?](https://discourse.julialang.org/t/how-to-take-the-mean-of-entries-across-an-array-of-dataframes-conditional-upon-the-value-of-a-separate-column/80869)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 5\
**Last updated:** [May 11, 2022, 10:56pm UTC](https://discourse.julialang.org/t/how-to-take-the-mean-of-entries-across-an-array-of-dataframes-conditional-upon-the-value-of-a-separate-column/80869 "2022-05-11T22:56:26Z")

</div>

I have a question regarding the correct way to store an n dimensional matrix in julia - and how one would take the mean across an axis based on conditions of a different column. Suppose V is a vector of DataFrames consi…

---

## [Global variables "leak" during mulithreading](https://discourse.julialang.org/t/global-variables-leak-during-mulithreading/80900)

<div class="topic-metadata">

**Author:** [@Kevin\_Shen1](https://discourse.julialang.org/u/Kevin_Shen1)\
**Replies:** 10\
**Last updated:** [May 11, 2022, 6:06pm UTC](https://discourse.julialang.org/t/global-variables-leak-during-mulithreading/80900 "2022-05-11T18:06:39Z")

</div>

Using global variables inside a function (executed separately) with multithreading seems to cause multiple threads to incorrect share/access the global variables. It’s a bit contrived for me to present a concrete exampl…

---

## [What does the beckmarking in global scope mean?](https://discourse.julialang.org/t/what-does-the-beckmarking-in-global-scope-mean/80898)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 6\
**Last updated:** [May 11, 2022, 5:41pm UTC](https://discourse.julialang.org/t/what-does-the-beckmarking-in-global-scope-mean/80898 "2022-05-11T17:41:54Z")

</div>

Hello, I have some issues that I did n’t get them well. 1- Why when using ·@btime, it is needed to used $ before the parameters? 2- Are A and B. below constant or non-constant variables? A = randn(3,3); b = randn(3);…

---

## [Products of sparse by dense matrices don't revert to specialized methods](https://discourse.julialang.org/t/products-of-sparse-by-dense-matrices-dont-revert-to-specialized-methods/80894)

<div class="topic-metadata">

**Author:** [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Replies:** 1\
**Last updated:** [May 11, 2022, 3:58pm UTC](https://discourse.julialang.org/t/products-of-sparse-by-dense-matrices-dont-revert-to-specialized-methods/80894 "2022-05-11T15:58:40Z")

</div>

Apparently in 1.7.2 the product of a sparse (SparseMatrixCSC) and a dense matrix (both directions) never use the specialized method. Looking at this old discussion it seems that at least the sparse by dense product shou…

---

## [How to get markdown language plugins?](https://discourse.julialang.org/t/how-to-get-markdown-language-plugins/80884)

<div class="topic-metadata">

**Author:** [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Replies:** 2\
**Last updated:** [May 11, 2022, 1:49pm UTC](https://discourse.julialang.org/t/how-to-get-markdown-language-plugins/80884 "2022-05-11T13:49:21Z")

</div>

I’m currently trying to parse some markdown files with julia-language quotes to html. Since it’s too slow to open pages by pluto and I need to insert things like gitalk, I don’t want a fully wrapped one. Obviously Markd…

---

## [Fancy Arrays: between 1 axis with compound keys, and multiple axes](https://discourse.julialang.org/t/fancy-arrays-between-1-axis-with-compound-keys-and-multiple-axes/80843)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 5\
**Last updated:** [May 11, 2022, 1:47pm UTC](https://discourse.julialang.org/t/fancy-arrays-between-1-axis-with-compound-keys-and-multiple-axes/80843 "2022-05-11T13:47:18Z")

</div>

One case i have had recently is wanting to view a AxisKeys KeyedArray that came from some panel data either as a Matrix which is keyed by by location and time; or as a Vector which is keyed by a NamedTuple(location=...…

---

## [Splatting arrays to tuples](https://discourse.julialang.org/t/splatting-arrays-to-tuples/80878)

<div class="topic-metadata">

**Author:** [@CMoebus](https://discourse.julialang.org/u/CMoebus)\
**Replies:** 3\
**Last updated:** [May 11, 2022, 1:04pm UTC](https://discourse.julialang.org/t/splatting-arrays-to-tuples/80878 "2022-05-11T13:04:26Z")

</div>

Hi, I want to transpile Scheme scripts into Julia. So I have to convert arrays into tuples and vice versa. Whereas the conversion of arrays into tuple works well with the splatting operator “…” (e.g.: \[(:a, :b, :c)…\] ==\> …

---

## [Unexpected Allocations and performance loss from concrete classes](https://discourse.julialang.org/t/unexpected-allocations-and-performance-loss-from-concrete-classes/80754)

<div class="topic-metadata">

**Author:** [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Replies:** 18\
**Last updated:** [May 11, 2022, 11:46am UTC](https://discourse.julialang.org/t/unexpected-allocations-and-performance-loss-from-concrete-classes/80754 "2022-05-11T11:46:15Z")

</div>

Hi, Apologies for what is probably “yet another” allocations post but I am unclear what I have done so wrong to experience the drop in performance I am experiencing. below is the original snippet that I then extend to M…

---

## [How Transducers.jl process table?](https://discourse.julialang.org/t/how-transducers-jl-process-table/80737)

<div class="topic-metadata">

**Author:** [@zsz00](https://discourse.julialang.org/u/zsz00)\
**Replies:** 7\
**Last updated:** [May 11, 2022, 10:19am UTC](https://discourse.julialang.org/t/how-transducers-jl-process-table/80737 "2022-05-11T10:19:03Z")

</div>

How Transducers.jl process table? get each column mean ? using Transducers, Table, Statistics N = 1\_000\_000 a = \[2randn(N÷2) .+ 6; randn(N÷2)\] b = \[3randn(N÷2); 2randn(N÷2)\] c = randn(N) d = c .+ 0.6randn(N) table = (;…

---

## [2d plot in 3d scene](https://discourse.julialang.org/t/2d-plot-in-3d-scene/80708)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 7\
**Last updated:** [May 11, 2022, 9:23am UTC](https://discourse.julialang.org/t/2d-plot-in-3d-scene/80708 "2022-05-11T09:23:45Z")

</div>

I would like to create a plot that contains two 2d heatmaps (XZ and YZ) but seen from a 3d perspective. In spirit a similar to this view: http://www.didaktikonline.physik.uni-muenchen.de/programme/dipolstr/DipoleRadiat…

---

## [Macro hygiene for macro m(ex...)](https://discourse.julialang.org/t/macro-hygiene-for-macro-m-ex/80859)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 5\
**Last updated:** [May 11, 2022, 8:59am UTC](https://discourse.julialang.org/t/macro-hygiene-for-macro-m-ex/80859 "2022-05-11T08:59:37Z")

</div>

I have two macros defined as follows: macro m1(ex) :($ex) end macro m2(ex...) :($ex) end And the results of macro expansions are: julia\> @macroexpand @m1 a, b :((Main.a, Main.b)) julia\> @macroexpand @m…

---

## [ProtoBuf Enum - NamedTuple or Base.Enums.Enum type?](https://discourse.julialang.org/t/protobuf-enum-namedtuple-or-base-enums-enum-type/80285)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 1\
**Last updated:** [May 11, 2022, 4:31am UTC](https://discourse.julialang.org/t/protobuf-enum-namedtuple-or-base-enums-enum-type/80285 "2022-05-11T04:31:52Z")

</div>

Hello, I have a enum type in Protocol Buffer (ProtoBuf) enum Fruit { APPLE=1; ORANGE=2; KIWI=3; }; I want to load and use it in Julia. Searched online and arrived to ProtoBuf.jl package. In the documenta…

---

## [Dynamic nested threads pre-1.8](https://discourse.julialang.org/t/dynamic-nested-threads-pre-1-8/80787)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 15\
**Last updated:** [May 11, 2022, 1:03am UTC](https://discourse.julialang.org/t/dynamic-nested-threads-pre-1-8/80787 "2022-05-11T01:03:56Z")

</div>

It’s wonderful that 1.8 provides dynamic scheduling in @threads that can (?) be nested. How can I obtain this functionality using Julia 1.7? I know that I can do @sync for and then @spawn. What other possibilities exi…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=449)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=451)
