# General Usage

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

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

**Page:** 502

---

## [How to use .png files with Documenter.jl](https://discourse.julialang.org/t/how-to-use-png-files-with-documenter-jl/73863)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [December 31, 2021, 3:56pm UTC](https://discourse.julialang.org/t/how-to-use-png-files-with-documenter-jl/73863 "2021-12-31T15:56:43Z")

</div>

I wrote a package and added documentation using Documenter.jl , see: Home · KitePodSimulator.jl This works all fine, but the .png image that I embedded in the index.md file does not show up on the internet, it does show…

---

## [Database tools?](https://discourse.julialang.org/t/database-tools/73860)

<div class="topic-metadata">

**Author:** [@skypuppy](https://discourse.julialang.org/u/skypuppy)\
**Replies:** 0\
**Last updated:** [December 31, 2021, 12:07pm UTC](https://discourse.julialang.org/t/database-tools/73860 "2021-12-31T12:07:23Z")

</div>

Do we have a library that includes database type functions? Add record, delete record, create index, that sort of thing? If nothing else, maybe even SQL (which I hate?) :slight\_smile: I don’t really know how to searc…

---

## [Stack trace](https://discourse.julialang.org/t/stack-trace/73439)

<div class="topic-metadata">

**Author:** [@Laco\_Kovac](https://discourse.julialang.org/u/Laco_Kovac)\
**Replies:** 1\
**Last updated:** [December 31, 2021, 11:29am UTC](https://discourse.julialang.org/t/stack-trace/73439 "2021-12-31T11:29:41Z")

</div>

I am using 2 functions related to stack to help me with debugging. getExcInfo function getExcInfo(someText=nothing)::String msg::String = "" for (exc, bt) in Base.catch\_stack() # for now, we process on…

---

## [Concrete typing for Type{T} struct fields](https://discourse.julialang.org/t/concrete-typing-for-type-t-struct-fields/73825)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 4\
**Last updated:** [December 31, 2021, 10:03am UTC](https://discourse.julialang.org/t/concrete-typing-for-type-t-struct-fields/73825 "2021-12-31T10:03:16Z")

</div>

Dear all, I would like to create a struct that holds a subtype of Real, which I want to use later on to create buffer arrays. I managed to do that in the MWE below, but it seems like the corresponding struct is not a co…

---

## [Outer constructor with default parameters](https://discourse.julialang.org/t/outer-constructor-with-default-parameters/73853)

<div class="topic-metadata">

**Author:** [@jafar.isbarov](https://discourse.julialang.org/u/jafar.isbarov)\
**Replies:** 1\
**Last updated:** [December 31, 2021, 9:01am UTC](https://discourse.julialang.org/t/outer-constructor-with-default-parameters/73853 "2021-12-31T09:01:28Z")

</div>

I am trying to define an outer constructor for this struct: @with\_kw struct Hijri year::Int64 month::Int64 day::Int64 validate::Bool #TODO: should be able to initialize a Hijri with giving this parameter end Here i…

---

## [Transducer Filtering with Regex?](https://discourse.julialang.org/t/transducer-filtering-with-regex/52441)

<div class="topic-metadata">

**Author:** [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Replies:** 0\
**Last updated:** [December 27, 2020, 4:26am UTC](https://discourse.julialang.org/t/transducer-filtering-with-regex/52441 "2020-12-27T04:26:39Z")

</div>

Hi, I have several cases where I need just the first few elements that match a condition. With transducers, I can do something like big\_array |\> Filter(expensive\_filter) |\> Map(expensive\_transformation) |\> Take(5) |\> c…

---

## [St PKG\_NAME does not show version for some packages](https://discourse.julialang.org/t/st-pkg-name-does-not-show-version-for-some-packages/73841)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 1\
**Last updated:** [December 30, 2021, 10:59pm UTC](https://discourse.julialang.org/t/st-pkg-name-does-not-show-version-for-some-packages/73841 "2021-12-30T22:59:48Z")

</div>

To check the version of an installed package, I do pkg\> st PKG\_NAME. For example, (@v1.7) pkg\> st BenchmarkTools Status \`~/.julia/environments/v1.7/Project.toml\` \[6e4b80f9\] BenchmarkTools v1.2.0 shows that the…

---

## [Random crashes with Julia 1.7](https://discourse.julialang.org/t/random-crashes-with-julia-1-7/73821)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [December 30, 2021, 10:05pm UTC](https://discourse.julialang.org/t/random-crashes-with-julia-1-7/73821 "2021-12-30T22:05:41Z")

</div>

I have an application (https://github.com/ufechner7/KiteViewer), which works fine with Julia 1.6.5, but sometimes crashes when using Julia 1.7.0 or 1.7.1. When I click on the “PLAY” button I get crash reports like: ufec…

---

## [Is this @sprintf (annoying) behaviour intended?](https://discourse.julialang.org/t/is-this-sprintf-annoying-behaviour-intended/68483)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 8\
**Last updated:** [December 30, 2021, 10:02pm UTC](https://discourse.julialang.org/t/is-this-sprintf-annoying-behaviour-intended/68483 "2021-12-30T22:02:12Z")

</div>

The crux is that I want to build a string programmatically with a variable number of elements and can’t find a way to do it with @sprintf julia\> bnds = \[1,2,3\]; julia\> @sprintf("%d,%d,%d,",bnds...) "1,2,3," julia\> repe…

---

## [Inversion and multiplication of sparse matrices](https://discourse.julialang.org/t/inversion-and-multiplication-of-sparse-matrices/73819)

<div class="topic-metadata">

**Author:** [@Rajesh\_Nakka](https://discourse.julialang.org/u/Rajesh_Nakka)\
**Replies:** 7\
**Last updated:** [December 30, 2021, 9:52pm UTC](https://discourse.julialang.org/t/inversion-and-multiplication-of-sparse-matrices/73819 "2021-12-30T21:52:21Z")

</div>

I have encountered a problem of the following kind. C = A^-1 \* B where A is a very large nxn sparse banded symmetric matrix (of SparseMatrixCSC type) and B is nx5 matrix. I have read on this forum and somewhere else…

---

## [Efficient iterated discrete dynamics in Flux](https://discourse.julialang.org/t/efficient-iterated-discrete-dynamics-in-flux/73837)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 0\
**Last updated:** [December 30, 2021, 9:16pm UTC](https://discourse.julialang.org/t/efficient-iterated-discrete-dynamics-in-flux/73837 "2021-12-30T21:16:04Z")

</div>

I’m trying to implement a Koopman operator layer in Flux. This is the operation of starting with a vector, x, and iteratively multiplying it by a dynamics matrix, K, for n steps, e.g. x1 = x x2 = K \* x1 x3 = K \* x2 e…

---

## [Why .Threads?](https://discourse.julialang.org/t/why-threads/73832)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [December 30, 2021, 7:58pm UTC](https://discourse.julialang.org/t/why-threads/73832 "2021-12-30T19:58:59Z")

</div>

julia\> using .Threads julia\> Threads Base.Threads Modules docs says A relative module qualifier starts with a period (.), which corresponds to the current module, and each successive . leads to the parent of the curr…

---

## [Revise 3.3 has problems tracking changed files?](https://discourse.julialang.org/t/revise-3-3-has-problems-tracking-changed-files/73820)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 4\
**Last updated:** [December 30, 2021, 5:00pm UTC](https://discourse.julialang.org/t/revise-3-3-has-problems-tracking-changed-files/73820 "2021-12-30T17:00:46Z")

</div>

I use Revise v3.3.0, recently updated from 3.2.1. It seems to me that it is now broken in that it does not track changed files anymore. Has anyone else seen it? Edit: Revise v3.2.1 works still correctly on the same se…

---

## [How to add captions in Makie?](https://discourse.julialang.org/t/how-to-add-captions-in-makie/73800)

<div class="topic-metadata">

**Author:** [@aachener](https://discourse.julialang.org/u/aachener)\
**Replies:** 11\
**Last updated:** [December 30, 2021, 4:02pm UTC](https://discourse.julialang.org/t/how-to-add-captions-in-makie/73800 "2021-12-30T16:02:39Z")

</div>

Hello guys, I am just wondering how to add captions to figures in Makie, as highlighted in the following picture in red? I tried annotations() and text() but the effect are not satisfactory. Maybe I used them in a wrong…

---

## [Defining functions with multiple methods inside a function](https://discourse.julialang.org/t/defining-functions-with-multiple-methods-inside-a-function/73768)

<div class="topic-metadata">

**Author:** [@croberts](https://discourse.julialang.org/u/croberts)\
**Replies:** 4\
**Last updated:** [December 30, 2021, 3:55pm UTC](https://discourse.julialang.org/t/defining-functions-with-multiple-methods-inside-a-function/73768 "2021-12-30T15:55:24Z")

</div>

I am writing a data type that is, essentially, a wrapper for a function, which will be accessed as a functor, but the arguments for the outside struct constructor determine the nature of the function. (As an irrelevant …

---

## [Custom printing of struct?](https://discourse.julialang.org/t/custom-printing-of-struct/73812)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 4\
**Last updated:** [December 30, 2021, 3:30pm UTC](https://discourse.julialang.org/t/custom-printing-of-struct/73812 "2021-12-30T15:30:28Z")

</div>

If I have a struct with some arbitrary values, how can I make a function, such that when I call “print” or “println” it will print the struct in the way I define? Kind regards

---

## [Trigonometric functions do not use SIMD - Solved: use LoopVectorization.jl](https://discourse.julialang.org/t/trigonometric-functions-do-not-use-simd-solved-use-loopvectorization-jl/48722)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 9\
**Last updated:** [December 30, 2021, 3:29pm UTC](https://discourse.julialang.org/t/trigonometric-functions-do-not-use-simd-solved-use-loopvectorization-jl/48722 "2021-12-30T15:29:22Z")

</div>

I noticed that computations with trigonometric functions cannot use SIMD. Is this a nature of trigonometric functions? I would like to learn more details. My test code is as follows: function two\_mul(out, a1, a2) @…

---

## [Can we use sine and cosine on a matrix of any dimension that needed not to be a square matrix?](https://discourse.julialang.org/t/can-we-use-sine-and-cosine-on-a-matrix-of-any-dimension-that-needed-not-to-be-a-square-matrix/73813)

<div class="topic-metadata">

**Author:** [@Shivam\_Jha](https://discourse.julialang.org/u/Shivam_Jha)\
**Replies:** 1\
**Last updated:** [December 30, 2021, 11:44am UTC](https://discourse.julialang.org/t/can-we-use-sine-and-cosine-on-a-matrix-of-any-dimension-that-needed-not-to-be-a-square-matrix/73813 "2021-12-30T11:44:21Z")

</div>

" A=rand(2,3) cos(A) #will create error " what is the alternative to this

---

## [How to get values of dictionary by using array of keys?](https://discourse.julialang.org/t/how-to-get-values-of-dictionary-by-using-array-of-keys/73650)

<div class="topic-metadata">

**Author:** [@rmsmsgood](https://discourse.julialang.org/u/rmsmsgood)\
**Replies:** 16\
**Last updated:** [December 30, 2021, 10:42am UTC](https://discourse.julialang.org/t/how-to-get-values-of-dictionary-by-using-array-of-keys/73650 "2021-12-30T10:42:22Z")

</div>

I want access to dictionary with vector, or array. If it possible natively, i want like below code: julia\> foo = Dict("Ac" =\> 4, "B" =\> 1, "d" =\> 2) Dict{String, Int64} with 3 entries: "B" =\> 1 "Ac" =\> 4 "d" =\> …

---

## [Center equation consisting of LaTeX and Julia in Pluto markdown](https://discourse.julialang.org/t/center-equation-consisting-of-latex-and-julia-in-pluto-markdown/73758)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 3\
**Last updated:** [December 30, 2021, 9:53am UTC](https://discourse.julialang.org/t/center-equation-consisting-of-latex-and-julia-in-pluto-markdown/73758 "2021-12-30T09:53:04Z")

</div>

Hi all, I am trying to center align an equation in Pluto. Here is a MWE: md" $\\theta =$ $(string(round.(rand(3), digits = 3))) " The equation is left justified. I tried bringing in html to center it, but to no avail…

---

## [Gadfly plots came out really small in Pluto.jl](https://discourse.julialang.org/t/gadfly-plots-came-out-really-small-in-pluto-jl/73671)

<div class="topic-metadata">

**Author:** [@maxwindiff](https://discourse.julialang.org/u/maxwindiff)\
**Replies:** 2\
**Last updated:** [December 30, 2021, 3:46am UTC](https://discourse.julialang.org/t/gadfly-plots-came-out-really-small-in-pluto-jl/73671 "2021-12-30T03:46:02Z")

</div>

I’m trying out Gadfly in Pluto for the first time, and for some reason the plots came out really tiny. I tried fiddling with set\_default\_plot\_size(), but it only changes the size of the content, not the “viewport” in the…

---

## [Problem in plot when use RCall package](https://discourse.julialang.org/t/problem-in-plot-when-use-rcall-package/73798)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 2\
**Last updated:** [December 30, 2021, 3:27am UTC](https://discourse.julialang.org/t/problem-in-plot-when-use-rcall-package/73798 "2021-12-30T03:27:16Z")

</div>

This question is not necessarily a question related to the julia language, but rather to the RCall package. I don’t know if the problem is with RCall or jupyter notebook either. I need to use Julia and R on the same note…

---

## [Plots / GR cutting off y axis labels / needs more padding](https://discourse.julialang.org/t/plots-gr-cutting-off-y-axis-labels-needs-more-padding/73778)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 3\
**Last updated:** [December 30, 2021, 2:26am UTC](https://discourse.julialang.org/t/plots-gr-cutting-off-y-axis-labels-needs-more-padding/73778 "2021-12-30T02:26:53Z")

</div>

I’m plotting some data with StatsPlots and using savefig and winding up with something like this: On the lower plot the y axis label is “Mbps” but it doesn’t show up because it’s “off the screen” can anyone tell me h…

---

## [OpenCL status in Julia](https://discourse.julialang.org/t/opencl-status-in-julia/34442)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 18\
**Last updated:** [December 29, 2021, 11:50pm UTC](https://discourse.julialang.org/t/opencl-status-in-julia/34442 "2021-12-29T23:50:06Z")

</div>

Hi! I verified that I can greatly improve my satellite simulator if I use the GPU processing of some parts. It will be a huge change. Since I do not want to lock this feature for NVIDIA users only (I am Mac user, so no …

---

## [In python an object exposes an event but I can't get at it in PyCall](https://discourse.julialang.org/t/in-python-an-object-exposes-an-event-but-i-cant-get-at-it-in-pycall/73788)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 2\
**Last updated:** [December 29, 2021, 10:44pm UTC](https://discourse.julialang.org/t/in-python-an-object-exposes-an-event-but-i-cant-get-at-it-in-pycall/73788 "2021-12-29T22:44:17Z")

</div>

Hi there I am working my way through a python script and not sure how to progress. The python code looks like this def onBarUpdate(bars, hasNewBar): print( datetime.timestamp(bars\[-1\].time),"^ ", bars.contract.…

---

## [Two y-axes in AoG/Makie?](https://discourse.julialang.org/t/two-y-axes-in-aog-makie/73780)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 3\
**Last updated:** [December 29, 2021, 10:46pm UTC](https://discourse.julialang.org/t/two-y-axes-in-aog-makie/73780 "2021-12-29T22:46:23Z")

</div>

How can create a plot with two y-axes using AoG / Makie? I want to have two “marks” / geometries with different y-axes. Here is an example using VegaLite.jl. plt = @vlplot( data = data0, mark …

---

## [Actors.jl questions](https://discourse.julialang.org/t/actors-jl-questions/73794)

<div class="topic-metadata">

**Author:** [@jonoke](https://discourse.julialang.org/u/jonoke)\
**Replies:** 0\
**Last updated:** [December 29, 2021, 10:26pm UTC](https://discourse.julialang.org/t/actors-jl-questions/73794 "2021-12-29T22:26:48Z")

</div>

Hi, is there an Actors.jl or ActorsGroup email list - or is here the right place for questions? So, I’ve started looking at Actors.jl and discovered that all actors created by spawn go on the current thread. I see ther…

---

## [Mathematical fractions and calculate with percentages](https://discourse.julialang.org/t/mathematical-fractions-and-calculate-with-percentages/73786)

<div class="topic-metadata">

**Author:** [@MeteorBizone](https://discourse.julialang.org/u/MeteorBizone)\
**Replies:** 1\
**Last updated:** [December 29, 2021, 10:28pm UTC](https://discourse.julialang.org/t/mathematical-fractions-and-calculate-with-percentages/73786 "2021-12-29T22:28:06Z")

</div>

How to use mathematical fractions and calculate with percentages?

---

## [Julia 1.7 on M1 is Incredible?](https://discourse.julialang.org/t/julia-1-7-on-m1-is-incredible/73498)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 5\
**Last updated:** [December 29, 2021, 10:26pm UTC](https://discourse.julialang.org/t/julia-1-7-on-m1-is-incredible/73498 "2021-12-29T22:26:05Z")

</div>

I recently spent a day fixing performance bottlenecks from my group’s research code (not important I think but I’m referring to ACE.jl). I had some unexpected experiences and am hoping somebody will help me understand? I…

---

## [IJulia in 1.7 fails on Mac M1: Solved!](https://discourse.julialang.org/t/ijulia-in-1-7-fails-on-mac-m1-solved/72370)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 4\
**Last updated:** [December 29, 2021, 10:19pm UTC](https://discourse.julialang.org/t/ijulia-in-1-7-fails-on-mac-m1-solved/72370 "2021-12-29T22:19:26Z")

</div>

All fixed. Read @giordano’s post and my last one. Just installed 1.7 on M1 mac. Started from scratch with no .julia directory. Tried to fire up a notebook and got this julia\> notebook(;dir=pwd()) install Jupyter via C…

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

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