# General Usage

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

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

**Page:** 340

---

## [PackageCompiler. Re-use of system image](https://discourse.julialang.org/t/packagecompiler-re-use-of-system-image/93386)

<div class="topic-metadata">

**Author:** [@wave\_and\_matter](https://discourse.julialang.org/u/wave_and_matter)\
**Replies:** 0\
**Last updated:** [January 23, 2023, 9:17am UTC](https://discourse.julialang.org/t/packagecompiler-re-use-of-system-image/93386 "2023-01-23T09:17:37Z")

</div>

Parallel to the StaticCompiler i am also trying out the PackageCompiler. A problem that i have with it is that with the standard call using PackageCompiler create\_library("myPkg", "myPkgCompiled"; …

---

## [Pluto This localhost page can’t be found](https://discourse.julialang.org/t/pluto-this-localhost-page-can-t-be-found/93383)

<div class="topic-metadata">

**Author:** [@xuanvietchu](https://discourse.julialang.org/u/xuanvietchu)\
**Replies:** 1\
**Last updated:** [January 23, 2023, 9:03am UTC](https://discourse.julialang.org/t/pluto-this-localhost-page-can-t-be-found/93383 "2023-01-23T09:03:55Z")

</div>

Hello all, I recently started using Julia and Pluto notebook. However, I cannot launch Pluto after downloading it. This is what the error looks like: Everything appears normal on the Julia cmd, but when it automatic…

---

## [CairoMakie hlines behaviour](https://discourse.julialang.org/t/cairomakie-hlines-behaviour/93247)

<div class="topic-metadata">

**Author:** [@SDA](https://discourse.julialang.org/u/SDA)\
**Replies:** 2\
**Last updated:** [January 23, 2023, 1:18am UTC](https://discourse.julialang.org/t/cairomakie-hlines-behaviour/93247 "2023-01-23T01:18:05Z")

</div>

Hi everyone, I’m trying to understand the output of the below MWE: using CairoMakie fig = Figure() ax=Axis(fig\[1, 1\]) xmins = zeros(10) xmaxs = \[1:5; 3:7\] ys = 1:10 hlines!(ax, ys, xmin=xmins, xmax=xmaxs) I wa…

---

## [Modifying \`jlcode.sty\` with Beamer/BeamerPoster frames](https://discourse.julialang.org/t/modifying-jlcode-sty-with-beamer-beamerposter-frames/93371)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 0\
**Last updated:** [January 22, 2023, 7:35pm UTC](https://discourse.julialang.org/t/modifying-jlcode-sty-with-beamer-beamerposter-frames/93371 "2023-01-22T19:35:33Z")

</div>

I am creating a Beamer presentation in which I am presenting some Julia code. By marking each frame as fragile, the styling looks great and goes edge to edge for a really nice finish. See screenshot However, instead o…

---

## [Efficient sparse-dense matrix multiplication for diagonal-like sparse matrices](https://discourse.julialang.org/t/efficient-sparse-dense-matrix-multiplication-for-diagonal-like-sparse-matrices/93341)

<div class="topic-metadata">

**Author:** [@Ronan\_Gautier](https://discourse.julialang.org/u/Ronan_Gautier)\
**Replies:** 8\
**Last updated:** [January 22, 2023, 5:09pm UTC](https://discourse.julialang.org/t/efficient-sparse-dense-matrix-multiplication-for-diagonal-like-sparse-matrices/93341 "2023-01-22T17:09:39Z")

</div>

I want to implement an efficient and in-place sparse-dense matrix multiplication for sparse matrices with only a few non-zero offset diagonals (known as DIA sparse matrices). Here however, the number of non-zero diagonal…

---

## [Edit graphic files (gif) as rgb 0:255 matrices?](https://discourse.julialang.org/t/edit-graphic-files-gif-as-rgb-0-255-matrices/93361)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 0\
**Last updated:** [January 22, 2023, 2:18pm UTC](https://discourse.julialang.org/t/edit-graphic-files-gif-as-rgb-0-255-matrices/93361 "2023-01-22T14:18:06Z")

</div>

In which package to edit graphic files (gif) as rgb 0:255 matrices?

---

## [Strange issue in testing a package using Symbolics.jl](https://discourse.julialang.org/t/strange-issue-in-testing-a-package-using-symbolics-jl/93351)

<div class="topic-metadata">

**Author:** [@Isaia\_Nisoli](https://discourse.julialang.org/u/Isaia_Nisoli)\
**Replies:** 3\
**Last updated:** [January 22, 2023, 10:30am UTC](https://discourse.julialang.org/t/strange-issue-in-testing-a-package-using-symbolics-jl/93351 "2023-01-22T10:30:31Z")

</div>

I am going through a weird issue when writing a testset for a part of RigorousInvariantMeasures.jl that uses Symbolics.jl. I start the testset by using Symbolics, then call @variables z and when I run the tests Julia c…

---

## [Getting wrong values when using \\div (÷) operator](https://discourse.julialang.org/t/getting-wrong-values-when-using-div-operator/93329)

<div class="topic-metadata">

**Author:** [@Gianluca\_Fuwa](https://discourse.julialang.org/u/Gianluca_Fuwa)\
**Replies:** 10\
**Last updated:** [January 22, 2023, 9:23am UTC](https://discourse.julialang.org/t/getting-wrong-values-when-using-div-operator/93329 "2023-01-22T09:23:17Z")

</div>

Hello, I’ve stumbled upon a bug when using the \\div (÷) operator: 20÷1 \> 20 produces the expected result 20, but 20÷0.1 \> 199.0 gives the result 199.0. This continues up until dividing by 1e-6, from which point o…

---

## [Graphs, GraphPlot](https://discourse.julialang.org/t/graphs-graphplot/93304)

<div class="topic-metadata">

**Author:** [@46do14](https://discourse.julialang.org/u/46do14)\
**Replies:** 5\
**Last updated:** [January 22, 2023, 6:52am UTC](https://discourse.julialang.org/t/graphs-graphplot/93304 "2023-01-22T06:52:06Z")

</div>

could someone please help? I’m new to the Graphs package and I want to plot a graph (as described by the GraphPlot github documentation) using Graphs: smallgraph g = smallgraph(:karate) gplot(g) My problem is that t…

---

## [How do I find the number of bits a number needs for storage](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bits-a-number-needs-for-storage/93334)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 5\
**Last updated:** [January 21, 2023, 11:40pm UTC](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bits-a-number-needs-for-storage/93334 "2023-01-21T23:40:41Z")

</div>

I was looking into compression algorithms and storage schemes (like Simple-8b and xor-based compression ) and one thing they do is determine the highest set bit for a given number. I wrote some code, but I feel this ca…

---

## [Define\_editor not found](https://discourse.julialang.org/t/define-editor-not-found/93323)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 9:40pm UTC](https://discourse.julialang.org/t/define-editor-not-found/93323 "2023-01-21T21:40:41Z")

</div>

According to the Julia documentation, define\_editor should be available by default. On my mac, Julia 1.8.3, edit is found, while define\_editor is not. As a result, I cannot use the @edit macro. Any insight is appreciated…

---

## [Should @FastPow not make this faster?](https://discourse.julialang.org/t/should-fastpow-not-make-this-faster/93296)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 7\
**Last updated:** [January 21, 2023, 6:25pm UTC](https://discourse.julialang.org/t/should-fastpow-not-make-this-faster/93296 "2023-01-21T18:25:08Z")

</div>

Hello everyone! Suppose I have a set of parameters as: ρ₀ = 1000; c₀ = 20; γ = 7; ρ = ρ₀ .+ ρ₀\*rand(10^6)\*0.1; And I wish to evaluate the function: function Pressure(ρ,c₀,γ,ρ₀) return ((c₀^2\*ρ₀)/γ) \* ((ρ/ρ₀)^γ - …

---

## [Strange behavior of saveat with save\_start=false](https://discourse.julialang.org/t/strange-behavior-of-saveat-with-save-start-false/93294)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 4:41pm UTC](https://discourse.julialang.org/t/strange-behavior-of-saveat-with-save-start-false/93294 "2023-01-21T16:41:15Z")

</div>

I am getting strange behavior with the different versions of save\_at and save\_start and save\_end. Here is a MWE: using DifferentialEquations function exponen!(du, u, param, t) du\[1\] = -u\[1\] end tspan = (0., 3.) prob …

---

## [Module scoping and macro expansion](https://discourse.julialang.org/t/module-scoping-and-macro-expansion/92914)

<div class="topic-metadata">

**Author:** [@veddox](https://discourse.julialang.org/u/veddox)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 11:10am UTC](https://discourse.julialang.org/t/module-scoping-and-macro-expansion/92914 "2023-01-21T11:10:56Z")

</div>

So I’ve been getting really confused with the interaction between nested macro expansion and module scoping… In my module MyModel I have a set of macros with which I implement a simple DSL. Things work fine in this simp…

---

## [Syntax Surprises](https://discourse.julialang.org/t/syntax-surprises/92369)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 83\
**Last updated:** [January 21, 2023, 9:45am UTC](https://discourse.julialang.org/t/syntax-surprises/92369 "2023-01-21T09:45:59Z")

</div>

A fun one for the new year :wink: One of the things I really like about Julia is being able to write code how I like (and the surprisingly large number of language decisions I find myself loving). The syntax is natural,…

---

## [Struct with different-sized tuple field](https://discourse.julialang.org/t/struct-with-different-sized-tuple-field/93282)

<div class="topic-metadata">

**Author:** [@Ronan\_Gautier](https://discourse.julialang.org/u/Ronan_Gautier)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 8:04am UTC](https://discourse.julialang.org/t/struct-with-different-sized-tuple-field/93282 "2023-01-21T08:04:49Z")

</div>

What is the proper way to define a structure that would look like struct mystruct n::Int values::NTuple(n, Int) end This does not work and I get the error ERROR: UndefVarError: n not defined. In my case, it is req…

---

## [Strange results with slurping](https://discourse.julialang.org/t/strange-results-with-slurping/93273)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 6\
**Last updated:** [January 20, 2023, 10:34pm UTC](https://discourse.julialang.org/t/strange-results-with-slurping/93273 "2023-01-20T22:34:47Z")

</div>

Here is a simple example that demonstrates that the ... list expansion operator can exhibit strange behavior. Consider: function tst(args...) @show args end arg1 = (a=3, b=4) arg2 = (c=5, d=7) arg3 = (c=5, f=7) ts…

---

## [Link Project.toml files (or make /test/Prokect.toml depend on main package one)](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [January 21, 2023, 12:00am UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223 "2023-01-21T00:00:33Z")

</div>

I have a julia project that has a Project.toml file setting its dependencies. It also have a set of tests, for which I have a Project.toml file setting some additional dependencies that are needed for the tests only (lik…

---

## [Working with 2 versions of julia with the same packages installed](https://discourse.julialang.org/t/working-with-2-versions-of-julia-with-the-same-packages-installed/93261)

<div class="topic-metadata">

**Author:** [@Abdou](https://discourse.julialang.org/u/Abdou)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 9:16pm UTC](https://discourse.julialang.org/t/working-with-2-versions-of-julia-with-the-same-packages-installed/93261 "2023-01-20T21:16:17Z")

</div>

I want packages installed for preinstalled version 1.6.7 of Julia to work for newlly installed 1.8.5 version without new installation of these packages. Is that possible and what to do ? thanks for contributions.

---

## [Pkg update stuck at 100%](https://discourse.julialang.org/t/pkg-update-stuck-at-100/93283)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 3\
**Last updated:** [January 20, 2023, 8:57pm UTC](https://discourse.julialang.org/t/pkg-update-stuck-at-100/93283 "2023-01-20T20:57:43Z")

</div>

I also got hit by this problem on Linux with Julia 1.8.5 (except that package update hangs at 100% rather than 99.9%…). I’ve updated the thread with the solution (Pkg.update in Julia 1.5 uses github - #5 by pierre-haess…

---

## [Pkg fetching takes very long at 99.9% @ v1.6 (Win 10)](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 16\
**Last updated:** [February 21, 2022, 4:24pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499 "2022-02-21T16:24:59Z")

</div>

Should this be reported as a bug or is it to be expected with RC?

---

## [Return type of powermod is always a Union?](https://discourse.julialang.org/t/return-type-of-powermod-is-always-a-union/93278)

<div class="topic-metadata">

**Author:** [@gtgt](https://discourse.julialang.org/u/gtgt)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 8:19pm UTC](https://discourse.julialang.org/t/return-type-of-powermod-is-always-a-union/93278 "2023-01-20T20:19:20Z")

</div>

Why is the return type of powermod always a Union{Int64, Int128, BigInt}? As a consequence the following simple code is type-unstable: julia\> function f(a, b, c) a = powermod(a, b, c) a % 2 - a …

---

## [Strange behavior of saveat (MWE)](https://discourse.julialang.org/t/strange-behavior-of-saveat-mwe/93272)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 6:48pm UTC](https://discourse.julialang.org/t/strange-behavior-of-saveat-mwe/93272 "2023-01-20T18:48:30Z")

</div>

I am trying to put save related arguments in a namedtuple. Here is my experiment. using DifferentialEquations function exponen!(du, u, param, t) du\[1\] = -u\[1\] end prob = ODEProblem(exponen!, \[2.\], tspan) # This works…

---

## [Use of caveat in common solve](https://discourse.julialang.org/t/use-of-caveat-in-common-solve/93243)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 5:21pm UTC](https://discourse.julialang.org/t/use-of-caveat-in-common-solve/93243 "2023-01-20T17:21:42Z")

</div>

@ChrisRackauckas, I get the error message: ┌ Warning: Endpoints do not match. Return code: Success. Likely your time range is not a multiple of \`saveat\`. sol.t\[end\]: 75.398224, ts\[end\]: 0.0 because I am using saveat a…

---

## [CPU address error with qr function](https://discourse.julialang.org/t/cpu-address-error-with-qr-function/93234)

<div class="topic-metadata">

**Author:** [@Eveee](https://discourse.julialang.org/u/Eveee)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 3:11pm UTC](https://discourse.julialang.org/t/cpu-address-error-with-qr-function/93234 "2023-01-20T15:11:02Z")

</div>

Hi all, I am puzzled by an error I am getting when using the qr function on CUDA. The following code works fine: a=CUDA.randn(3,3) q=qr(a).Q q \* a However, the following line does not: a \* q It results in this erro…

---

## [How do I stop Warning: Endpoints do not match. Return code: Terminated. Likely your time range is not a multiple of saveat](https://discourse.julialang.org/t/how-do-i-stop-warning-endpoints-do-not-match-return-code-terminated-likely-your-time-range-is-not-a-multiple-of-saveat/77523)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 2:27pm UTC](https://discourse.julialang.org/t/how-do-i-stop-warning-endpoints-do-not-match-return-code-terminated-likely-your-time-range-is-not-a-multiple-of-saveat/77523 "2023-01-20T14:27:32Z")

</div>

I am running a sciml\_train on a differential equation with a neural network embedded in it. In the differential equation I employee a callback to terminate the simulation when the trajectories are at their closest point…

---

## [StaticCompiler: Debugging and calling basic math functions](https://discourse.julialang.org/t/staticcompiler-debugging-and-calling-basic-math-functions/93219)

<div class="topic-metadata">

**Author:** [@wave\_and\_matter](https://discourse.julialang.org/u/wave_and_matter)\
**Replies:** 12\
**Last updated:** [January 20, 2023, 2:05pm UTC](https://discourse.julialang.org/t/staticcompiler-debugging-and-calling-basic-math-functions/93219 "2023-01-20T14:05:17Z")

</div>

I am relatively new to julia, but already managed to speed up a piece of code by factors of 2 to 5 compared to my numpy version. Now i need to deploy this code as a shared library on a cluster in a corporate environment…

---

## [Type() vs type() -- Are constructor methods or conversion functions more idiomatic?](https://discourse.julialang.org/t/type-vs-type-are-constructor-methods-or-conversion-functions-more-idiomatic/93233)

<div class="topic-metadata">

**Author:** [@SortofDamocles](https://discourse.julialang.org/u/SortofDamocles)\
**Replies:** 4\
**Last updated:** [January 20, 2023, 10:17am UTC](https://discourse.julialang.org/t/type-vs-type-are-constructor-methods-or-conversion-functions-more-idiomatic/93233 "2023-01-20T10:17:55Z")

</div>

I am writing some code with structs that represent dual forms of the same underlying thing, e.g. struct NormalForm normal\_data descriptive\_parameter end NormalForm(data) = NormalForm(data, process(data)) struct…

---

## [How to create Latex pdf directly from julia](https://discourse.julialang.org/t/how-to-create-latex-pdf-directly-from-julia/93222)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 3\
**Last updated:** [January 20, 2023, 1:42pm UTC](https://discourse.julialang.org/t/how-to-create-latex-pdf-directly-from-julia/93222 "2023-01-20T13:42:43Z")

</div>

Hi. I want to create Latex pdf from julia to make report. Is there any nice way to do so ? I could not find good package. can Latexify.jl create Latex pdf similiar to actual Latex software ?

---

## [How to increase a scrolling speed in Makie menu](https://discourse.julialang.org/t/how-to-increase-a-scrolling-speed-in-makie-menu/93221)

<div class="topic-metadata">

**Author:** [@vladdez](https://discourse.julialang.org/u/vladdez)\
**Replies:** 3\
**Last updated:** [January 20, 2023, 1:40pm UTC](https://discourse.julialang.org/t/how-to-increase-a-scrolling-speed-in-makie-menu/93221 "2023-01-20T13:40:49Z")

</div>

I am using Makie’s menu with 30 items. However, the scrolling speed is annoyingly slow: I have to scroll 5 times with the mouse wheel just to move up one item. Is there a way to change this?

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

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