# General Usage

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

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

**Page:** 851

---

## [Gumbel Softmax in Julia](https://discourse.julialang.org/t/gumbel-softmax-in-julia/26190)

<div class="topic-metadata">

**Author:** [@Elita\_Lobo](https://discourse.julialang.org/u/Elita_Lobo)\
**Replies:** 4\
**Last updated:** [July 12, 2019, 4:13pm UTC](https://discourse.julialang.org/t/gumbel-softmax-in-julia/26190 "2019-07-12T16:13:29Z")

</div>

Can someone please point me to some implementation of gumbel softmax in julia or an equivalent of the following function? https://pytorch.org/docs/master/tensors.html#torch.Tensor.scatter\_

---

## [How to use minimum and maximum for a Vector{SVector{3}}](https://discourse.julialang.org/t/how-to-use-minimum-and-maximum-for-a-vector-svector-3/26235)

<div class="topic-metadata">

**Author:** [@CFBaptista](https://discourse.julialang.org/u/CFBaptista)\
**Replies:** 6\
**Last updated:** [July 12, 2019, 2:04pm UTC](https://discourse.julialang.org/t/how-to-use-minimum-and-maximum-for-a-vector-svector-3/26235 "2019-07-12T14:04:21Z")

</div>

If I want to determine the smallest values in the rows of A::Matrix it’s as easy as: min = minimum(A, dims=2) However, if I have a Vector of SVector{3}'s it’s a bit more complicated. This using StaticArrays function …

---

## [Compatibility issues: How to read the error?](https://discourse.julialang.org/t/compatibility-issues-how-to-read-the-error/26188)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 3\
**Last updated:** [July 12, 2019, 9:55am UTC](https://discourse.julialang.org/t/compatibility-issues-how-to-read-the-error/26188 "2019-07-12T09:55:17Z")

</div>

I encountered this problem several times. I have absolutely no idea how to read the compatibility problems when installing a package doesn’t work. (v1.1) pkg\> add FreeTypeAbstraction Resolving package versions... ERROR…

---

## [Improving performance due to setting types of the fields of a struct](https://discourse.julialang.org/t/improving-performance-due-to-setting-types-of-the-fields-of-a-struct/24965)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 10\
**Last updated:** [July 12, 2019, 8:03am UTC](https://discourse.julialang.org/t/improving-performance-due-to-setting-types-of-the-fields-of-a-struct/24965 "2019-07-12T08:03:49Z")

</div>

Hi, I have a question about improving the performance of Julia. In the Julia documentation is something explained about setting types of a structs. " You can do better by declaring the type of a . Here, we are focused…

---

## [Make first call faster](https://discourse.julialang.org/t/make-first-call-faster/22845)

<div class="topic-metadata">

**Author:** [@KestutisMa](https://discourse.julialang.org/u/KestutisMa)\
**Replies:** 6\
**Last updated:** [July 12, 2019, 7:53am UTC](https://discourse.julialang.org/t/make-first-call-faster/22845 "2019-07-12T07:53:24Z")

</div>

Hello, I just started using Julia, I noticed that commands using Plotly plot(rand(10)) perform slowly ~30s in first run, but faster ~2s in second run. Could it be possible to cache that process to make it fast after …

---

## [MultivariateNormal with trackedArray Mean and standard Deviation and clamping tracked array](https://discourse.julialang.org/t/multivariatenormal-with-trackedarray-mean-and-standard-deviation-and-clamping-tracked-array/26259)

<div class="topic-metadata">

**Author:** [@Elita\_Lobo](https://discourse.julialang.org/u/Elita_Lobo)\
**Replies:** 2\
**Last updated:** [July 12, 2019, 6:46am UTC](https://discourse.julialang.org/t/multivariatenormal-with-trackedarray-mean-and-standard-deviation-and-clamping-tracked-array/26259 "2019-07-12T06:46:05Z")

</div>

I am trying to create multivariate distributions from mean and standard deviation obtained from neural network. But I am getting the following error: MethodError: no method matching MvNormal(::TrackedArray{…,Array{Flo…

---

## [Non scalar indexing in Julia](https://discourse.julialang.org/t/non-scalar-indexing-in-julia/26269)

<div class="topic-metadata">

**Author:** [@Elita\_Lobo](https://discourse.julialang.org/u/Elita_Lobo)\
**Replies:** 6\
**Last updated:** [July 12, 2019, 4:44am UTC](https://discourse.julialang.org/t/non-scalar-indexing-in-julia/26269 "2019-07-12T04:44:55Z")

</div>

How do I achieve non scalar indexing in Julia? julia\> l 3×2 Array{Int64,2}: 1 2 2 3 4 5 julia\> l\[\[1,2,3\],\[1,2,1\]\] 3×3 Array{Int64,2}: 1 2 1 2 3 2 4 5 4 I want to assign be able to assign values to diff…

---

## [Nested Ranges in Generator](https://discourse.julialang.org/t/nested-ranges-in-generator/26268)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 1\
**Last updated:** [July 12, 2019, 2:50am UTC](https://discourse.julialang.org/t/nested-ranges-in-generator/26268 "2019-07-12T02:50:35Z")

</div>

What is the generator syntax where the value of variables from one range can be used as limits for another range? collect(\[a,b\] for a=1:2, b=a:a+1) ERROR: UndefVarError: a not defined Expecting \[1, 1\] \[1, 2\] \[2, 2\]…

---

## [Controlling the type of anonymous functions](https://discourse.julialang.org/t/controlling-the-type-of-anonymous-functions/26264)

<div class="topic-metadata">

**Author:** [@Nathaniel](https://discourse.julialang.org/u/Nathaniel)\
**Replies:** 5\
**Last updated:** [July 11, 2019, 8:44pm UTC](https://discourse.julialang.org/t/controlling-the-type-of-anonymous-functions/26264 "2019-07-11T20:44:57Z")

</div>

I have a function with the following form: function make\_func() return x -\> x\*10 end I would like to change it so that it will return a function that takes Cint and returns Cint, in order to pass it to C code as a cal…

---

## [Variables on remote processes](https://discourse.julialang.org/t/variables-on-remote-processes/26256)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 0\
**Last updated:** [July 11, 2019, 5:32pm UTC](https://discourse.julialang.org/t/variables-on-remote-processes/26256 "2019-07-11T17:32:05Z")

</div>

The following uses always the locally defined variable: using Distributed addprocs(1) @everywhere c = 10 c = 3 pmap(1:1) do i c end # 3 @everywhere f(x) = c pmap(f, 1:1) # 3 How can I guarantee that my functi…

---

## [Channel gets emptied and stays that way](https://discourse.julialang.org/t/channel-gets-emptied-and-stays-that-way/26237)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 11\
**Last updated:** [July 11, 2019, 4:54pm UTC](https://discourse.julialang.org/t/channel-gets-emptied-and-stays-that-way/26237 "2019-07-11T16:54:43Z")

</div>

I want to use a @async task to put! video frames (from VideoIO) in a Channel and use that channel as a buffer of frames to update a Makie.Scene with. The idea is that while the user plays with the slider to explore a vid…

---

## [Syntactic sugar for many arguments with same type annotation but separately dispatchable?](https://discourse.julialang.org/t/syntactic-sugar-for-many-arguments-with-same-type-annotation-but-separately-dispatchable/26249)

<div class="topic-metadata">

**Author:** [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Replies:** 2\
**Last updated:** [July 11, 2019, 2:39pm UTC](https://discourse.julialang.org/t/syntactic-sugar-for-many-arguments-with-same-type-annotation-but-separately-dispatchable/26249 "2019-07-11T14:39:18Z")

</div>

Is there a syntactic sugar for a function where the arguments must all have a type T\<:SomeType, but each one could be a different type? What I want to do might be clearer by example. So at the moment I might write a fun…

---

## [Is there something like ScipyOptimizer in Julia?](https://discourse.julialang.org/t/is-there-something-like-scipyoptimizer-in-julia/23251)

<div class="topic-metadata">

**Author:** [@vavrines](https://discourse.julialang.org/u/vavrines)\
**Replies:** 10\
**Last updated:** [July 11, 2019, 12:55pm UTC](https://discourse.julialang.org/t/is-there-something-like-scipyoptimizer-in-julia/23251 "2019-07-11T12:55:34Z")

</div>

Hi all, Recently, I’m turning to use Julia and Flux.jl to treat some differential equations in computational physics. I find it convenient and efficient indeed. However, I wonder if there is any high-order optimizatio…

---

## [Debugging Function-Like object under Juno](https://discourse.julialang.org/t/debugging-function-like-object-under-juno/26079)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 2\
**Last updated:** [July 11, 2019, 11:43am UTC](https://discourse.julialang.org/t/debugging-function-like-object-under-juno/26079 "2019-07-11T11:43:27Z")

</div>

I suspect this is a bug, but I’d like a second opinion in case I’m doing something wrong. Julia version: Julia Version 1.1.1 Commit 55e36cc308 (2019-05-16 04:10 UTC) Platform Info: OS: Linux (x86\_64-pc-linux-gnu) C…

---

## [DataFrames and serialization](https://discourse.julialang.org/t/dataframes-and-serialization/26248)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 0\
**Last updated:** [July 11, 2019, 11:33am UTC](https://discourse.julialang.org/t/dataframes-and-serialization/26248 "2019-07-11T11:33:14Z")

</div>

I had to send a DataFrame (ca. 7000x1500, in my opinion not even that large) to several worker processes (ca. 40) and and the whole process was a pain: @everywhere df = $df took 3 minutes! A colleague told me to write…

---

## [Precompiling Caesar failes](https://discourse.julialang.org/t/precompiling-caesar-failes/26219)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [July 11, 2019, 12:00am UTC](https://discourse.julialang.org/t/precompiling-caesar-failes/26219 "2019-07-11T00:00:30Z")

</div>

Dear all, I updated my packages, and precompiling Caesar now fails. It worked a few weeks ago. I am using Julia 1.1 on Linux (Ubuntu 18.04), 64 bits. Any idea? Precompiling Caesar \[ Info: Precompiling Caesar \[62eebf1…

---

## [PowerModels redirect output to file and weird output behavior using pmap()](https://discourse.julialang.org/t/powermodels-redirect-output-to-file-and-weird-output-behavior-using-pmap/26147)

<div class="topic-metadata">

**Author:** [@jchen975](https://discourse.julialang.org/u/jchen975)\
**Replies:** 2\
**Last updated:** [July 10, 2019, 8:30pm UTC](https://discourse.julialang.org/t/powermodels-redirect-output-to-file-and-weird-output-behavior-using-pmap/26147 "2019-07-10T20:30:47Z")

</div>

Hi, in PowerModels.jl, is there a way for me to either redirect the run\_ac\_pf and run\_dc\_pf outputs to a txt file or run in a non verbose mode altogether? Preferably I’d save the outputs to a file so that I can parse for…

---

## [PackageCompiler compile\_package works, but compile\_incremental fails on same runtests](https://discourse.julialang.org/t/packagecompiler-compile-package-works-but-compile-incremental-fails-on-same-runtests/26087)

<div class="topic-metadata">

**Author:** [@KestutisMa](https://discourse.julialang.org/u/KestutisMa)\
**Replies:** 6\
**Last updated:** [July 10, 2019, 5:28pm UTC](https://discourse.julialang.org/t/packagecompiler-compile-package-works-but-compile-incremental-fails-on-same-runtests/26087 "2019-07-10T17:28:02Z")

</div>

Hi, I want to pre-compile functions which I use frequently from REPL. I use PackageCompiler#sd-notomls. It works well with compile\_package("PyPlot"), but fails when list of precompiles is defined: compile\_incremental("/h…

---

## [When ArgumentError should be thrown?](https://discourse.julialang.org/t/when-argumenterror-should-be-thrown/26116)

<div class="topic-metadata">

**Author:** [@peters](https://discourse.julialang.org/u/peters)\
**Replies:** 4\
**Last updated:** [July 10, 2019, 4:09pm UTC](https://discourse.julialang.org/t/when-argumenterror-should-be-thrown/26116 "2019-07-10T16:09:58Z")

</div>

Recently, I had a chance to review error handling of a package and I found many error checking lines are throwing ArgumentError but in various reasons. Some lines are complaining about a argument value, some lines are ab…

---

## [What is the purpose of @inbounds in Julia?](https://discourse.julialang.org/t/what-is-the-purpose-of-inbounds-in-julia/26215)

<div class="topic-metadata">

**Author:** [@dsbsnyh](https://discourse.julialang.org/u/dsbsnyh)\
**Replies:** 4\
**Last updated:** [July 10, 2019, 3:41pm UTC](https://discourse.julialang.org/t/what-is-the-purpose-of-inbounds-in-julia/26215 "2019-07-10T15:41:23Z")

</div>

function sum(A::AbstractArray) r = zero(el type(A)) for i = 1: length(A) @inbounds r += A\[i\] end return r end @inbounds(blk) Eliminates array bounds checking within expressions. …

---

## [Cxx LLVM error](https://discourse.julialang.org/t/cxx-llvm-error/26226)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 0\
**Last updated:** [July 10, 2019, 3:27pm UTC](https://discourse.julialang.org/t/cxx-llvm-error/26226 "2019-07-10T15:27:54Z")

</div>

I am wrapping a C++ math library (ntl) using Cxx. After successfully wrapping a major class, I encountered llvm errors in another class. The errors are: LLVM ERROR: Program used external function ‘\_\_emutls\_v.\_symbol’ …

---

## [How to improve compilation time and loading time of packages?](https://discourse.julialang.org/t/how-to-improve-compilation-time-and-loading-time-of-packages/26183)

<div class="topic-metadata">

**Author:** [@tencnivel](https://discourse.julialang.org/u/tencnivel)\
**Replies:** 8\
**Last updated:** [July 10, 2019, 11:48am UTC](https://discourse.julialang.org/t/how-to-improve-compilation-time-and-loading-time-of-packages/26183 "2019-07-10T11:48:27Z")

</div>

EDIT: I was mistaking the compilation time of the utiity package with its loading. See message below: https://discourse.julialang.org/t/how-to-improve-compilation-time-and-loading-time-of-packages/26183/7 Original post…

---

## [\`Pkg\` fails to clone registry (SSL cert. error)](https://discourse.julialang.org/t/pkg-fails-to-clone-registry-ssl-cert-error/19652)

<div class="topic-metadata">

**Author:** [@skariel](https://discourse.julialang.org/u/skariel)\
**Replies:** 1\
**Last updated:** [July 10, 2019, 10:53am UTC](https://discourse.julialang.org/t/pkg-fails-to-clone-registry-ssl-cert-error/19652 "2019-07-10T10:53:13Z")

</div>

Using Julia 1.2 (happens also in 1.0.3), when running Pkg.update() I get: (v1.2) pkg\> update Cloning default registries into \`~/.julia\` Cloning registry from "https://github.com/JuliaRegistries/General.git" ERROR:…

---

## [Check bounds function in julia?](https://discourse.julialang.org/t/check-bounds-function-in-julia/26212)

<div class="topic-metadata">

**Author:** [@dsbsnyh](https://discourse.julialang.org/u/dsbsnyh)\
**Replies:** 5\
**Last updated:** [July 10, 2019, 9:43am UTC](https://discourse.julialang.org/t/check-bounds-function-in-julia/26212 "2019-07-10T09:43:21Z")

</div>

Hi, I have encountered this checkbounds function which confused me. Could anyone explain a bit what it does? a\_star\_algorithm(g::AbstractGraph{U}, s::Integer, …

---

## [How to create a private package registry](https://discourse.julialang.org/t/how-to-create-a-private-package-registry/11701)

<div class="topic-metadata">

**Author:** [@danielmatz](https://discourse.julialang.org/u/danielmatz)\
**Replies:** 14\
**Last updated:** [July 10, 2019, 5:26am UTC](https://discourse.julialang.org/t/how-to-create-a-private-package-registry/11701 "2019-07-10T05:26:48Z")

</div>

Is there any documentation explaining how to create a package repository for the new package manager? I want to set one up for use at my company for various packages that can’t be shared publicly.

---

## [Performance of a type-unstable accumulator](https://discourse.julialang.org/t/performance-of-a-type-unstable-accumulator/26169)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 6\
**Last updated:** [July 10, 2019, 3:28am UTC](https://discourse.julialang.org/t/performance-of-a-type-unstable-accumulator/26169 "2019-07-10T03:28:59Z")

</div>

One of the general performance tips is to ensure that an accumulator has the same type as the data that you’re accumulating using the zero function. Apparently, there’s no visible effect in my performance tests below. H…

---

## [Are immutable struct really immutable?](https://discourse.julialang.org/t/are-immutable-struct-really-immutable/26138)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 12\
**Last updated:** [July 10, 2019, 12:21am UTC](https://discourse.julialang.org/t/are-immutable-struct-really-immutable/26138 "2019-07-10T00:21:00Z")

</div>

Hi, I recently realised that it is possible to edit the entries of an immutable struct as long as they are arrays. For example, by using the code: struct MyStruct Y::Array{Float64,1} end # Define A A = MyStruct(on…

---

## [LoadError: LibraryProduct(...) is not satisfied](https://discourse.julialang.org/t/loaderror-libraryproduct-is-not-satisfied/26193)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 3\
**Last updated:** [July 10, 2019, 12:02am UTC](https://discourse.julialang.org/t/loaderror-libraryproduct-is-not-satisfied/26193 "2019-07-10T00:02:43Z")

</div>

I had this issue initially with MbedTLS, mentioned it on Slack, fiddled a lot and it “went away” as far as I could tell. However I now get the same error with Arpack; I don’t know what causes these issues nor how to clea…

---

## [Decoding EBCDIC array to string](https://discourse.julialang.org/t/decoding-ebcdic-array-to-string/26192)

<div class="topic-metadata">

**Author:** [@randyzwitch](https://discourse.julialang.org/u/randyzwitch)\
**Replies:** 8\
**Last updated:** [July 9, 2019, 6:14pm UTC](https://discourse.julialang.org/t/decoding-ebcdic-array-to-string/26192 "2019-07-09T18:14:48Z")

</div>

I have a file format that returns bytes in EBCDIC format: 3200-element Array{UInt8,1}: 0xc3 0x40 0xf1 0x40 0xc3 0xd3 0xc9 0xc5 0xd5 0xe3 0x7a 0x40 0xc2 ⋮ 0x40 0x40 0x40 0x40 0x40 0x40 0x40 0x40 …

---

## [PackageCompiler.compile\_incremental Error: Package name not found in current manifest](https://discourse.julialang.org/t/packagecompiler-compile-incremental-error-package-name-not-found-in-current-manifest/26195)

<div class="topic-metadata">

**Author:** [@dhazeghi](https://discourse.julialang.org/u/dhazeghi)\
**Replies:** 0\
**Last updated:** [July 9, 2019, 5:52pm UTC](https://discourse.julialang.org/t/packagecompiler-compile-incremental-error-package-name-not-found-in-current-manifest/26195 "2019-07-09T17:52:43Z")

</div>

As part of my attempt to get a handle on compile/load time, I’m trying to build a number of commonly used packages into my system image. Many of them fail with the following sort of error: julia\> PackageCompiler.compil…

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

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