# General Usage

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

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

**Page:** 740

---

## [Simple documentation question](https://discourse.julialang.org/t/simple-documentation-question/41445)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 7\
**Last updated:** [June 15, 2020, 6:44pm UTC](https://discourse.julialang.org/t/simple-documentation-question/41445 "2020-06-15T18:44:37Z")

</div>

Hi, this is quite dumb :frowning: I’m trying to document a function that is called CD\_k\_CUDA and I want to document it. I write a doc string like """ CD\_k\_CUDA(x,W) ... """ function CD\_k\_CUDA(x,W) but when i try to…

---

## [Understanding Allocations in multithreaded code](https://discourse.julialang.org/t/understanding-allocations-in-multithreaded-code/41442)

<div class="topic-metadata">

**Author:** [@JonasIsensee](https://discourse.julialang.org/u/JonasIsensee)\
**Replies:** 4\
**Last updated:** [June 15, 2020, 5:37pm UTC](https://discourse.julialang.org/t/understanding-allocations-in-multithreaded-code/41442 "2020-06-15T17:37:12Z")

</div>

Hi, I’m working on speeding up particle simulation using multi-threading and I’ve come across odd allocations in the multi-threaded code that I don’t fully understand and much less know how to get rid of. Here’s a much…

---

## [Capture all REPL activity into a file?](https://discourse.julialang.org/t/capture-all-repl-activity-into-a-file/41453)

<div class="topic-metadata">

**Author:** [@reumle](https://discourse.julialang.org/u/reumle)\
**Replies:** 0\
**Last updated:** [June 15, 2020, 4:25pm UTC](https://discourse.julialang.org/t/capture-all-repl-activity-into-a-file/41453 "2020-06-15T16:25:23Z")

</div>

Is there a way ? The available docs (Logging, IO, REPL…) are not immediately clear on this. I am on windows/vscode. Thanks! for reference: Redirecting to Google Groups , same question, but does not solve my problem (…

---

## [Time to first plot seems to be much alleviated in 1.4. What happend?](https://discourse.julialang.org/t/time-to-first-plot-seems-to-be-much-alleviated-in-1-4-what-happend/37340)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 20\
**Last updated:** [June 15, 2020, 3:16pm UTC](https://discourse.julialang.org/t/time-to-first-plot-seems-to-be-much-alleviated-in-1-4-what-happend/37340 "2020-06-15T15:16:42Z")

</div>

I read somewhere that time to first plot is now much faster. I tried it on Windows 10 Julia v1.4 and plot(1:3) is sub 5 seconds now which is quite acceptable! I wonder what happened, I haven’t been following as closely …

---

## [Set index! not defined for WeakRefStrings. SpringArray{String,1}](https://discourse.julialang.org/t/set-index-not-defined-for-weakrefstrings-springarray-string-1/41379)

<div class="topic-metadata">

**Author:** [@Gp\_Ubit](https://discourse.julialang.org/u/Gp_Ubit)\
**Replies:** 4\
**Last updated:** [June 15, 2020, 2:34pm UTC](https://discourse.julialang.org/t/set-index-not-defined-for-weakrefstrings-springarray-string-1/41379 "2020-06-15T14:34:32Z")

</div>

i wanted to create a loop on a column in my IJulia and I came up with this error. Please what can I do to retify it. Here is my code: for v=1:length(col1) col1\[v\] = Dates.DateTime(col1\[v\], “d-u-y”) end And I got thi…

---

## [Global const in struct](https://discourse.julialang.org/t/global-const-in-struct/27718)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [June 15, 2020, 2:05pm UTC](https://discourse.julialang.org/t/global-const-in-struct/27718 "2020-06-15T14:05:19Z")

</div>

In #32407 I saw struct \_GLOBAL\_RNG \<: AbstractRNG global const GLOBAL\_RNG = \_GLOBAL\_RNG.instance end Can someone please explain what this does?

---

## ["Failed to precompile" error on worker processes](https://discourse.julialang.org/t/failed-to-precompile-error-on-worker-processes/40638)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 17\
**Last updated:** [June 15, 2020, 1:41pm UTC](https://discourse.julialang.org/t/failed-to-precompile-error-on-worker-processes/40638 "2020-06-15T13:41:05Z")

</div>

I’m trying to run my code on multiple processes. It was working before but I updated Atom and it no longer works. I’m getting “failed to precompile” errors when I try to use @everywhere to load a package. Any tips? The …

---

## [Error displaying ParquetFiles.ParquetFile: ArgumentError: reducing over an empty collection is not allowed](https://discourse.julialang.org/t/error-displaying-parquetfiles-parquetfile-argumenterror-reducing-over-an-empty-collection-is-not-allowed/41436)

<div class="topic-metadata">

**Author:** [@gvarthi](https://discourse.julialang.org/u/gvarthi)\
**Replies:** 0\
**Last updated:** [June 15, 2020, 11:51am UTC](https://discourse.julialang.org/t/error-displaying-parquetfiles-parquetfile-argumenterror-reducing-over-an-empty-collection-is-not-allowed/41436 "2020-06-15T11:51:55Z")

</div>

I am very much new to the Julia Programming language. I am trying to load the parquet file using ParquetFiles.load("part-0001-c000-snappy.parquet"). When I run, I got the following error: \*\*Error displaying ParquetFile…

---

## [ERROR: LoadError: ArgumentError: reducing over an empty collection is not allowed](https://discourse.julialang.org/t/error-loaderror-argumenterror-reducing-over-an-empty-collection-is-not-allowed/31758)

<div class="topic-metadata">

**Author:** [@gohoudanon](https://discourse.julialang.org/u/gohoudanon)\
**Replies:** 7\
**Last updated:** [June 15, 2020, 11:42am UTC](https://discourse.julialang.org/t/error-loaderror-argumenterror-reducing-over-an-empty-collection-is-not-allowed/31758 "2020-06-15T11:42:05Z")

</div>

Hi all, I am not a developer but use Julia for my research as there is an existing nowcasting model. The model works well for the US data (GDP) but comes with ERROR when I replace (manually) the US GDP dates by country…

---

## [New package not recognised](https://discourse.julialang.org/t/new-package-not-recognised/41433)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 4\
**Last updated:** [June 15, 2020, 11:32am UTC](https://discourse.julialang.org/t/new-package-not-recognised/41433 "2020-06-15T11:32:48Z")

</div>

I added a package but can’t seem to have it be recognised: (v1.2) pkg\> add https://github.com/Staross/JuliaCMAES.git Updating git-repo https://github.com/Staross/JuliaCMAES.git \[ Info: Assigning UUID 51f20bef-1676-51…

---

## [Emacs on Julia - can't copy to/from REPL](https://discourse.julialang.org/t/emacs-on-julia-cant-copy-to-from-repl/41430)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 3\
**Last updated:** [June 15, 2020, 10:53am UTC](https://discourse.julialang.org/t/emacs-on-julia-cant-copy-to-from-repl/41430 "2020-06-15T10:53:13Z")

</div>

I am not sure if this is just me not understanding or a bug. On my Mac, I use julia-repl and julia-repl-mode and things like ‘ctrl-c’ work to send commands to the REPL but I can’t copy/paste to/from the REPL at all. I …

---

## [Comparison of Windows 10 and Linux Julia](https://discourse.julialang.org/t/comparison-of-windows-10-and-linux-julia/41227)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 15\
**Last updated:** [June 15, 2020, 8:37am UTC](https://discourse.julialang.org/t/comparison-of-windows-10-and-linux-julia/41227 "2020-06-15T08:37:11Z")

</div>

I was curious about some recent observations I made concerning the speed of sparse-matrix solve. Here are some measurements comparing Windows 10, WSL2, and Ubuntu 20.4, all running on the same laptop(HP Spectre 360 i7 a…

---

## [Creating an anonymous function taking as arguments the elements in a vector](https://discourse.julialang.org/t/creating-an-anonymous-function-taking-as-arguments-the-elements-in-a-vector/41373)

<div class="topic-metadata">

**Author:** [@Karel\_Van\_Brantegem](https://discourse.julialang.org/u/Karel_Van_Brantegem)\
**Replies:** 2\
**Last updated:** [June 15, 2020, 8:31am UTC](https://discourse.julialang.org/t/creating-an-anonymous-function-taking-as-arguments-the-elements-in-a-vector/41373 "2020-06-15T08:31:36Z")

</div>

Hi Julians I have a vector vector\_symbol that contains a variable number of elements of type Symbol. I also have the variable ex of type Expr that is an expression of the Symbol elements in vector\_symbol. For example: …

---

## [The Euler and improved Euler methods](https://discourse.julialang.org/t/the-euler-and-improved-euler-methods/41404)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 1\
**Last updated:** [June 15, 2020, 4:23am UTC](https://discourse.julialang.org/t/the-euler-and-improved-euler-methods/41404 "2020-06-15T04:23:38Z")

</div>

Hello, I am working on some implementation for Euler and Improved Euler method. for the Euler method, it works well but for the improved version, I got some "character ignored due to Unicode error " and the result is tot…

---

## [Vcat slow?](https://discourse.julialang.org/t/vcat-slow/40579)

<div class="topic-metadata">

**Author:** [@Ronneesley](https://discourse.julialang.org/u/Ronneesley)\
**Replies:** 12\
**Last updated:** [June 15, 2020, 12:47am UTC](https://discourse.julialang.org/t/vcat-slow/40579 "2020-06-15T00:47:53Z")

</div>

Hello, I’m using vcat() to concatenate many vectors, but I observed that @code\_warntype it’s returning a red mark. I marked with \*\*\* in the code below: julia\> a = collect(1:10); julia\> b = collect(20:30); julia\> @cod…

---

## [LoadError: MethodError: no method matching mdflatten](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-mdflatten/24099)

<div class="topic-metadata">

**Author:** [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Replies:** 2\
**Last updated:** [June 15, 2020, 12:05am UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-mdflatten/24099 "2020-06-15T00:05:45Z")

</div>

I am trying to run the Make.JL script but when it stream the markdown into Documenter, something is breaking and I don’t know where to look. I checked the Docstrings and the look ok…Any thoughts on how to interpret the m…

---

## [A slight flaw in the Project/Manifest/Env logic?](https://discourse.julialang.org/t/a-slight-flaw-in-the-project-manifest-env-logic/41398)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 7\
**Last updated:** [June 14, 2020, 10:59pm UTC](https://discourse.julialang.org/t/a-slight-flaw-in-the-project-manifest-env-logic/41398 "2020-06-14T22:59:06Z")

</div>

This post may seem long, but its a very step-by-step process and very easy to digest. Lets say I have developed a package (or more of a scientific simulation model) that depends on certain DataFrames, v0.20.2. The Proje…

---

## [How to check for packages updates without actually installing them](https://discourse.julialang.org/t/how-to-check-for-packages-updates-without-actually-installing-them/32498)

<div class="topic-metadata">

**Author:** [@Jacky](https://discourse.julialang.org/u/Jacky)\
**Replies:** 4\
**Last updated:** [June 14, 2020, 6:24pm UTC](https://discourse.julialang.org/t/how-to-check-for-packages-updates-without-actually-installing-them/32498 "2020-06-14T18:24:54Z")

</div>

Hi, currently I am using the Pkg.update() to check for available packages updates. However, Pkg.update() also automatically install the missing updates. Is there a way to check for package updates without installing them…

---

## [FFTW fails to build](https://discourse.julialang.org/t/fftw-fails-to-build/41392)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 1\
**Last updated:** [June 14, 2020, 5:44pm UTC](https://discourse.julialang.org/t/fftw-fails-to-build/41392 "2020-06-14T17:44:01Z")

</div>

I did an \] update and FFTW failed with this message (@v1.4) pkg\> build FFTW Building FFTW → ~/.julia/packages/FFTW/kcXL6/deps/build.log ┌ Error: Error building FFTW: │ ERROR: LoadError: ArgumentError: Package Li…

---

## [Accessing elements in Gtk container by name](https://discourse.julialang.org/t/accessing-elements-in-gtk-container-by-name/41385)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 0\
**Last updated:** [June 14, 2020, 3:29pm UTC](https://discourse.julialang.org/t/accessing-elements-in-gtk-container-by-name/41385 "2020-06-14T15:29:01Z")

</div>

In Gtk.jl, elements are accessed by an integer index. For example, using Gtk win = GtkWindow() button = GtkButton("OK", name="ok\_button") push!(win, button) win\[1\] This has two limitations in my opinion. First, integer…

---

## [JSON.parsefile() returning load error Unexpected Character](https://discourse.julialang.org/t/json-parsefile-returning-load-error-unexpected-character/41338)

<div class="topic-metadata">

**Author:** [@waqas](https://discourse.julialang.org/u/waqas)\
**Replies:** 6\
**Last updated:** [June 14, 2020, 3:26pm UTC](https://discourse.julialang.org/t/json-parsefile-returning-load-error-unexpected-character/41338 "2020-06-14T15:26:15Z")

</div>

Hi, I am trying to follow the tutorials on “Julia for Data science” and am getting Unexpected Character error whenever I try to use JSON.parsefile(). I have tried many different JSON files but, the error still pops up. …

---

## [Generate equal length strings from numbers by padding with "0"?](https://discourse.julialang.org/t/generate-equal-length-strings-from-numbers-by-padding-with-0/41365)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 6\
**Last updated:** [June 14, 2020, 1:07pm UTC](https://discourse.julialang.org/t/generate-equal-length-strings-from-numbers-by-padding-with-0/41365 "2020-06-14T13:07:59Z")

</div>

Let’s say I have an array of integers x = \[1, 14, 356\]. I want to generate individual strings, with equal lengths: x\_str = \[“001”, “014”, “356”\]. How can I achieve that? The background of the problem is the following…

---

## [How to tell if A\*B hits BLAS?](https://discourse.julialang.org/t/how-to-tell-if-a-b-hits-blas/41303)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [June 14, 2020, 11:43am UTC](https://discourse.julialang.org/t/how-to-tell-if-a-b-hits-blas/41303 "2020-06-14T11:43:53Z")

</div>

Julia’s type system for linear algebra is quite sophisticated. I have a case where, after some reshape and transpose operations, I obtain two matrices A,B for which for some reason, A\*B falls back to the slow generic\_mat…

---

## [Slow arbitrary base exponentiation, a^b](https://discourse.julialang.org/t/slow-arbitrary-base-exponentiation-a-b/25386)

<div class="topic-metadata">

**Author:** [@JesseSantoso](https://discourse.julialang.org/u/JesseSantoso)\
**Replies:** 22\
**Last updated:** [June 14, 2020, 1:49am UTC](https://discourse.julialang.org/t/slow-arbitrary-base-exponentiation-a-b/25386 "2020-06-14T01:49:25Z")

</div>

Hey everyone, I’ve been having fun optimising my code and I’ve noticed that raising a Float64 to the power of another Float64 (e.g. a^b) is very slow compared to base e exponentiation using the exp() function, even to th…

---

## [Making iterators as fast as loops](https://discourse.julialang.org/t/making-iterators-as-fast-as-loops/21377)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 25\
**Last updated:** [June 14, 2020, 12:34am UTC](https://discourse.julialang.org/t/making-iterators-as-fast-as-loops/21377 "2020-06-14T00:34:42Z")

</div>

I’m trying to build an efficient iterator for a bunch of nested loops, so that the inner loops depend on the outer loops. I’m having problems achieving comparable performance with the iterator approach as with the loop a…

---

## [Plots Heatmap is not showing categorical variable](https://discourse.julialang.org/t/plots-heatmap-is-not-showing-categorical-variable/41340)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 2\
**Last updated:** [June 13, 2020, 9:29pm UTC](https://discourse.julialang.org/t/plots-heatmap-is-not-showing-categorical-variable/41340 "2020-06-13T21:29:34Z")

</div>

I am trying to plot a heatmap where the data is coming from a DataFrame. The arrays look like the following yvals = df\_normal\[:, :county\] xvals = names(df\_normal)\[dbegin:dend\] zvals = Matrix(df\_normal\[:, dbegin:dend\]) w…

---

## [Setfield: set properties of nested subfields](https://discourse.julialang.org/t/setfield-set-properties-of-nested-subfields/41304)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 4\
**Last updated:** [June 13, 2020, 6:11pm UTC](https://discourse.julialang.org/t/setfield-set-properties-of-nested-subfields/41304 "2020-06-13T18:11:56Z")

</div>

I’m trying to use the setproperties function of Setfield.jl to set multiple different fields at once for immutable structs, but I’m running into this issue. using Setfield struct A foo::Int bar::Int end struct…

---

## [Make typeof(T::Type) = Type{T}?](https://discourse.julialang.org/t/make-typeof-t-type-type-t/41333)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 0\
**Last updated:** [June 13, 2020, 5:26pm UTC](https://discourse.julialang.org/t/make-typeof-t-type-type-t/41333 "2020-06-13T17:26:35Z")

</div>

Hi Julia pros, if we use e.g. typeof((Vector, Int, 1)) we get Tuple{UnionAll, DataType, Int}, which I guess is due to typeof(Vector) = UnionAll and the like. Wouldn’t it be better for the compiler and hence performance…

---

## [Cannot start Julia 1.4.2](https://discourse.julialang.org/t/cannot-start-julia-1-4-2/41267)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 7\
**Last updated:** [June 13, 2020, 5:02pm UTC](https://discourse.julialang.org/t/cannot-start-julia-1-4-2/41267 "2020-06-13T17:02:58Z")

</div>

After an update to Julia 1.4.2, my Fedora 32 desktop cannot start Julia anymore. The error message says: julia: error while loading shared libraries: libLLVM-8jl.so: cannot open shared object file: No such file or dire…

---

## [Is there a \`\`mytypeof((Vector, Int))\`\` returning \`\`Tuple{Type{Vector}, Type{Int}}\`\`?](https://discourse.julialang.org/t/is-there-a-mytypeof-vector-int-returning-tuple-type-vector-type-int/41322)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [June 13, 2020, 12:00pm UTC](https://discourse.julialang.org/t/is-there-a-mytypeof-vector-int-returning-tuple-type-vector-type-int/41322 "2020-06-13T12:00:36Z")

</div>

I just was surprised that some code was not optimized accordingly and I realized it is because I used something like typeof((Vector, Int, 1)) which unfortunately forgets the type information and returns Tuple{UnionAll, D…

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

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