# General Usage

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

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

**Page:** 642

---

## [Interact widgets in Jupyter Notebook not reacting](https://discourse.julialang.org/t/interact-widgets-in-jupyter-notebook-not-reacting/52150)

<div class="topic-metadata">

**Author:** [@schmuelinsky](https://discourse.julialang.org/u/schmuelinsky)\
**Replies:** 8\
**Last updated:** [February 18, 2021, 2:55am UTC](https://discourse.julialang.org/t/interact-widgets-in-jupyter-notebook-not-reacting/52150 "2021-02-18T02:55:02Z")

</div>

I’ve been having a weird issue for a long time now. I’ve tried multiple things, but they only worked temporarily at best. I’m using the package Interact in Jupyter Notebook to create some interactive plots. But the prob…

---

## [Are there no docs for 1.6? can't find it in the menu here https://docs.julialang.o](https://discourse.julialang.org/t/are-there-no-docs-for-1-6-cant-find-it-in-the-menu-here-https-docs-julialang-o/55505)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 18, 2021, 2:23am UTC](https://discourse.julialang.org/t/are-there-no-docs-for-1-6-cant-find-it-in-the-menu-here-https-docs-julialang-o/55505 "2021-02-18T02:23:18Z")

</div>

are there no docs for 1.6? can’t find it in the menu here https://docs.julialang.org/en/v1/|https://docs.julialang.org/en/v1/ Note that the original poster on Slack cannot see your response here on Discourse. Consider t…

---

## [Store complex and real numbers with same underlying](https://discourse.julialang.org/t/store-complex-and-real-numbers-with-same-underlying/55489)

<div class="topic-metadata">

**Author:** [@Uroc327](https://discourse.julialang.org/u/Uroc327)\
**Replies:** 6\
**Last updated:** [February 18, 2021, 12:27am UTC](https://discourse.julialang.org/t/store-complex-and-real-numbers-with-same-underlying/55489 "2021-02-18T00:27:57Z")

</div>

Hi, I am trying to store multiple values in a struct. I’d like those values to have the same precision (expected use cases are floating point and fixed point types with several precisions). Some of those values may be c…

---

## [How to make functions multipliable?](https://discourse.julialang.org/t/how-to-make-functions-multipliable/55487)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 8\
**Last updated:** [February 17, 2021, 10:15pm UTC](https://discourse.julialang.org/t/how-to-make-functions-multipliable/55487 "2021-02-17T22:15:55Z")

</div>

I want to make functions be able to be multiplied: f(x) = x^2 g = 3 \* f g(10) # == 300 Is this achievable?

---

## [Vectorized math](https://discourse.julialang.org/t/vectorized-math/55476)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 12\
**Last updated:** [February 17, 2021, 8:02pm UTC](https://discourse.julialang.org/t/vectorized-math/55476 "2021-02-17T20:02:28Z")

</div>

Is there a need to use the “.” for vector math when adding and multiplying? a = \[1 2 3\] b = \[3 4 5\] # Which is better for performance? They both do the same thing. c = 1/2 \* a + b d = 1/2 .\* a .+ b

---

## [How to convert Array{Int64} to Array{BigInt}](https://discourse.julialang.org/t/how-to-convert-array-int64-to-array-bigint/55473)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 4\
**Last updated:** [February 17, 2021, 6:29pm UTC](https://discourse.julialang.org/t/how-to-convert-array-int64-to-array-bigint/55473 "2021-02-17T18:29:29Z")

</div>

Is there any function to do it?

---

## [Symmetric matrix is not symmetric](https://discourse.julialang.org/t/symmetric-matrix-is-not-symmetric/55479)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 2\
**Last updated:** [February 17, 2021, 6:26pm UTC](https://discourse.julialang.org/t/symmetric-matrix-is-not-symmetric/55479 "2021-02-17T18:26:08Z")

</div>

I’m trying to do a hierarchical clustering of a matrix, and I’m running into a weird problem. Using Distances.jl, I’m doing dm = pairwise(Jaccard(), my\_matrix), and then hclust(dm) from Clustering.jl. But I’m getting ju…

---

## [Efficient reflection on structs](https://discourse.julialang.org/t/efficient-reflection-on-structs/55278)

<div class="topic-metadata">

**Author:** [@Guillaume\_Leclerc](https://discourse.julialang.org/u/Guillaume_Leclerc)\
**Replies:** 54\
**Last updated:** [February 17, 2021, 6:08pm UTC](https://discourse.julialang.org/t/efficient-reflection-on-structs/55278 "2021-02-17T18:08:43Z")

</div>

Hello, I am trying to do something to StructArray but I can’t seem to generate efficient code. Let’s say there is struct Wrapper{T} and it is supposed to behave similarly to T except I’m managing where/how the underlyi…

---

## [What might have happened to \*my\* @code\_warntype?](https://discourse.julialang.org/t/what-might-have-happened-to-my-code-warntype/55435)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 7\
**Last updated:** [February 17, 2021, 4:04pm UTC](https://discourse.julialang.org/t/what-might-have-happened-to-my-code-warntype/55435 "2021-02-17T16:04:21Z")

</div>

I run this command many times before and it used to print hundreds of lines, now it just print this (same for other @code\_warntype calls to other functions) julia\> @code\_warntype plot(\[0 0; 1 1\]); Variables #self#::Co…

---

## [VS Code Julia extension version](https://discourse.julialang.org/t/vs-code-julia-extension-version/55458)

<div class="topic-metadata">

**Author:** [@j2b2](https://discourse.julialang.org/u/j2b2)\
**Replies:** 2\
**Last updated:** [February 17, 2021, 1:45pm UTC](https://discourse.julialang.org/t/vs-code-julia-extension-version/55458 "2021-02-17T13:45:05Z")

</div>

Hello, I’m trying to install VS Code Julia extension, following Getting Started · Julia in VS Code, and in the “EXTENSIONS” tab of VS Code I see julia 1.1.21, instead of 0.17 !! What did I do wrong ?

---

## [I made a EM Algorithm for Gaussian Mixture Models, but that is not working](https://discourse.julialang.org/t/i-made-a-em-algorithm-for-gaussian-mixture-models-but-that-is-not-working/55205)

<div class="topic-metadata">

**Author:** [@ryuma](https://discourse.julialang.org/u/ryuma)\
**Replies:** 4\
**Last updated:** [February 17, 2021, 11:18am UTC](https://discourse.julialang.org/t/i-made-a-em-algorithm-for-gaussian-mixture-models-but-that-is-not-working/55205 "2021-02-17T11:18:47Z")

</div>

I made a EM Algorithm for Gaussian Mixture Models, but that is not working. error massages → matrix is not Hermitian; Cholesky factorization failed. why error happen, please teach me. using LinearAlgebra using Distrib…

---

## [How to convert a Vector of MVectors to a Matrix](https://discourse.julialang.org/t/how-to-convert-a-vector-of-mvectors-to-a-matrix/55449)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [February 17, 2021, 10:52am UTC](https://discourse.julialang.org/t/how-to-convert-a-vector-of-mvectors-to-a-matrix/55449 "2021-02-17T10:52:24Z")

</div>

I have the following code: using StaticArrays function test() X = range(0, stop=10, length=8) X\_vec = Vector{MVector{8, Float32}}(undef, 10) for i in range(1, stop=10) X\_vec\[i\] = X end retur…

---

## [Is there a way to "enumerate" \`mapslices\` other than\`\`\`i = 0result = mapslices(m](https://discourse.julialang.org/t/is-there-a-way-to-enumerate-mapslices-other-than-i-0result-mapslices-m/55414)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 3\
**Last updated:** [February 17, 2021, 9:39am UTC](https://discourse.julialang.org/t/is-there-a-way-to-enumerate-mapslices-other-than-i-0result-mapslices-m/55414 "2021-02-17T09:39:06Z")

</div>

Is there a way to “enumerate” mapslices other than i = 0 result = mapslices(myarray; dims=dims) do x i += 1 myfunction(x, i) end ? Note that the original poster on Slack cannot see your response here on Discou…

---

## [Hi again. Now I'm having trouble to download the \`OpenSpecFun\` artifact. It happen](https://discourse.julialang.org/t/hi-again-now-im-having-trouble-to-download-the-openspecfun-artifact-it-happen/55392)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 17, 2021, 7:26am UTC](https://discourse.julialang.org/t/hi-again-now-im-having-trouble-to-download-the-openspecfun-artifact-it-happen/55392 "2021-02-17T07:26:15Z")

</div>

Hi again. Now I’m having trouble to download the OpenSpecFun artifact. It happens when adding a package from a custom registry, please see the screenshot attached with the traceback (the user claims they’re unable to cop…

---

## [Package for lazy concatenation along arbitrary higher dimensions?](https://discourse.julialang.org/t/package-for-lazy-concatenation-along-arbitrary-higher-dimensions/55413)

<div class="topic-metadata">

**Author:** [@tlnagy](https://discourse.julialang.org/u/tlnagy)\
**Replies:** 4\
**Last updated:** [February 17, 2021, 7:17am UTC](https://discourse.julialang.org/t/package-for-lazy-concatenation-along-arbitrary-higher-dimensions/55413 "2021-02-17T07:17:57Z")

</div>

Are there any packages that let you concatenate lazily along arbitrary dimensions like the eager cat does? julia\> mats = \[rand(5,6,7,8), rand(5,6,7,8)\]; julia\> combo = cat(mats..., dims=3); # this, but lazy julia\> siz…

---

## [Can anyone point me to formatting string. I have an output where I want to control](https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 17, 2021, 2:23am UTC](https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431 "2021-02-17T02:23:28Z")

</div>

can anyone point me to formatting string. I have an output where I want to control the spacing of everything and have it separated like this #This is what I have "converged: true |...." "converged: false |...." #This i…

---

## [MLJ on GPU?](https://discourse.julialang.org/t/mlj-on-gpu/55047)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 4\
**Last updated:** [February 17, 2021, 1:46am UTC](https://discourse.julialang.org/t/mlj-on-gpu/55047 "2021-02-17T01:46:44Z")

</div>

I would like to know, how to train MLJ model on GPU. Example using MLJ X = MLJ.table(rand(100, 10)); y = 2X.x1 - X.x2 + 0.05\*rand(100); @load LinearRegressor pkg=MLJLinearModels verbosity=0; model = LinearRegressor() …

---

## [What’s the best place to go to learn about scraping data from websites in Julia (t](https://discourse.julialang.org/t/what-s-the-best-place-to-go-to-learn-about-scraping-data-from-websites-in-julia-t/55426)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 10:54pm UTC](https://discourse.julialang.org/t/what-s-the-best-place-to-go-to-learn-about-scraping-data-from-websites-in-julia-t/55426 "2021-02-16T22:54:47Z")

</div>

What’s the best place to go to learn about scraping data from websites in Julia (this is for my 17 year old son, who wants to do a project, looking at data from Wikipedia) Note that the original poster on Slack cannot s…

---

## [I am looking for some help with segfault when passing a struct to a C-API via \`@cc](https://discourse.julialang.org/t/i-am-looking-for-some-help-with-segfault-when-passing-a-struct-to-a-c-api-via-cc/55425)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 10:15pm UTC](https://discourse.julialang.org/t/i-am-looking-for-some-help-with-segfault-when-passing-a-struct-to-a-c-api-via-cc/55425 "2021-02-16T22:15:16Z")

</div>

I am looking for some help with segfault when passing a struct to a C-API via @ccall. I created an immutable struct inside a Ref(), and then call something like @ccall lib.somefunc(myref::Ptr{MyStruct}).... This seems to…

---

## [Artificial ownership chaining from precompilation directives](https://discourse.julialang.org/t/artificial-ownership-chaining-from-precompilation-directives/55405)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 6:38pm UTC](https://discourse.julialang.org/t/artificial-ownership-chaining-from-precompilation-directives/55405 "2021-02-16T18:38:05Z")

</div>

Hey, I want to know if it is possible to do some artificial way to give ownership of the precompilation directives generated from SnoopCompile.jl to our package. My idea: @snoopi\_deep on a code → export it to prec…

---

## [Quick DataFrame question: I am trying to read CSVs that, for some reason, have pos](https://discourse.julialang.org/t/quick-dataframe-question-i-am-trying-to-read-csvs-that-for-some-reason-have-pos/55404)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 6:22pm UTC](https://discourse.julialang.org/t/quick-dataframe-question-i-am-trying-to-read-csvs-that-for-some-reason-have-pos/55404 "2021-02-16T18:22:17Z")

</div>

quick DataFrame question: I am trying to read CSVs that, for some reason, have possibly many columns of missing data at the end. The columns are entirely missing. Is there something similar to dropmissing that operates …

---

## [Writing to HDF5 File with Compound Datatypes](https://discourse.julialang.org/t/writing-to-hdf5-file-with-compound-datatypes/55408)

<div class="topic-metadata">

**Author:** [@nicrummel](https://discourse.julialang.org/u/nicrummel)\
**Replies:** 0\
**Last updated:** [February 16, 2021, 5:57pm UTC](https://discourse.julialang.org/t/writing-to-hdf5-file-with-compound-datatypes/55408 "2021-02-16T17:57:34Z")

</div>

The HDF5.jl is a great tool for reading and analyzing data from HDF5 files in Julia, but the process of writing is not straight forward. It appears that I will need to go through the low level API to accomplish the task …

---

## [Drawing parametric surfaces in Plots.jl](https://discourse.julialang.org/t/drawing-parametric-surfaces-in-plots-jl/36560)

<div class="topic-metadata">

**Author:** [@Tbl](https://discourse.julialang.org/u/Tbl)\
**Replies:** 13\
**Last updated:** [February 16, 2021, 4:19pm UTC](https://discourse.julialang.org/t/drawing-parametric-surfaces-in-plots-jl/36560 "2021-02-16T16:19:46Z")

</div>

Does anyone know how to make a 3D plot of surfaces which are parametric? I mean e.g. sphere or Möbius strip. Looking at help and my own experiments, function surface draws on rectangles seem to not provide option of givi…

---

## [I need some help defining an interface that would kind of be a static class method](https://discourse.julialang.org/t/i-need-some-help-defining-an-interface-that-would-kind-of-be-a-static-class-method/54883)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 4:18pm UTC](https://discourse.julialang.org/t/i-need-some-help-defining-an-interface-that-would-kind-of-be-a-static-class-method/54883 "2021-02-16T16:18:37Z")

</div>

I need some help defining an interface that would kind of be a static class method in an OO language (while also having concrete instances of the contextual class with functionality in the class methods). For simplicity,…

---

## [Need to find datetime for a datetime plus a duration/period/timedelta](https://discourse.julialang.org/t/need-to-find-datetime-for-a-datetime-plus-a-duration-period-timedelta/55267)

<div class="topic-metadata">

**Author:** [@bvilmann](https://discourse.julialang.org/u/bvilmann)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 3:18pm UTC](https://discourse.julialang.org/t/need-to-find-datetime-for-a-datetime-plus-a-duration-period-timedelta/55267 "2021-02-16T15:18:41Z")

</div>

Suppose I have a period, defined by Time() and a datetime, DateTime(). My goal is to to get a new datetime: using Dates startTime = DateTime(2021,2,14,19,00) duration = Time(4,30) endTime = startTime + duration Abov…

---

## [Help Improving Performance of a Loop](https://discourse.julialang.org/t/help-improving-performance-of-a-loop/55343)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 15\
**Last updated:** [February 16, 2021, 1:01pm UTC](https://discourse.julialang.org/t/help-improving-performance-of-a-loop/55343 "2021-02-16T13:01:21Z")

</div>

Hello! I am trying to make a code more efficient and I have found a huge bottleneck in the following function of this MWE: using Random, BenchmarkTools J = 250 T = 100 Mat1 = rand(J,J) vec1 = rand(J) Mat2= rand(J,J…

---

## [Having trouble to get julia 1.5.3 setup in my students windows computers. It seems](https://discourse.julialang.org/t/having-trouble-to-get-julia-1-5-3-setup-in-my-students-windows-computers-it-seems/55383)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [February 16, 2021, 11:21am UTC](https://discourse.julialang.org/t/having-trouble-to-get-julia-1-5-3-setup-in-my-students-windows-computers-it-seems/55383 "2021-02-16T11:21:02Z")

</div>

Having trouble to get julia 1.5.3 setup in my students windows computers. It seems like the General registry is not added with the installation? Moreoever, when one tries \] registry add General they get ERROR: SystemErro…

---

## [Could pop!(::Dict, key, default) have a do-block method?](https://discourse.julialang.org/t/could-pop-dict-key-default-have-a-do-block-method/55378)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 10:10am UTC](https://discourse.julialang.org/t/could-pop-dict-key-default-have-a-do-block-method/55378 "2021-02-16T10:10:22Z")

</div>

Currently pop! has a method that requires all arguments to be evaluated beforehand: julia\> a = Dict("x" =\> 3, "y" =\> 4) Dict{String,Int64} with 2 entries: "x" =\> 3 "y" =\> 4 julia\> @time pop!(a, "x", (sleep(10); 5))…

---

## [Is there a way to get more type information in stack traces / what heuristics are](https://discourse.julialang.org/t/is-there-a-way-to-get-more-type-information-in-stack-traces-what-heuristics-are/55226)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 10:01am UTC](https://discourse.julialang.org/t/is-there-a-way-to-get-more-type-information-in-stack-traces-what-heuristics-are/55226 "2021-02-16T10:01:11Z")

</div>

Is there a way to get more type information in stack traces / what heuristics are used to decide to strip them? Debugging chains of functions whose behavior is determined by types of the arguments is much harder when I…

---

## [How to add text to a rendering?](https://discourse.julialang.org/t/how-to-add-text-to-a-rendering/55317)

<div class="topic-metadata">

**Author:** [@Simone\_Chilosi](https://discourse.julialang.org/u/Simone_Chilosi)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 9:12am UTC](https://discourse.julialang.org/t/how-to-add-text-to-a-rendering/55317 "2021-02-16T09:12:13Z")

</div>

I’m working to a project in which there is a viewer that can render multiple 3d objects. I’d like to add some text to the window for some instructions for the user (for example “use wasd to rotate the object”), how can I…

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

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