# General Usage

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

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

**Page:** 616

---

## [Add tag with coordinates to plot in Plots.jl](https://discourse.julialang.org/t/add-tag-with-coordinates-to-plot-in-plots-jl/58972)

<div class="topic-metadata">

**Author:** [@achjaj](https://discourse.julialang.org/u/achjaj)\
**Replies:** 4\
**Last updated:** [April 11, 2021, 12:02am UTC](https://discourse.julialang.org/t/add-tag-with-coordinates-to-plot-in-plots-jl/58972 "2021-04-11T00:02:18Z")

</div>

I have a plot with intersecting lines: And I would like to add a tag or pointer which point to the intersection and display the coordinates of the intersection. Something like this: I know the coordinates of the in…

---

## [Plots.jl: Modify frame thickness](https://discourse.julialang.org/t/plots-jl-modify-frame-thickness/24258)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 3\
**Last updated:** [April 10, 2021, 9:18pm UTC](https://discourse.julialang.org/t/plots-jl-modify-frame-thickness/24258 "2021-04-10T21:18:04Z")

</div>

How do I modify the linewidth of the frame (frame = :box) of a Plots.jl plot? I’m using the PyPlot backend. Currently my plot looks like this: Clearly, the frame is too thick.

---

## [Plots.jl fill within limits only](https://discourse.julialang.org/t/plots-jl-fill-within-limits-only/58852)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 7\
**Last updated:** [April 10, 2021, 8:27pm UTC](https://discourse.julialang.org/t/plots-jl-fill-within-limits-only/58852 "2021-04-10T20:27:05Z")

</div>

Quick question. Is it possible in plots to only fill a region greater than some contour level? I’m trying to blank out part of the plot and leave the rest visible underneath. x = 1:0.5:20 y = 1:0.5:10 contour(x, y, (x,y…

---

## [Is there a limit on the number of @async tasks that can be scheduled?](https://discourse.julialang.org/t/is-there-a-limit-on-the-number-of-async-tasks-that-can-be-scheduled/58992)

<div class="topic-metadata">

**Author:** [@bjkaria](https://discourse.julialang.org/u/bjkaria)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 6:04pm UTC](https://discourse.julialang.org/t/is-there-a-limit-on-the-number-of-async-tasks-that-can-be-scheduled/58992 "2021-04-10T18:04:01Z")

</div>

Hi, I am using the HTTP.jl module to create multiple websocket connections and process data from them with @async. In the following program I see only 8 tasks ever succeeding. All the connections are going to be up long…

---

## [Map and slice don't preserve the size of an array](https://discourse.julialang.org/t/map-and-slice-dont-preserve-the-size-of-an-array/58987)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 1\
**Last updated:** [April 10, 2021, 4:23pm UTC](https://discourse.julialang.org/t/map-and-slice-dont-preserve-the-size-of-an-array/58987 "2021-04-10T16:23:06Z")

</div>

I’m implementing element-wise multiplication and want to multiply array of size (2,8) with array of size (N,2,8). When I’m making this as follows (map(x -\> rand(3,4) .\* x, eachslice(rand(1,3,4), dims=1)))\[end\] I’m lo…

---

## [LoadError: UndefVarError: nb\_available not defined](https://discourse.julialang.org/t/loaderror-undefvarerror-nb-available-not-defined/58954)

<div class="topic-metadata">

**Author:** [@SudhakarKuma](https://discourse.julialang.org/u/SudhakarKuma)\
**Replies:** 1\
**Last updated:** [April 10, 2021, 2:22pm UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-nb-available-not-defined/58954 "2021-04-10T14:22:39Z")

</div>

Hello everyone! I have a function (as given below) that was working for Julia 0.4.5. function analogRead(file\_des::SerialPorts.SerialPort , pin\_no::Int64) str = "A"\*string(Char(48+pin\_no)) #"An" for analog value on …

---

## [Nested Comprehensions with Stateful](https://discourse.julialang.org/t/nested-comprehensions-with-stateful/58888)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 6\
**Last updated:** [April 10, 2021, 2:05pm UTC](https://discourse.julialang.org/t/nested-comprehensions-with-stateful/58888 "2021-04-10T14:05:37Z")

</div>

A Stateful iterator “empties” itself as one iterates through it. The result is the following fun behaviour (if one thinks about for a minute it becomes obvious why this happens): using Base.Iterators: Stateful x = \[1,2,…

---

## [Check if a type is a "concretization" of some UnionAll](https://discourse.julialang.org/t/check-if-a-type-is-a-concretization-of-some-unionall/58974)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 2\
**Last updated:** [April 10, 2021, 1:48pm UTC](https://discourse.julialang.org/t/check-if-a-type-is-a-concretization-of-some-unionall/58974 "2021-04-10T13:48:26Z")

</div>

Having a UnionAll and another type I would like to check if the other was constructed by filling the parameters of the UnionAll: struct A{T} end const C1 = A{Int} using Test @test concretizationof(C1, A) == true @test …

---

## [Broadcasting arrays with different number of dimension](https://discourse.julialang.org/t/broadcasting-arrays-with-different-number-of-dimension/58973)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 7\
**Last updated:** [April 10, 2021, 1:17pm UTC](https://discourse.julialang.org/t/broadcasting-arrays-with-different-number-of-dimension/58973 "2021-04-10T13:17:18Z")

</div>

In PyTorch it’s possible to do the operation: # v.shape = torch.Size(\[1, 2, 1\]) # b = torch.Size(\[2, 8\]) a = v - b # a.shape = torch.Size(\[1, 2, 8\]) However when I try to implement this in Julia I get an error rand(1…

---

## [LinearAlgebra: change in behavior between 1.1 and 1.7](https://discourse.julialang.org/t/linearalgebra-change-in-behavior-between-1-1-and-1-7/58948)

<div class="topic-metadata">

**Author:** [@harven](https://discourse.julialang.org/u/harven)\
**Replies:** 3\
**Last updated:** [April 10, 2021, 7:19am UTC](https://discourse.julialang.org/t/linearalgebra-change-in-behavior-between-1-1-and-1-7/58948 "2021-04-10T07:19:36Z")

</div>

The following code gives different results under 1.1 and 1.7. PP = \[1 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 …

---

## [LoadError: LoadError: UndefVarError: ASCIIString not defined](https://discourse.julialang.org/t/loaderror-loaderror-undefvarerror-asciistring-not-defined/58885)

<div class="topic-metadata">

**Author:** [@SudhakarKuma](https://discourse.julialang.org/u/SudhakarKuma)\
**Replies:** 1\
**Last updated:** [April 8, 2021, 11:01pm UTC](https://discourse.julialang.org/t/loaderror-loaderror-undefvarerror-asciistring-not-defined/58885 "2021-04-08T23:01:12Z")

</div>

Hello everyone! I have a function (as given below) in Julia that was working for Julia 0.4.5. function pinMode(file\_des::SerialPorts.SerialPort , pin\_no::Int64 , mode::ASCIIString) m = uppercase(mode) …

---

## [Optimal way to flatten array](https://discourse.julialang.org/t/optimal-way-to-flatten-array/58923)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 5\
**Last updated:** [April 9, 2021, 9:39pm UTC](https://discourse.julialang.org/t/optimal-way-to-flatten-array/58923 "2021-04-09T21:39:06Z")

</div>

I have an array of array y = \[ones(Float32, 3) for i=1:3\] sum(abs2, y) which I can’t apply abs2 to. I need it to compute my loss function Now I use custom function function flat\_this(x) arr = ones(0) for i=1…

---

## [Optimizing Linear Algebra Code?](https://discourse.julialang.org/t/optimizing-linear-algebra-code/58797)

<div class="topic-metadata">

**Author:** [@loki](https://discourse.julialang.org/u/loki)\
**Replies:** 12\
**Last updated:** [April 9, 2021, 9:16pm UTC](https://discourse.julialang.org/t/optimizing-linear-algebra-code/58797 "2021-04-09T21:16:34Z")

</div>

Hello everyone! I’ve been trying to convert some simple functions that were originally implemented in Matlab into Julia. They revolve around vector/matrix and matrix/matrix multiplication. My question stems from trying …

---

## [LoadError; InitError when building project](https://discourse.julialang.org/t/loaderror-initerror-when-building-project/58944)

<div class="topic-metadata">

**Author:** [@meck](https://discourse.julialang.org/u/meck)\
**Replies:** 0\
**Last updated:** [April 9, 2021, 8:30pm UTC](https://discourse.julialang.org/t/loaderror-initerror-when-building-project/58944 "2021-04-09T20:30:47Z")

</div>

Shortly after installing Julia 1.6 I am getting that error and am not any longer able to use that package. Though I don\`t know if the new version has anything to do with that since I am not seeing similar issues from oth…

---

## [JuliaDB groupby many columns](https://discourse.julialang.org/t/juliadb-groupby-many-columns/58935)

<div class="topic-metadata">

**Author:** [@Fabien1](https://discourse.julialang.org/u/Fabien1)\
**Replies:** 0\
**Last updated:** [April 9, 2021, 5:10pm UTC](https://discourse.julialang.org/t/juliadb-groupby-many-columns/58935 "2021-04-09T17:10:20Z")

</div>

Hi guys , I’m trying to groupby using JuliaDB , everything works well except when i want to apply a function that takes two columns in one time. JuliaDB.groupby( ( TOTAL\_PAID = :PRICE =\> sum, FREQ…

---

## [Flux gradients intepretation](https://discourse.julialang.org/t/flux-gradients-intepretation/58925)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 1\
**Last updated:** [April 9, 2021, 4:20pm UTC](https://discourse.julialang.org/t/flux-gradients-intepretation/58925 "2021-04-09T16:20:25Z")

</div>

There is a code for simple RNN network using Flux rnn = Flux.RNN(2, 3) seq = \[rand(Float32,2) for i = 1:3\] y = \[ones(Float32, 3) for i=1:3\] function loss(x, y) a = flat\_this((rnn.(x) .- y)) \_loss = sum(abs2, a)…

---

## [How remove missing value from vector](https://discourse.julialang.org/t/how-remove-missing-value-from-vector/58916)

<div class="topic-metadata">

**Author:** [@Rafael\_Brus](https://discourse.julialang.org/u/Rafael_Brus)\
**Replies:** 5\
**Last updated:** [April 9, 2021, 2:24pm UTC](https://discourse.julialang.org/t/how-remove-missing-value-from-vector/58916 "2021-04-09T14:24:04Z")

</div>

How do I remove these missing values: a = \["NY", "NY", "NY", missing, missing\]

---

## [Initialization of vector of matrix decompositions](https://discourse.julialang.org/t/initialization-of-vector-of-matrix-decompositions/58909)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 4\
**Last updated:** [April 9, 2021, 2:08pm UTC](https://discourse.julialang.org/t/initialization-of-vector-of-matrix-decompositions/58909 "2021-04-09T14:08:19Z")

</div>

For one of my projects, I need to perform multiple QR (up to multiple hundreds) decompositions of dense tall complex matrices. These decompositions are later used in some linear algebra operations, where the operations a…

---

## [Nesting subtype in parameter of a subtype](https://discourse.julialang.org/t/nesting-subtype-in-parameter-of-a-subtype/58842)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 1\
**Last updated:** [April 9, 2021, 1:35pm UTC](https://discourse.julialang.org/t/nesting-subtype-in-parameter-of-a-subtype/58842 "2021-04-09T13:35:52Z")

</div>

I’m struggling to create the following structure. Say I have… abstract type AbstractType{A,B,C} end and… abstract type AbstractSubType{A,B,C} \<: AbstractType{A,B,C} end I’d like to make… struct ConcreteType{D, E\<:Ab…

---

## [Make a secret or black box function?](https://discourse.julialang.org/t/make-a-secret-or-black-box-function/58017)

<div class="topic-metadata">

**Author:** [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Replies:** 28\
**Last updated:** [April 9, 2021, 1:17pm UTC](https://discourse.julialang.org/t/make-a-secret-or-black-box-function/58017 "2021-04-09T13:17:58Z")

</div>

I’d like to give students in my research group a function to optimize…but I’d like to keep the functional form secret, for pedagogical purposes. Is there some way to “compile” a function or obfuscate it somehow so that a…

---

## [How namespace of Base.Iterators works](https://discourse.julialang.org/t/how-namespace-of-base-iterators-works/58854)

<div class="topic-metadata">

**Author:** [@Tbl](https://discourse.julialang.org/u/Tbl)\
**Replies:** 6\
**Last updated:** [April 9, 2021, 12:44pm UTC](https://discourse.julialang.org/t/how-namespace-of-base-iterators-works/58854 "2021-04-09T12:44:49Z")

</div>

I like to code using more functional-like style working with iterators, so Base.Iterators comes in handy, but I have problem understanding how its namespace is structured. It is part of the Base, yet it is not by defau…

---

## [Optimizing E-Graphs pattern matcher: a complicated problem](https://discourse.julialang.org/t/optimizing-e-graphs-pattern-matcher-a-complicated-problem/58914)

<div class="topic-metadata">

**Author:** [@0x0f0f0f](https://discourse.julialang.org/u/0x0f0f0f)\
**Replies:** 0\
**Last updated:** [April 9, 2021, 11:13am UTC](https://discourse.julialang.org/t/optimizing-e-graphs-pattern-matcher-a-complicated-problem/58914 "2021-04-09T11:13:44Z")

</div>

With Metatheory.jl, I have a big performance problem when pattern matching against egraphs, a fairly complex algorithm and data structure https://github.com/0x0f0f0f/Metatheory.jl/issues/6 If anyone is skilled enough o…

---

## [Does the Profile package report system time?](https://discourse.julialang.org/t/does-the-profile-package-report-system-time/58911)

<div class="topic-metadata">

**Author:** [@mroavi](https://discourse.julialang.org/u/mroavi)\
**Replies:** 0\
**Last updated:** [April 9, 2021, 10:02am UTC](https://discourse.julialang.org/t/does-the-profile-package-report-system-time/58911 "2021-04-09T10:02:27Z")

</div>

Does the Profile package indicate the relative time the system spends allocating and freeing memory on the heap? Or is this information not included in the profile at all? (edited)

---

## [Set model parameters as Dictionary and define some as trainable](https://discourse.julialang.org/t/set-model-parameters-as-dictionary-and-define-some-as-trainable/58910)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 0\
**Last updated:** [April 9, 2021, 9:02am UTC](https://discourse.julialang.org/t/set-model-parameters-as-dictionary-and-define-some-as-trainable/58910 "2021-04-09T09:02:51Z")

</div>

I defined the following model with a dictionary containing weights mutable struct Affine params end Affine(in::Integer, out::Integer) = Affine(Dict("W"=\>randn(out, in), ("b"=\>randn(out)))) # Overload call, so the …

---

## [Flatten a tuple of Operations/Operation arrays](https://discourse.julialang.org/t/flatten-a-tuple-of-operations-operation-arrays/58906)

<div class="topic-metadata">

**Author:** [@cvanaret](https://discourse.julialang.org/u/cvanaret)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 8:32am UTC](https://discourse.julialang.org/t/flatten-a-tuple-of-operations-operation-arrays/58906 "2021-04-09T08:32:44Z")

</div>

Hi, I’m using the @variables macro of the ModelingToolkit module: (edit) n = 2 vars = @variables x y z\[1:n\] which produces (x, y, Operation\[z₁, z₂\]). I’m now using this tuple as parameter in the constructor of Contra…

---

## [Parallel run in for loop](https://discourse.julialang.org/t/parallel-run-in-for-loop/58858)

<div class="topic-metadata">

**Author:** [@Rasoul\_Jafarzadeh](https://discourse.julialang.org/u/Rasoul_Jafarzadeh)\
**Replies:** 10\
**Last updated:** [April 9, 2021, 6:12am UTC](https://discourse.julialang.org/t/parallel-run-in-for-loop/58858 "2021-04-09T06:12:29Z")

</div>

in my code I have 32 parameter, so I used 32 for loop which have 2 steps in each loop. 2^32 computation should be done and it takes long long time. how can I run them parallel to run fast? my code is this form c=\[0,1\]…

---

## [Operations on Arrays of CartesianIndex](https://discourse.julialang.org/t/operations-on-arrays-of-cartesianindex/58827)

<div class="topic-metadata">

**Author:** [@ethomag](https://discourse.julialang.org/u/ethomag)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 5:01am UTC](https://discourse.julialang.org/t/operations-on-arrays-of-cartesianindex/58827 "2021-04-09T05:01:06Z")

</div>

I came across a problem that I found surprisingly hard, given Julias excellent support for indexing multidimensional Arrays. I lilke to apply some function along one axis on parts of an Array. The parts are defined by s…

---

## [get(::Function, ::Dict, ::Key) not defined for Base.ImmutableDict?](https://discourse.julialang.org/t/get-function-dict-key-not-defined-for-base-immutabledict/58897)

<div class="topic-metadata">

**Author:** [@murari0](https://discourse.julialang.org/u/murari0)\
**Replies:** 2\
**Last updated:** [April 9, 2021, 3:22am UTC](https://discourse.julialang.org/t/get-function-dict-key-not-defined-for-base-immutabledict/58897 "2021-04-09T03:22:35Z")

</div>

While playing around with Dicts, I found that I was not able to use the do-block syntax, e.g. get(a, key) do @warn "Key not found. Falling back to default" default end when a is of type Base.ImmutableDict inste…

---

## [GameZero.jl question](https://discourse.julialang.org/t/gamezero-jl-question/44044)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 5\
**Last updated:** [April 9, 2021, 1:07am UTC](https://discourse.julialang.org/t/gamezero-jl-question/44044 "2021-04-09T01:07:27Z")

</div>

How do I run a game? That seems to be an oversight. Code example?

---

## [Parallel Computing For Loop With Dictionaries](https://discourse.julialang.org/t/parallel-computing-for-loop-with-dictionaries/58402)

<div class="topic-metadata">

**Author:** [@waforbes](https://discourse.julialang.org/u/waforbes)\
**Replies:** 23\
**Last updated:** [April 8, 2021, 11:30pm UTC](https://discourse.julialang.org/t/parallel-computing-for-loop-with-dictionaries/58402 "2021-04-08T23:30:43Z")

</div>

What’s the best way to implement parallel computing here? I’m new to it and Julia. I have eight physical cores. The process function returns two dictionaries. @time begin param = "reaction" # reaction, mesh, diffusion …

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

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