# General Usage

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

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

**Page:** 455

---

## [What does @\_## mean in @code\_warntype (and other questions)?](https://discourse.julialang.org/t/what-does-mean-in-code-warntype-and-other-questions/80360)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 18\
**Last updated:** [May 3, 2022, 10:22am UTC](https://discourse.julialang.org/t/what-does-mean-in-code-warntype-and-other-questions/80360 "2022-05-03T10:22:03Z")

</div>

Hello, I’m a very basic Julia user working on a model simulating a food web and fishing. The model works but I need to decrease the run time. I’ve read several tutorials about @code\_warntype and I understand I should de…

---

## [Identify camera by name](https://discourse.julialang.org/t/identify-camera-by-name/79830)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 1\
**Last updated:** [May 3, 2022, 10:16am UTC](https://discourse.julialang.org/t/identify-camera-by-name/79830 "2022-05-03T10:16:23Z")

</div>

Using VideoIO.jl, can I somehow get the “factory name” of the available cameras? I’d like to be able to select a specific camera. This should work across all platforms (so I can’t make a USB rule or similar). Here, I l…

---

## [Julia registry not getting updated](https://discourse.julialang.org/t/julia-registry-not-getting-updated/80405)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [May 3, 2022, 8:37am UTC](https://discourse.julialang.org/t/julia-registry-not-getting-updated/80405 "2022-05-03T08:37:50Z")

</div>

I updated my package https://github.com/ufechner7/KiteModels.jl to version 0.3.3 eight hours ago, but if I do: mkdir tmp cd tmp julia --project="." using Pkg Pkg.add("KiteModels") I still get version 0.3.2. Is the pac…

---

## [Apples to apples comparison of A\\b with Float64 and Float16 on A64FX](https://discourse.julialang.org/t/apples-to-apples-comparison-of-a-b-with-float64-and-float16-on-a64fx/76096)

<div class="topic-metadata">

**Author:** [@bburnett](https://discourse.julialang.org/u/bburnett)\
**Replies:** 12\
**Last updated:** [May 2, 2022, 11:37pm UTC](https://discourse.julialang.org/t/apples-to-apples-comparison-of-a-b-with-float64-and-float16-on-a64fx/76096 "2022-05-02T23:37:16Z")

</div>

Hi all, sorry if this is a weird newbie question but I’ll go ahead and ask in hopes to learn something. I recently followed the advice in this github issues page to build Julia to not escalate Float16 to Float32 for arit…

---

## [Can't show plot in windows 10 from REPL](https://discourse.julialang.org/t/cant-show-plot-in-windows-10-from-repl/80342)

<div class="topic-metadata">

**Author:** [@kzmath](https://discourse.julialang.org/u/kzmath)\
**Replies:** 5\
**Last updated:** [May 2, 2022, 8:56pm UTC](https://discourse.julialang.org/t/cant-show-plot-in-windows-10-from-repl/80342 "2022-05-02T20:56:59Z")

</div>

Hi everyone! I can’t seem to get plots to show from julia REPL on windows 10 for some reason. Say I type the following to julia REPL: using Plots # I am using the default GR backend p = plot(rand(5)) # No output gui(p…

---

## [Unexpected type instability with getproperty()](https://discourse.julialang.org/t/unexpected-type-instability-with-getproperty/80381)

<div class="topic-metadata">

**Author:** [@michakraus](https://discourse.julialang.org/u/michakraus)\
**Replies:** 5\
**Last updated:** [May 2, 2022, 8:17pm UTC](https://discourse.julialang.org/t/unexpected-type-instability-with-getproperty/80381 "2022-05-02T20:17:47Z")

</div>

I have a data type that stores a vector z and a list of views to that vector, whose index ranges can be specified by the user, here a and b. The views are also accessible via m.a and m.b by overloading getproperty. Depe…

---

## [Feedback for efficiency of Sparse Matrix operations](https://discourse.julialang.org/t/feedback-for-efficiency-of-sparse-matrix-operations/80362)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 7\
**Last updated:** [May 2, 2022, 4:24pm UTC](https://discourse.julialang.org/t/feedback-for-efficiency-of-sparse-matrix-operations/80362 "2022-05-02T16:24:57Z")

</div>

This is my first time working with SparseArrays in Julia. I needed a few operations and was wondering if I am as efficient as I can be. I do want to preserve the original matrices (explicitly not doing anything in-place)…

---

## [LaTeX z-label in 3D Makie plot](https://discourse.julialang.org/t/latex-z-label-in-3d-makie-plot/80369)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 4\
**Last updated:** [May 2, 2022, 4:26pm UTC](https://discourse.julialang.org/t/latex-z-label-in-3d-makie-plot/80369 "2022-05-02T16:26:57Z")

</div>

I want to make a 3D surface plot in Makie, and I need the z-axis label to be formatted with \\LaTeX. Whenever I add such a label, all the content in the plot disappears. For example, the following plot works without addin…

---

## [Coordinating community efforts to enrich function docs](https://discourse.julialang.org/t/coordinating-community-efforts-to-enrich-function-docs/80338)

<div class="topic-metadata">

**Author:** [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)\
**Replies:** 44\
**Last updated:** [May 2, 2022, 1:57pm UTC](https://discourse.julialang.org/t/coordinating-community-efforts-to-enrich-function-docs/80338 "2022-05-02T13:57:33Z")

</div>

Following up on some of the positive suggestions in a recent thread, I’d like to use this thread to coordinate efforts with anyone who feels Julia’s function-level documentation can be better. Discourse lacks the ability…

---

## [Why is closure slower than handmade callable struct?](https://discourse.julialang.org/t/why-is-closure-slower-than-handmade-callable-struct/80361)

<div class="topic-metadata">

**Author:** [@FedericoStra](https://discourse.julialang.org/u/FedericoStra)\
**Replies:** 4\
**Last updated:** [May 2, 2022, 1:49pm UTC](https://discourse.julialang.org/t/why-is-closure-slower-than-handmade-callable-struct/80361 "2022-05-02T13:49:38Z")

</div>

I’m having a hard time trying to understand why in the following code a closure is slower than an equivalent hand-made callable struct. using BenchmarkTools using Interpolations using LinearAlgebra: norm using StaticArr…

---

## [Downloads.download: ERROR: Operation too slow. Less than 1 bytes/sec transferred](https://discourse.julialang.org/t/downloads-download-error-operation-too-slow-less-than-1-bytes-sec-transferred/80027)

<div class="topic-metadata">

**Author:** [@j\_u](https://discourse.julialang.org/u/j_u)\
**Replies:** 4\
**Last updated:** [May 2, 2022, 12:54pm UTC](https://discourse.julialang.org/t/downloads-download-error-operation-too-slow-less-than-1-bytes-sec-transferred/80027 "2022-05-02T12:54:40Z")

</div>

On Julia 1.6.6 I am constantly getting following ERROR at various stages (sometimes after ~500, sometimes after ~1500 files being downloaded) when trying to download a few thousand files: ERROR: Operation too slow. Less…

---

## [Packages all should use, all the time (at least be aware of), to combine in one superpackage: Julia2.jl](https://discourse.julialang.org/t/packages-all-should-use-all-the-time-at-least-be-aware-of-to-combine-in-one-superpackage-julia2-jl/80300)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [May 2, 2022, 12:22pm UTC](https://discourse.julialang.org/t/packages-all-should-use-all-the-time-at-least-be-aware-of-to-combine-in-one-superpackage-julia2-jl/80300 "2022-05-02T12:22:03Z")

</div>

I’m thinking of a curated list of packages, that (almost) all can agree on, to bring up to syntax-parity with e.g. Python (which has e.g. pattern matching), and so new users do not have to discover these packages for the…

---

## [How to remove julia from homebrew casks?](https://discourse.julialang.org/t/how-to-remove-julia-from-homebrew-casks/80357)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 8\
**Last updated:** [May 2, 2022, 9:11am UTC](https://discourse.julialang.org/t/how-to-remove-julia-from-homebrew-casks/80357 "2022-05-02T09:11:28Z")

</div>

I have an old version of julia that was probably installed via homebrew (I am running on MacOS). When I ran brew upgarde I got this: ==\> Casks with 'auto\_updates true' or 'version :latest' will not be upgraded; pass \`-…

---

## [Converting default Float type to Float32](https://discourse.julialang.org/t/converting-default-float-type-to-float32/80326)

<div class="topic-metadata">

**Author:** [@Phuntsho](https://discourse.julialang.org/u/Phuntsho)\
**Replies:** 7\
**Last updated:** [May 2, 2022, 7:25am UTC](https://discourse.julialang.org/t/converting-default-float-type-to-float32/80326 "2022-05-02T07:25:52Z")

</div>

I have noticed on my system that whenever I define CuArrays, I get Float64 as default. Is there a way to change the default to Float32, i.e. without specifying the type every time I define CuArrays? I want to get Float32…

---

## [@code\_warntype on keyword arguments](https://discourse.julialang.org/t/code-warntype-on-keyword-arguments/80343)

<div class="topic-metadata">

**Author:** [@tianrluo](https://discourse.julialang.org/u/tianrluo)\
**Replies:** 6\
**Last updated:** [May 1, 2022, 9:26pm UTC](https://discourse.julialang.org/t/code-warntype-on-keyword-arguments/80343 "2022-05-01T21:26:29Z")

</div>

Noticed this when obsessing over type-stability, wonder if what’s below in the code block is considered as an unexpected behavior. In short, @code\_warntype is happy with foo(x::Vector{\<:Real}), but mad about bar(; x::Ve…

---

## [Debugging with TensorOperations](https://discourse.julialang.org/t/debugging-with-tensoroperations/26065)

<div class="topic-metadata">

**Author:** [@rjuliasim](https://discourse.julialang.org/u/rjuliasim)\
**Replies:** 0\
**Last updated:** [July 6, 2019, 9:18am UTC](https://discourse.julialang.org/t/debugging-with-tensoroperations/26065 "2019-07-06T09:18:40Z")

</div>

Hello, if I set a breakpoint to line 10, i.e. the line with println("hello"), and enter debugger with Juno.@enter main() and then press Debug:continue symbol (\>\>) the debugger stops not at the defined breakpoint, li…

---

## [Franklin.jl not building on 1.7.1](https://discourse.julialang.org/t/franklin-jl-not-building-on-1-7-1/79745)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 2\
**Last updated:** [May 1, 2022, 4:35pm UTC](https://discourse.julialang.org/t/franklin-jl-not-building-on-1-7-1/79745 "2022-05-01T16:35:39Z")

</div>

Hi all, I have previously used Franklin.jl (on 1.6.x) for my personal website, but I have not updated my site since upgrading to Julia 1.7.x. I tried to reinstall Franklin for 1.7.1 today, and get the following error du…

---

## [Interpolation and expression evaluation](https://discourse.julialang.org/t/interpolation-and-expression-evaluation/80283)

<div class="topic-metadata">

**Author:** [@HJW019](https://discourse.julialang.org/u/HJW019)\
**Replies:** 5\
**Last updated:** [May 1, 2022, 4:19pm UTC](https://discourse.julialang.org/t/interpolation-and-expression-evaluation/80283 "2022-05-01T16:19:29Z")

</div>

Hi: I tried to use interpolation to construct a name of an existing vector and pick the vector for further processing. However, I couldn’t make it to work. The following is an MWE. data2=ones(2); data3=zeros(3); functi…

---

## [Check whether an array contains a object](https://discourse.julialang.org/t/check-whether-an-array-contains-a-object/80328)

<div class="topic-metadata">

**Author:** [@ke\_xu](https://discourse.julialang.org/u/ke_xu)\
**Replies:** 3\
**Last updated:** [May 1, 2022, 3:38pm UTC](https://discourse.julialang.org/t/check-whether-an-array-contains-a-object/80328 "2022-05-01T15:38:52Z")

</div>

Suppose I have an array of some objects, struct Obj v::Int64 end o1 = Obj(1) o2 = Obj(1) os = \[o1\] if use “in” to check if os contains o2 o2 in os it returns true. Because the “in” operator compares elements by “==”…

---

## [Why don't objects of my type show in Pluto?](https://discourse.julialang.org/t/why-dont-objects-of-my-type-show-in-pluto/80296)

<div class="topic-metadata">

**Author:** [@bwanab](https://discourse.julialang.org/u/bwanab)\
**Replies:** 5\
**Last updated:** [May 1, 2022, 2:45pm UTC](https://discourse.julialang.org/t/why-dont-objects-of-my-type-show-in-pluto/80296 "2022-05-01T14:45:04Z")

</div>

I’ve got a type for which I’ve implemented show. When I’ve got an instantiation of the type in a Pluto doc called val, it doesn’t display when I evaluate its name unless I explicitly call show(val) or print(val). In cont…

---

## [@time and @btime report different values?](https://discourse.julialang.org/t/time-and-btime-report-different-values/80087)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 17\
**Last updated:** [May 1, 2022, 5:55am UTC](https://discourse.julialang.org/t/time-and-btime-report-different-values/80087 "2022-05-01T05:55:23Z")

</div>

When timing the following function, I noticed that the @time macro shows a value, that I assume is correct, whereas @btime shows a different value. This only occurs in Julia 1.8.0-DEV and 1.9.0-DEV. Did I make a mistake? …

---

## [Pivot\_longer a multidimensional array](https://discourse.julialang.org/t/pivot-longer-a-multidimensional-array/80114)

<div class="topic-metadata">

**Author:** [@Marco\_Repetto](https://discourse.julialang.org/u/Marco_Repetto)\
**Replies:** 2\
**Last updated:** [May 1, 2022, 1:09am UTC](https://discourse.julialang.org/t/pivot-longer-a-multidimensional-array/80114 "2022-05-01T01:09:36Z")

</div>

I would like to transform a multidimensional array into a matrix of indexes and with the last column being the value itself. In a similar fashion to what pivot\_longer does in R. As an example, this 3-D array: rand(2,2,…

---

## [Performance of writing binary files](https://discourse.julialang.org/t/performance-of-writing-binary-files/80278)

<div class="topic-metadata">

**Author:** [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Replies:** 2\
**Last updated:** [April 30, 2022, 9:53pm UTC](https://discourse.julialang.org/t/performance-of-writing-binary-files/80278 "2022-04-30T21:53:07Z")

</div>

I am creating a function to write binary data (a data array) to a file. First, I have just reversed the reading function (which reads data almost one byte at a time) and performed a sequential write, but noticed it took…

---

## [Pair{Symbol, Function} slower than equivalent non-parametric type](https://discourse.julialang.org/t/pair-symbol-function-slower-than-equivalent-non-parametric-type/80295)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 4\
**Last updated:** [April 30, 2022, 9:21pm UTC](https://discourse.julialang.org/t/pair-symbol-function-slower-than-equivalent-non-parametric-type/80295 "2022-04-30T21:21:39Z")

</div>

Consider a list of symbol and functions: julia\> macro big\_closure\_list(T, n) esc(:($T\[$(\[:($T(:x, ()-\>$(Symbol(:v, i)))) for i in 1:n\]...)\])) end; julia\> @macroexpand @big\_closure\_list(Pair,…

---

## [Perform a multi-column, multi-dimensional search quickly](https://discourse.julialang.org/t/perform-a-multi-column-multi-dimensional-search-quickly/75113)

<div class="topic-metadata">

**Author:** [@Hikaru\_Matsuoka](https://discourse.julialang.org/u/Hikaru_Matsuoka)\
**Replies:** 9\
**Last updated:** [April 30, 2022, 8:22pm UTC](https://discourse.julialang.org/t/perform-a-multi-column-multi-dimensional-search-quickly/75113 "2022-04-30T20:22:04Z")

</div>

I would like to perform a multi-column search from a multi-dimensional matrix like the one below, is there a fast way to do this? (In the example below, I want to get the rows next to -5.0 3.0 2.0) Test\_matrix = \[-5.0…

---

## [What's the largest factors in latency?](https://discourse.julialang.org/t/whats-the-largest-factors-in-latency/80302)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 0\
**Last updated:** [April 30, 2022, 5:57pm UTC](https://discourse.julialang.org/t/whats-the-largest-factors-in-latency/80302 "2022-04-30T17:57:28Z")

</div>

A) For startup of Julia itself B) For running scripts I know some workaround for B) such as -O0 or --compile=min which often goes too far (I’m looking for a middle-ground with as fast startup as Python), is there any r…

---

## [Why is this MLP slower in Flux than in TensorFlow?](https://discourse.julialang.org/t/why-is-this-mlp-slower-in-flux-than-in-tensorflow/80272)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 5\
**Last updated:** [April 30, 2022, 3:39pm UTC](https://discourse.julialang.org/t/why-is-this-mlp-slower-in-flux-than-in-tensorflow/80272 "2022-04-30T15:39:57Z")

</div>

I am working with some MLPs and noticed that TensorFlow is much faster than Flux. In the examples below, Flux requires about 20 minutes and TensorFlow requires just over a minute. Am I doing something incorrectly? Thank…

---

## [Scope of Included Files](https://discourse.julialang.org/t/scope-of-included-files/80264)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 11\
**Last updated:** [April 30, 2022, 11:45am UTC](https://discourse.julialang.org/t/scope-of-included-files/80264 "2022-04-30T11:45:14Z")

</div>

In my understanding, the scope of an included file includes the scope of the file it was include’d in. For example: file1.jl: abstract type AbstractFoo end include("file2.jl") file2.jl: struct Foo \<: AbstractFoo end …

---

## [Julia plots layout](https://discourse.julialang.org/t/julia-plots-layout/80221)

<div class="topic-metadata">

**Author:** [@francesco123212](https://discourse.julialang.org/u/francesco123212)\
**Replies:** 1\
**Last updated:** [April 28, 2022, 9:13pm UTC](https://discourse.julialang.org/t/julia-plots-layout/80221 "2022-04-28T21:13:33Z")

</div>

Hi everyone, I currently am working on a plot with 3 rows of plots, using layout = layout(3,1). My issue is related to the x axis mismatch between the first diagram and the other 2; how should I fix it? thankyou in …

---

## [Split DateTime column into separate Date and Time Columns](https://discourse.julialang.org/t/split-datetime-column-into-separate-date-and-time-columns/80228)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 20\
**Last updated:** [April 30, 2022, 6:39am UTC](https://discourse.julialang.org/t/split-datetime-column-into-separate-date-and-time-columns/80228 "2022-04-30T06:39:03Z")

</div>

Suppose I have a Dataframe F with a column of DateTime data as follows, Number DateTime Int64 DateTime 1 │73 2022-03-21T20:00:00 2 │80 2022-03-21T19:56:00 …

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

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