# General Usage

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

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

**Page:** 185

---

## [How to speed up dense-sparse matrix multiplication where the sparse matrix is in CSC?](https://discourse.julialang.org/t/how-to-speed-up-dense-sparse-matrix-multiplication-where-the-sparse-matrix-is-in-csc/112260)

<div class="topic-metadata">

**Author:** [@yhuang](https://discourse.julialang.org/u/yhuang)\
**Replies:** 0\
**Last updated:** [March 28, 2024, 11:32pm UTC](https://discourse.julialang.org/t/how-to-speed-up-dense-sparse-matrix-multiplication-where-the-sparse-matrix-is-in-csc/112260 "2024-03-28T23:32:14Z")

</div>

For a sparse matrix stored in CSC format, without using MKLSparse, left multiplying it by a dense matrix is faster than right multiplying it by a dense matrix. This is quite intuitive because the sparse matrix is in CSC,…

---

## [More allocation in for loop than broadcast](https://discourse.julialang.org/t/more-allocation-in-for-loop-than-broadcast/112257)

<div class="topic-metadata">

**Author:** [@yuehao](https://discourse.julialang.org/u/yuehao)\
**Replies:** 4\
**Last updated:** [March 28, 2024, 11:09pm UTC](https://discourse.julialang.org/t/more-allocation-in-for-loop-than-broadcast/112257 "2024-03-28T23:09:12Z")

</div>

I am new to Julia and writing a simulation code to track the particle motion. Here is a simplified version of my code: using BenchmarkTools using StructArrays using StaticArrays struct ps3d # 6D phase space x::Flo…

---

## [Forcing format for Float in TOML file](https://discourse.julialang.org/t/forcing-format-for-float-in-toml-file/112253)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 0\
**Last updated:** [March 28, 2024, 8:51pm UTC](https://discourse.julialang.org/t/forcing-format-for-float-in-toml-file/112253 "2024-03-28T20:51:20Z")

</div>

Hi all, Is there a way to force that, when writting a TOML file, all Float are written as %24.12e (or any other specific format)? Thanks, A.

---

## [Plotting text with GLMakie](https://discourse.julialang.org/t/plotting-text-with-glmakie/112230)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 22\
**Last updated:** [March 28, 2024, 6:34pm UTC](https://discourse.julialang.org/t/plotting-text-with-glmakie/112230 "2024-03-28T18:34:23Z")

</div>

I am trying to plot text in a GLMakie window. My code: import GLMakie fig = GLMakie.Figure(size = (400, 400)) ax = GLMakie.Axis(fig\[1,1\]) GLMakie.text!(0, 20; text="Hello", show\_axis = false, fontsize =…

---

## [Is it type-piracy to define \`Base.parse(::Type{Tuple}, str)\`?](https://discourse.julialang.org/t/is-it-type-piracy-to-define-base-parse-type-tuple-str/112229)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 5\
**Last updated:** [March 28, 2024, 5:41pm UTC](https://discourse.julialang.org/t/is-it-type-piracy-to-define-base-parse-type-tuple-str/112229 "2024-03-28T17:41:05Z")

</div>

type piracy is a thing in julia. I am wondering whether or under which circumstances it is fine to define something like Base.parse(::Type{Tuple}, str) = ... i.e. a Base function for a Base Type. Or should you better …

---

## [\[Workgroup\] JuliaHealth Meeting (Americas/Europe/Africa) -- March 28th, 2024](https://discourse.julialang.org/t/workgroup-juliahealth-meeting-americas-europe-africa-march-28th-2024/111980)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 2\
**Last updated:** [March 28, 2024, 4:07pm UTC](https://discourse.julialang.org/t/workgroup-juliahealth-meeting-americas-europe-africa-march-28th-2024/111980 "2024-03-28T16:07:49Z")

</div>

Hi folks :wave: I am thrilled to announce this month’s agenda for the Americas/Africa/Europe call! We have some exciting topics to cover including a guest talk from Dr. Katherine Rosenfeld from the Bill and Melinda Gate…

---

## [Struct containing differently-sized Static Vectors](https://discourse.julialang.org/t/struct-containing-differently-sized-static-vectors/112231)

<div class="topic-metadata">

**Author:** [@leapsheep](https://discourse.julialang.org/u/leapsheep)\
**Replies:** 4\
**Last updated:** [March 28, 2024, 2:13pm UTC](https://discourse.julialang.org/t/struct-containing-differently-sized-static-vectors/112231 "2024-03-28T14:13:18Z")

</div>

I want to define a struct for a cluster of particles that each have a position and orientation in space. I would like my representation to work for both 2D and 3D, which is a bit tricky since in 2D I represent orientatio…

---

## [Sorting matrix according to the first column](https://discourse.julialang.org/t/sorting-matrix-according-to-the-first-column/112196)

<div class="topic-metadata">

**Author:** [@baprata](https://discourse.julialang.org/u/baprata)\
**Replies:** 12\
**Last updated:** [March 28, 2024, 12:43pm UTC](https://discourse.julialang.org/t/sorting-matrix-according-to-the-first-column/112196 "2024-03-28T12:43:49Z")

</div>

In the matrix below, the first, second, and third columns represent the height, area, and volume of rectangular objects, respectively. I need to sort the items in non-ascending order of height (from the highest to the lo…

---

## [Change font size in Gtk4.jl](https://discourse.julialang.org/t/change-font-size-in-gtk4-jl/112223)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [March 28, 2024, 9:41am UTC](https://discourse.julialang.org/t/change-font-size-in-gtk4-jl/112223 "2024-03-28T09:41:01Z")

</div>

How can I change the font size of a label in Gtk4.jl? I have the following code: using Gtk4 win = GtkWindow("My First Gtk4.jl Program", 400, 200) hbox = GtkBox(:h) # :h makes a horizontal layout, :v a vertical layout…

---

## [Unable to update packages](https://discourse.julialang.org/t/unable-to-update-packages/69161)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 1\
**Last updated:** [March 28, 2024, 9:04am UTC](https://discourse.julialang.org/t/unable-to-update-packages/69161 "2024-03-28T09:04:05Z")

</div>

I am unable to update packages. I am trying to find out if the problem is with Julia or some internet routing problem. Can anyone help? $ julia -O3 \_ \_ \_ \_(\_)\_ | Documentation: https://docs.…

---

## [Problem with MKL\_jll in Mac OS](https://discourse.julialang.org/t/problem-with-mkl-jll-in-mac-os/112121)

<div class="topic-metadata">

**Author:** [@Sharara](https://discourse.julialang.org/u/Sharara)\
**Replies:** 4\
**Last updated:** [March 28, 2024, 7:18am UTC](https://discourse.julialang.org/t/problem-with-mkl-jll-in-mac-os/112121 "2024-03-28T07:18:05Z")

</div>

Hi there! I am using the book pro-M2, and now using VSC to implement Julia codes, I just wrote several using the package and ran the program as below: using LinearAlgebra using JuMP using Mosek using MosekTools using…

---

## [Julia 1.10.2 + IJulia + ubuntu mate 22.04 = blank page](https://discourse.julialang.org/t/julia-1-10-2-ijulia-ubuntu-mate-22-04-blank-page/112213)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 0\
**Last updated:** [March 28, 2024, 6:55am UTC](https://discourse.julialang.org/t/julia-1-10-2-ijulia-ubuntu-mate-22-04-blank-page/112213 "2024-03-28T06:55:23Z")

</div>

Hi, two days ago I installed ubuntu mate 22.04 (=last LTS) on my PC together with julia 10.2 I installed the IJulia package as usual (add IJulia) but now when I open julia in a terminal, hitting using IJulia notebook…

---

## [Is there a way to get \`mul\_hi\`/\`umulh\`?](https://discourse.julialang.org/t/is-there-a-way-to-get-mul-hi-umulh/112109)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 5\
**Last updated:** [March 28, 2024, 4:12am UTC](https://discourse.julialang.org/t/is-there-a-way-to-get-mul-hi-umulh/112109 "2024-03-28T04:12:54Z")

</div>

Similar to (identical to) \`mul\_hi\` in Julia?, is there a way of accessing the high bits of a product between two bit integers? I want a function mul\_hi such that widen(mul\_hi(x, y)) \<\< 8sizeof(T) + x\*y == widemul(x,y) f…

---

## [A question about Distances.jl](https://discourse.julialang.org/t/a-question-about-distances-jl/76022)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 24\
**Last updated:** [March 27, 2024, 9:47pm UTC](https://discourse.julialang.org/t/a-question-about-distances-jl/76022 "2024-03-27T21:47:32Z")

</div>

this is my code: using Distances dm=pairwise(dist, X1, dims=2) LoadError: UndefVarError: pairwise not defined Stacktrace: \[1\] \_kmeans!(X::Matrix{Float64}, weights::Nothing, centers::Matrix{Float64}, maxiter::Int64,…

---

## [Writing Multidimensional FreqTable to CSV](https://discourse.julialang.org/t/writing-multidimensional-freqtable-to-csv/112192)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 6\
**Last updated:** [March 27, 2024, 8:37pm UTC](https://discourse.julialang.org/t/writing-multidimensional-freqtable-to-csv/112192 "2024-03-27T20:37:09Z")

</div>

I need to take a cross-tab of a DataFrame and write it out to CSV. This cross-tab has 3 dimensions. If I were to use pandas for this, it would create a multi-index, but FreqTables.jl creates a multidimensional NamedArray.…

---

## [Exclude pattern from the REPL history](https://discourse.julialang.org/t/exclude-pattern-from-the-repl-history/111999)

<div class="topic-metadata">

**Author:** [@shg](https://discourse.julialang.org/u/shg)\
**Replies:** 17\
**Last updated:** [March 27, 2024, 7:55pm UTC](https://discourse.julialang.org/t/exclude-pattern-from-the-repl-history/111999 "2024-03-27T19:55:46Z")

</div>

Is there any way to prevent some inputs that match a specific pattern from being stored in the REPL history?

---

## [Building docs with Documenter.jl](https://discourse.julialang.org/t/building-docs-with-documenter-jl/63159)

<div class="topic-metadata">

**Author:** [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)\
**Replies:** 7\
**Last updated:** [March 27, 2024, 7:12pm UTC](https://discourse.julialang.org/t/building-docs-with-documenter-jl/63159 "2024-03-27T19:12:44Z")

</div>

I’ve been trying to get docs to build here, but for some reason only dev gets built after a new release gets tagged and registered ( even stable doesn’t get built). I thought adding the versions argument to the deploydoc…

---

## [What is the fastest way to find if a real nonsquare matrix is injective?](https://discourse.julialang.org/t/what-is-the-fastest-way-to-find-if-a-real-nonsquare-matrix-is-injective/112176)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 8\
**Last updated:** [March 27, 2024, 4:57pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-to-find-if-a-real-nonsquare-matrix-is-injective/112176 "2024-03-27T16:57:00Z")

</div>

Hello guys! The title says all. I have a certain M\\times N real valued matrix A and I would like to know if it is injective. What would be the fastest way to accomplish that? I know that I could calculate the determinan…

---

## [Bypass inner constructor / call \`new\` outside inner constructor](https://discourse.julialang.org/t/bypass-inner-constructor-call-new-outside-inner-constructor/112142)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 10\
**Last updated:** [March 27, 2024, 4:20pm UTC](https://discourse.julialang.org/t/bypass-inner-constructor-call-new-outside-inner-constructor/112142 "2024-03-27T16:20:18Z")

</div>

I have defined a struct with an inner constructor that enforces some invariants, similar to the example in the Documentation julia\> struct OrderedPair x::Real y::Real OrderedPair(x,y) =…

---

## [Using the \`opt\` from Julia's LLVM?](https://discourse.julialang.org/t/using-the-opt-from-julias-llvm/112161)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 2\
**Last updated:** [March 27, 2024, 2:55pm UTC](https://discourse.julialang.org/t/using-the-opt-from-julias-llvm/112161 "2024-03-27T14:55:06Z")

</div>

Hi all— This may be a bit of a weird one, but I’m looking for a way to use the opt from Julia’s LLVM on some \*.ll files. The “why” is that I am compiling Enzyme with Julia’s LLVM following the dev docs here, which is mu…

---

## [Is it possible to define a type-stable function that returns a Plots.Plot object?](https://discourse.julialang.org/t/is-it-possible-to-define-a-type-stable-function-that-returns-a-plots-plot-object/112172)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 3\
**Last updated:** [March 27, 2024, 1:24pm UTC](https://discourse.julialang.org/t/is-it-possible-to-define-a-type-stable-function-that-returns-a-plots-plot-object/112172 "2024-03-27T13:24:54Z")

</div>

Is it possible to define a type stable function that returns a Plots.plot object? Minimal reproducible example: using Plots function mplot(vec::AbstractVector) plot(vec) end @code\_warntype mplot(rand(10)) returns …

---

## [MethodError: no method matching Adam(::Float64)](https://discourse.julialang.org/t/methoderror-no-method-matching-adam-float64/112009)

<div class="topic-metadata">

**Author:** [@sharmaviven1](https://discourse.julialang.org/u/sharmaviven1)\
**Replies:** 7\
**Last updated:** [March 27, 2024, 8:08am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-adam-float64/112009 "2024-03-27T08:08:39Z")

</div>

Hello all, I have been trying to setup NeuralODE to learn the behavior of a stiff ODE but in the process I am running into this strange error. I have tried using all Float32 values only but it seems that there is some i…

---

## [Can't concatenate a matrix to \`Any\[\]\` horizontally](https://discourse.julialang.org/t/cant-concatenate-a-matrix-to-any-horizontally/112152)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 9\
**Last updated:** [March 26, 2024, 5:18pm UTC](https://discourse.julialang.org/t/cant-concatenate-a-matrix-to-any-horizontally/112152 "2024-03-26T17:18:23Z")

</div>

Block1: a = \[\] b = \[1 2; 3 4\] a = vcat(a, b) # or a = \[a; b\] Block2: a = \[\] b = \[1 2; 3 4\] a = hcat(a, b) # or a = \[a b\] Question: Block1 works but Block2 doesn’t. Why?

---

## [From Python to Julia](https://discourse.julialang.org/t/from-python-to-julia/112137)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [March 26, 2024, 4:01pm UTC](https://discourse.julialang.org/t/from-python-to-julia/112137 "2024-03-26T16:01:01Z")

</div>

I am working now in a team of researchers that mainly use Python. How can I explain that I am happy that Julia is not object oriented? I said that classes are replaced by structs and types. There is a type hierarchy, bu…

---

## [Is it possibly to do atomic update on an array element?](https://discourse.julialang.org/t/is-it-possibly-to-do-atomic-update-on-an-array-element/112113)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 14\
**Last updated:** [March 26, 2024, 3:28pm UTC](https://discourse.julialang.org/t/is-it-possibly-to-do-atomic-update-on-an-array-element/112113 "2024-03-26T15:28:40Z")

</div>

The manual seems to read “primitive type values only”. Also, just above that section is “API is deprecated”. Does anyone has an insight into this?

---

## [Should you use @spawnat/@everywhere within a package? (Distributed.jl)](https://discourse.julialang.org/t/should-you-use-spawnat-everywhere-within-a-package-distributed-jl/112134)

<div class="topic-metadata">

**Author:** [@Rutger0000](https://discourse.julialang.org/u/Rutger0000)\
**Replies:** 1\
**Last updated:** [March 26, 2024, 2:39pm UTC](https://discourse.julialang.org/t/should-you-use-spawnat-everywhere-within-a-package-distributed-jl/112134 "2024-03-26T14:39:34Z")

</div>

How should a package use Distributed.jl? The goal is that you have a package with some functions, and then you execute MyPackage.run() in your main process and the package in the background does all the ‘clever’ parallel…

---

## [Comparing times in a dataframe](https://discourse.julialang.org/t/comparing-times-in-a-dataframe/112131)

<div class="topic-metadata">

**Author:** [@Marc\_Sevaux](https://discourse.julialang.org/u/Marc_Sevaux)\
**Replies:** 2\
**Last updated:** [March 26, 2024, 11:31am UTC](https://discourse.julialang.org/t/comparing-times-in-a-dataframe/112131 "2024-03-26T11:31:22Z")

</div>

Dear all, I am not very comfortable with time formats. I have the following dataframe. ┌─────────┬──────────┐ │ id\_site │ hour │ │ String7 │ Time │ ├─────────┼──────────┤ │ BAN4 │ 08:48:00 │ │ BAN4 │ 08:5…

---

## [Number of each unique value in an array](https://discourse.julialang.org/t/number-of-each-unique-value-in-an-array/58627)

<div class="topic-metadata">

**Author:** [@tgautam03](https://discourse.julialang.org/u/tgautam03)\
**Replies:** 4\
**Last updated:** [March 26, 2024, 7:58am UTC](https://discourse.julialang.org/t/number-of-each-unique-value-in-an-array/58627 "2024-03-26T07:58:50Z")

</div>

Hi, I’m new to Julia and converting my existing python code to julia. I often use np.unique with return\_counts=True to get all unique values and the number of times each one appears in an array. I’m trying to find an al…

---

## [Stream help in Genie](https://discourse.julialang.org/t/stream-help-in-genie/111531)

<div class="topic-metadata">

**Author:** [@smith-isaac](https://discourse.julialang.org/u/smith-isaac)\
**Replies:** 12\
**Last updated:** [March 26, 2024, 7:51am UTC](https://discourse.julialang.org/t/stream-help-in-genie/111531 "2024-03-26T07:51:17Z")

</div>

Hi everyone! For some background, I am trying to set up a little site using the Genie Framework where I can watch livestreams of my 3D printer as well as start timelapses, and be able to review and download the timelaps…

---

## [Peculiar Issue: The same function when defined in a package is 10x slower](https://discourse.julialang.org/t/peculiar-issue-the-same-function-when-defined-in-a-package-is-10x-slower/112110)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 1\
**Last updated:** [March 26, 2024, 12:19am UTC](https://discourse.julialang.org/t/peculiar-issue-the-same-function-when-defined-in-a-package-is-10x-slower/112110 "2024-03-26T00:19:57Z")

</div>

Hello! I do not have a MWE since it is something I have spotted in developing a nested package. What I noticed is that if I have a function such as; function SPHExample.ComputeInteractions!(Position, Kernel, KernelGrad…

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

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