# General Usage

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

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

**Page:** 275

---

## [How to get value of ticks?](https://discourse.julialang.org/t/how-to-get-value-of-ticks/100938)

<div class="topic-metadata">

**Author:** [@panbroggi](https://discourse.julialang.org/u/panbroggi)\
**Replies:** 2\
**Last updated:** [June 29, 2023, 6:44am UTC](https://discourse.julialang.org/t/how-to-get-value-of-ticks/100938 "2023-06-29T06:44:13Z")

</div>

Hi everyone, I am trying to get the value of the ticks in a plot, but they appear to change before showing the plot. The function prints Float32\[0, 5, 10\] while the actual ticks are \[0; 0.5; 1.0\]. using GLMakie fig, a…

---

## [The applicable method may be too new: running in world age 32335, while current world is 32342](https://discourse.julialang.org/t/the-applicable-method-may-be-too-new-running-in-world-age-32335-while-current-world-is-32342/100949)

<div class="topic-metadata">

**Author:** [@parssh](https://discourse.julialang.org/u/parssh)\
**Replies:** 4\
**Last updated:** [June 29, 2023, 3:59am UTC](https://discourse.julialang.org/t/the-applicable-method-may-be-too-new-running-in-world-age-32335-while-current-world-is-32342/100949 "2023-06-29T03:59:01Z")

</div>

Hi, Can you help me fix this, I am trying to run this as a loop for 10 fits (not showing the whole loop code). But currently I am failing on just one loop itself. The inspect function (only within Pumas Package) fails t…

---

## [BSON.load(filename,@\_\_MODULE\_\_) doesn't work inside a Test Module](https://discourse.julialang.org/t/bson-load-filename-module-doesnt-work-inside-a-test-module/100955)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 0\
**Last updated:** [June 29, 2023, 12:41am UTC](https://discourse.julialang.org/t/bson-load-filename-module-doesnt-work-inside-a-test-module/100955 "2023-06-29T00:41:18Z")

</div>

I have a Module. Inside that module I have a BSON.@save and a BSON.load which takes care of saving a struct to and from disk. The function that calls the BSON.load(filename,@MODULE) works fine if called by REPL/Main, o…

---

## [Timed wait for key press](https://discourse.julialang.org/t/timed-wait-for-key-press/100856)

<div class="topic-metadata">

**Author:** [@Jim](https://discourse.julialang.org/u/Jim)\
**Replies:** 14\
**Last updated:** [June 28, 2023, 5:36pm UTC](https://discourse.julialang.org/t/timed-wait-for-key-press/100856 "2023-06-28T17:36:26Z")

</div>

I am new to Julia but I can’t seem to find out how to do this… I want a function that allows an input of number of seconds to wait for a key to be pressed, if zero it returns the next key pressed in the buffer. Then it …

---

## [Creating AD-friendly functions](https://discourse.julialang.org/t/creating-ad-friendly-functions/100914)

<div class="topic-metadata">

**Author:** [@Bizzi](https://discourse.julialang.org/u/Bizzi)\
**Replies:** 2\
**Last updated:** [June 28, 2023, 3:16pm UTC](https://discourse.julialang.org/t/creating-ad-friendly-functions/100914 "2023-06-28T15:16:26Z")

</div>

Hello everyone. I’m in the process of creating a chained composition of functions, similar to a Flux or Lux network, which I’ll later differentiate for the purpose of solving differential equations. Following the discus…

---

## [General comments on my code for filling a matrix](https://discourse.julialang.org/t/general-comments-on-my-code-for-filling-a-matrix/100913)

<div class="topic-metadata">

**Author:** [@Zerosum](https://discourse.julialang.org/u/Zerosum)\
**Replies:** 4\
**Last updated:** [June 28, 2023, 6:15am UTC](https://discourse.julialang.org/t/general-comments-on-my-code-for-filling-a-matrix/100913 "2023-06-28T06:15:58Z")

</div>

I wondered if I could get comments on my code. I’ve reviewed the official performance tips and a few blogs discussing achieving high performance. Unfortunately, since I have a very scant knowledge of computation and mem…

---

## [Struct with block of missing fields](https://discourse.julialang.org/t/struct-with-block-of-missing-fields/100869)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 9\
**Last updated:** [June 27, 2023, 10:17pm UTC](https://discourse.julialang.org/t/struct-with-block-of-missing-fields/100869 "2023-06-27T22:17:53Z")

</div>

I’d like to have a struct like this. @with\_kw struct my\_struct x; y; z a b=fb(a) c=fc(b) d=fd(c) e=fe(d) f=ff(e) g=fg(f) h=fh(g) i=fi(h) end That can be created in two ways …

---

## [Changing array inside mutable struct passed to function, how to improve performance?](https://discourse.julialang.org/t/changing-array-inside-mutable-struct-passed-to-function-how-to-improve-performance/100862)

<div class="topic-metadata">

**Author:** [@ordep](https://discourse.julialang.org/u/ordep)\
**Replies:** 15\
**Last updated:** [June 27, 2023, 7:26pm UTC](https://discourse.julialang.org/t/changing-array-inside-mutable-struct-passed-to-function-how-to-improve-performance/100862 "2023-06-27T19:26:24Z")

</div>

I am creating a simulator, and to avoid passing on several different arrays (with different datatypes) to other functions that will apend values to them, i was thinking about grouping the arrays inside a mutable struct, …

---

## [Why is the matrix multiplication with integer matrices much slower than with float ones?](https://discourse.julialang.org/t/why-is-the-matrix-multiplication-with-integer-matrices-much-slower-than-with-float-ones/100898)

<div class="topic-metadata">

**Author:** [@DY\_K](https://discourse.julialang.org/u/DY_K)\
**Replies:** 6\
**Last updated:** [June 27, 2023, 6:02pm UTC](https://discourse.julialang.org/t/why-is-the-matrix-multiplication-with-integer-matrices-much-slower-than-with-float-ones/100898 "2023-06-27T18:02:25Z")

</div>

The following is the simple function for the test. function vec\_prod(n) output = 0; vec = collect(1:n) mat = Array{Float64}(undef, n, n) mat .= vec .\* vec' matt1 = mat .\* mat matt2 = mat \* mat output = dot(matt1, …

---

## [Is 1.9 great or what?](https://discourse.julialang.org/t/is-1-9-great-or-what/100664)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 16\
**Last updated:** [June 27, 2023, 5:51pm UTC](https://discourse.julialang.org/t/is-1-9-great-or-what/100664 "2023-06-27T17:51:03Z")

</div>

Great! Not or what. TTFP is essentially instant. And many other great improvements. So much work has been done over so many releases, so with no disrespect to those release I will say that 1.9 is the best since 1.0. A…

---

## [Use a,b = (1,2) within struc definition?](https://discourse.julialang.org/t/use-a-b-1-2-within-struc-definition/100873)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 6\
**Last updated:** [June 27, 2023, 3:56pm UTC](https://discourse.julialang.org/t/use-a-b-1-2-within-struc-definition/100873 "2023-06-27T15:56:56Z")

</div>

Is there any way to do something like @with\_kw struct my\_struct a,b = (1,2) end Use a,b = (1,2) syntax within a struct definition.

---

## [R JuliaCall erroring during setup with Julia v1.9](https://discourse.julialang.org/t/r-juliacall-erroring-during-setup-with-julia-v1-9/100890)

<div class="topic-metadata">

**Author:** [@Faraz564](https://discourse.julialang.org/u/Faraz564)\
**Replies:** 6\
**Last updated:** [June 27, 2023, 2:34pm UTC](https://discourse.julialang.org/t/r-juliacall-erroring-during-setup-with-julia-v1-9/100890 "2023-06-27T14:34:31Z")

</div>

Would someone help me. My setup is giving error julia\_setup(installJulia = TRUE)

---

## [Migrate private registry to new server using LocalRegistry.jl](https://discourse.julialang.org/t/migrate-private-registry-to-new-server-using-localregistry-jl/100859)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [June 27, 2023, 11:35am UTC](https://discourse.julialang.org/t/migrate-private-registry-to-new-server-using-localregistry-jl/100859 "2023-06-27T11:35:48Z")

</div>

Hi, I am using LocalRegistry.jl to manage a private package ecosystem. I need to move the registry and package ecosystem to a new server. How to I ensure that the registry and projects using the registry and package eco…

---

## [Advanced tricks to reduce memory allocations of ODE](https://discourse.julialang.org/t/advanced-tricks-to-reduce-memory-allocations-of-ode/100841)

<div class="topic-metadata">

**Author:** [@JordiBolibar](https://discourse.julialang.org/u/JordiBolibar)\
**Replies:** 7\
**Last updated:** [June 27, 2023, 11:19am UTC](https://discourse.julialang.org/t/advanced-tricks-to-reduce-memory-allocations-of-ode/100841 "2023-06-27T11:19:47Z")

</div>

Hello, I’m trying to further reduce memory allocations when solving an ODE using DifferentialEquations.jl. I have already implemented most of the tricks I’m aware of, but I still get a ton of memory allocation when call…

---

## [Generation of plots in julia](https://discourse.julialang.org/t/generation-of-plots-in-julia/100877)

<div class="topic-metadata">

**Author:** [@Harsh00100](https://discourse.julialang.org/u/Harsh00100)\
**Replies:** 5\
**Last updated:** [June 27, 2023, 10:27am UTC](https://discourse.julialang.org/t/generation-of-plots-in-julia/100877 "2023-06-27T10:27:11Z")

</div>

whenever i am trying to generate a plot, the plot is able to generate but its not popping/showing up attached below is an example. kindly help me out as i am new to julia julia\> fig, (ax1,ax2) = plt.subplots(ncols = 2…

---

## [Convert to string without losing the colon character for Symbol variables](https://discourse.julialang.org/t/convert-to-string-without-losing-the-colon-character-for-symbol-variables/100803)

<div class="topic-metadata">

**Author:** [@David\_Sagan](https://discourse.julialang.org/u/David_Sagan)\
**Replies:** 12\
**Last updated:** [June 27, 2023, 9:49am UTC](https://discourse.julialang.org/t/convert-to-string-without-losing-the-colon-character-for-symbol-variables/100803 "2023-06-27T09:49:49Z")

</div>

If I convert a Symbol to a string, the colon that is used to signify that it is a symbol is lost. For example, julia\> a = :abc :abc julia\> string(a) # String does not have a colon "abc" I know I can create a very s…

---

## [Instability with union of types with ForwardDiff and KeyedArray types, hints](https://discourse.julialang.org/t/instability-with-union-of-types-with-forwarddiff-and-keyedarray-types-hints/100772)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 1\
**Last updated:** [June 27, 2023, 8:07am UTC](https://discourse.julialang.org/t/instability-with-union-of-types-with-forwarddiff-and-keyedarray-types-hints/100772 "2023-06-27T08:07:08Z")

</div>

The goal is to calculate a number between two Vector-ish things in a type stable manner, without type assertions. This is part of a larger workflow that involves ForwardDiff.gradient, which runs, but slow, hence the inqu…

---

## [How do I tell if an object is callable (a function-like object)?](https://discourse.julialang.org/t/how-do-i-tell-if-an-object-is-callable-a-function-like-object/100831)

<div class="topic-metadata">

**Author:** [@coldinjection](https://discourse.julialang.org/u/coldinjection)\
**Replies:** 15\
**Last updated:** [June 26, 2023, 9:34pm UTC](https://discourse.julialang.org/t/how-do-i-tell-if-an-object-is-callable-a-function-like-object/100831 "2023-06-26T21:34:49Z")

</div>

Say there’s a type T, how can I tell if function (t::T)()… is defined? Is there any way other than trying t() and catching a MethodError?

---

## [How to pass variable in macro returned run(\`$var\`)](https://discourse.julialang.org/t/how-to-pass-variable-in-macro-returned-run-var/100874)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 1\
**Last updated:** [June 27, 2023, 6:59am UTC](https://discourse.julialang.org/t/how-to-pass-variable-in-macro-returned-run-var/100874 "2023-06-27T06:59:25Z")

</div>

Hello, how to pass variable in macro returned run($var) macro foo(x) return esc(:(run(\`$x\`))) end @macroexpand @foo my\_command # -\> :(run(Base.cmd\_gen(((x,),)))) # i need @macroexpand @foo my\_command # -\> :(run…

---

## [Allocations when creating array](https://discourse.julialang.org/t/allocations-when-creating-array/100811)

<div class="topic-metadata">

**Author:** [@CarlosContrerasQ12](https://discourse.julialang.org/u/CarlosContrerasQ12)\
**Replies:** 16\
**Last updated:** [June 27, 2023, 1:46am UTC](https://discourse.julialang.org/t/allocations-when-creating-array/100811 "2023-06-27T01:46:17Z")

</div>

Hi! I have the following code trying to simulate 1000 dimensional brownian paths const type=Float32 function simulate\_path(path\_length) xis=randn(type,(100,path\_length-1)) X=zeros(type,(100,path\_length)) sqd…

---

## [Calling Julia from C: printing array of strings?](https://discourse.julialang.org/t/calling-julia-from-c-printing-array-of-strings/100716)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 10\
**Last updated:** [June 26, 2023, 8:29pm UTC](https://discourse.julialang.org/t/calling-julia-from-c-printing-array-of-strings/100716 "2023-06-26T20:29:03Z")

</div>

I’m aware that there are other, perhaps better, ways of doing this - but I’m trying to broaden my understanding of how the various pieces work. I have a C program that contains an array of strings, and I’d like to print…

---

## [Lock() and do-block syntax](https://discourse.julialang.org/t/lock-and-do-block-syntax/100854)

<div class="topic-metadata">

**Author:** [@algunion](https://discourse.julialang.org/u/algunion)\
**Replies:** 5\
**Last updated:** [June 26, 2023, 7:29pm UTC](https://discourse.julialang.org/t/lock-and-do-block-syntax/100854 "2023-06-26T19:29:22Z")

</div>

I recently stumbled upon a combination of lock and do - similar to open and do. lock(x.lock) do # do something unsafe here end It is unclear that the do-block syntax automatically calls unlock after the work i…

---

## [Embedding Julia: reading std::vector from C++?](https://discourse.julialang.org/t/embedding-julia-reading-std-vector-from-c/100857)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 1\
**Last updated:** [June 26, 2023, 7:31pm UTC](https://discourse.julialang.org/t/embedding-julia-reading-std-vector-from-c/100857 "2023-06-26T19:31:43Z")

</div>

I’m aware of existing … packages for wrapping C++, this is really more of a learning exercise for me (and I’m trying to learn enough to read what is in the existing pacages). I knew that it was possible to get C++ to giv…

---

## [Help With Automatic Differentiation](https://discourse.julialang.org/t/help-with-automatic-differentiation/100844)

<div class="topic-metadata">

**Author:** [@Devetak](https://discourse.julialang.org/u/Devetak)\
**Replies:** 8\
**Last updated:** [June 26, 2023, 7:12pm UTC](https://discourse.julialang.org/t/help-with-automatic-differentiation/100844 "2023-06-26T19:12:03Z")

</div>

Good afternoon, I wanted to ask some advice about Automatic Differentiation in Julia. I am aware of the fact that in AD mutating arrays are not supported, but I find it difficult to write my code in a non mutating fashi…

---

## [JuliaCall: Can I use python functions as paratemeters to julia functions?](https://discourse.julialang.org/t/juliacall-can-i-use-python-functions-as-paratemeters-to-julia-functions/100853)

<div class="topic-metadata">

**Author:** [@CarlosContrerasQ12](https://discourse.julialang.org/u/CarlosContrerasQ12)\
**Replies:** 0\
**Last updated:** [June 26, 2023, 5:51pm UTC](https://discourse.julialang.org/t/juliacall-can-i-use-python-functions-as-paratemeters-to-julia-functions/100853 "2023-06-26T17:51:23Z")

</div>

Hi! I need to do something like this in my workflow from juliacall import Main as jl import numpy as np jl.seval(""" function rs() return randn((19,10)) end """) jl.seval(""" function ml(x,f) return exp(f(x)) end """) s…

---

## [Can Meshes.jl do boolean operations?](https://discourse.julialang.org/t/can-meshes-jl-do-boolean-operations/100808)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 1\
**Last updated:** [June 26, 2023, 5:48pm UTC](https://discourse.julialang.org/t/can-meshes-jl-do-boolean-operations/100808 "2023-06-26T17:48:11Z")

</div>

Hello! I would just like to know from someone more experienced if this operation is possible: To the left I have a cube. To the right I have the cube cut by an arbitrary plane, black. Any example of how to do this …

---

## [What is a "shared environment"? When should I use a "shared environment"?](https://discourse.julialang.org/t/what-is-a-shared-environment-when-should-i-use-a-shared-environment/100828)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 14\
**Last updated:** [June 26, 2023, 3:00pm UTC](https://discourse.julialang.org/t/what-is-a-shared-environment-when-should-i-use-a-shared-environment/100828 "2023-06-26T15:00:33Z")

</div>

4. Working with Environment · Pkg.jl (julialang.org): A “shared” environment is simply an environment that exists in ~/.julia/environments . The default v1.8 environment is therefore a shared environment. Shared envir…

---

## [Rotating a plane using Meshes.jl](https://discourse.julialang.org/t/rotating-a-plane-using-meshes-jl/100795)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [June 26, 2023, 11:26am UTC](https://discourse.julialang.org/t/rotating-a-plane-using-meshes-jl/100795 "2023-06-26T11:26:34Z")

</div>

In Meshes.jl, if I define a plane such as: using Meshes BP = Plane((0,0,0),(0,0,1)) In which (0,0,1) is the normal vector of the plane. How would I apply a rotation to the plane, such that the normal vector would be (…

---

## [Create Hayshed in 3D with Inverted Catenary, Need Help with Modify the x and y ticks](https://discourse.julialang.org/t/create-hayshed-in-3d-with-inverted-catenary-need-help-with-modify-the-x-and-y-ticks/100807)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [June 26, 2023, 2:10pm UTC](https://discourse.julialang.org/t/create-hayshed-in-3d-with-inverted-catenary-need-help-with-modify-the-x-and-y-ticks/100807 "2023-06-26T14:10:22Z")

</div>

I am using Plotlyjs here, gr() can also be used, but can’t be rotated. I want to create a hayshed that will look like this: I have come up with this code: # Inverted catenary using Plots; #gr() plotlyjs() # a larg…

---

## [Control stack trace verbosity](https://discourse.julialang.org/t/control-stack-trace-verbosity/77695)

<div class="topic-metadata">

**Author:** [@JordiBolibar](https://discourse.julialang.org/u/JordiBolibar)\
**Replies:** 5\
**Last updated:** [June 26, 2023, 2:08pm UTC](https://discourse.julialang.org/t/control-stack-trace-verbosity/77695 "2023-06-26T14:08:46Z")

</div>

After some time working with Julia I’ve gotten used to the stack trace and the huge amount of information it provides. Nonetheless, I still keep wondering if it would be possible to have some control over what is display…

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

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