# General Usage

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

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

**Page:** 460

---

## [Tracing functions, inverse of Meta.parse?](https://discourse.julialang.org/t/tracing-functions-inverse-of-meta-parse/79705)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 1\
**Last updated:** [April 20, 2022, 12:03am UTC](https://discourse.julialang.org/t/tracing-functions-inverse-of-meta-parse/79705 "2022-04-20T00:03:28Z")

</div>

I’ve not found a function tracing facility for Julia so I’m trying to implement a simple one. My idea is to have a macro,@trace, that prefixes a method definition and alters that definition to start with a log message t…

---

## [Extract an \`AbstractVector{T}\` from an \`AbstractVector{T, Missing}\`](https://discourse.julialang.org/t/extract-an-abstractvector-t-from-an-abstractvector-t-missing/79698)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 3\
**Last updated:** [April 19, 2022, 6:00pm UTC](https://discourse.julialang.org/t/extract-an-abstractvector-t-from-an-abstractvector-t-missing/79698 "2022-04-19T18:00:46Z")

</div>

I know that a certain subset of the indices of an AbstractVector{T, Missing} are not missing. I want to efficiently manipulate that subset. How can I extract x::AbstractVector{T} from y::AbstractVector{T, Missing} such …

---

## [Use of findall with different conditions at the same time?](https://discourse.julialang.org/t/use-of-findall-with-different-conditions-at-the-same-time/79656)

<div class="topic-metadata">

**Author:** [@Alejandro\_Quiaro\_San](https://discourse.julialang.org/u/Alejandro_Quiaro_San)\
**Replies:** 11\
**Last updated:** [April 19, 2022, 4:15pm UTC](https://discourse.julialang.org/t/use-of-findall-with-different-conditions-at-the-same-time/79656 "2022-04-19T16:15:38Z")

</div>

Hi guys. I am trying to identify values on a matrix that are out of certain boundaries and extracting their positions within the matrix. I am using the function findall in the following way: The input Matrix is “mat” a…

---

## [Alternate ways to deal with arrays of subtypes of abstract type](https://discourse.julialang.org/t/alternate-ways-to-deal-with-arrays-of-subtypes-of-abstract-type/79689)

<div class="topic-metadata">

**Author:** [@NatMath](https://discourse.julialang.org/u/NatMath)\
**Replies:** 11\
**Last updated:** [April 19, 2022, 4:15pm UTC](https://discourse.julialang.org/t/alternate-ways-to-deal-with-arrays-of-subtypes-of-abstract-type/79689 "2022-04-19T16:15:20Z")

</div>

New to Julia here. I am currently working on a raymarching program which supports different types of primitives. I thus have a Primitive abstract type which has subtypes, for example Sphere and Box. For each primitive su…

---

## [JULIA\_DEBUG environment variable](https://discourse.julialang.org/t/julia-debug-environment-variable/73278)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 5\
**Last updated:** [April 19, 2022, 3:05pm UTC](https://discourse.julialang.org/t/julia-debug-environment-variable/73278 "2022-04-19T15:05:30Z")

</div>

I don’t understand how JULIA\_DEBUG environment variable works. module A foo() = @debug "foo" end A.foo() # nothing printed ENV\["JULIA\_DEBUG"\] = Main.A A.foo() # nothing printed Why nothing is printed there? However…

---

## [LinearAlgebra and TaylorSeries not interacting as expected](https://discourse.julialang.org/t/linearalgebra-and-taylorseries-not-interacting-as-expected/79679)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 2\
**Last updated:** [April 19, 2022, 12:26pm UTC](https://discourse.julialang.org/t/linearalgebra-and-taylorseries-not-interacting-as-expected/79679 "2022-04-19T12:26:09Z")

</div>

I just found out that some bizarre behaviour I was getting when using TaylorIntegration was due to my use of LinearAlgebra.norm in my equation of motion… Apparently, LinearAlgebra considers a Taylor1 (or TaylorN) object …

---

## [How can I tag a package?](https://discourse.julialang.org/t/how-can-i-tag-a-package/79678)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [April 19, 2022, 11:00am UTC](https://discourse.julialang.org/t/how-can-i-tag-a-package/79678 "2022-04-19T11:00:26Z")

</div>

On JuliaHub I can search for packages by “tag”. How can I add tags to my own packages?

---

## [Copying packages to ~/.julia, but they aren't found](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249)

<div class="topic-metadata">

**Author:** [@natemcintosh](https://discourse.julialang.org/u/natemcintosh)\
**Replies:** 9\
**Last updated:** [April 19, 2022, 5:22am UTC](https://discourse.julialang.org/t/copying-packages-to-julia-but-they-arent-found/16249 "2022-04-19T05:22:59Z")

</div>

I do a lot of work on an offline machine, and I’m trying to set up Julia on it. I already have Julia installed and working on that offline machine. As a first attempt at bringing in packages, I’ve copied and pasted all …

---

## [Get a picture icon when I try to plot a histogram](https://discourse.julialang.org/t/get-a-picture-icon-when-i-try-to-plot-a-histogram/79616)

<div class="topic-metadata">

**Author:** [@bproferes](https://discourse.julialang.org/u/bproferes)\
**Replies:** 4\
**Last updated:** [April 19, 2022, 1:58am UTC](https://discourse.julialang.org/t/get-a-picture-icon-when-i-try-to-plot-a-histogram/79616 "2022-04-19T01:58:59Z")

</div>

Hi, I’m trying to make a histogram but whenever I run the command in a jupyter notebook I get a picture icon. I’m using a mac laptop and maybe it is a general issue with the laptop I need to fix.

---

## [GMT.jl and VSCode](https://discourse.julialang.org/t/gmt-jl-and-vscode/76155)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 5\
**Last updated:** [April 18, 2022, 11:56pm UTC](https://discourse.julialang.org/t/gmt-jl-and-vscode/76155 "2022-04-18T23:56:50Z")

</div>

I’m having some issues between GMT and VSCode. (macOS Big Sur). Running the following in terminal works fine. I get the image in a new window. using GMT plot(1:10, rand(10), lw=1, lc=:blue, marker=:square, markere…

---

## [How to define input from users for a 2D heteregenous model](https://discourse.julialang.org/t/how-to-define-input-from-users-for-a-2d-heteregenous-model/79624)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 4\
**Last updated:** [April 18, 2022, 8:54pm UTC](https://discourse.julialang.org/t/how-to-define-input-from-users-for-a-2d-heteregenous-model/79624 "2022-04-18T20:54:01Z")

</div>

Hi everyone, I am working on a small modeling project. Let’s say I want to do 2D diffusion modeling in different units. All the units are homogeneous but they can have different geometries and physical properties. I wa…

---

## [GLMakie : record with high resolution?](https://discourse.julialang.org/t/glmakie-record-with-high-resolution/79654)

<div class="topic-metadata">

**Author:** [@Francois](https://discourse.julialang.org/u/Francois)\
**Replies:** 0\
**Last updated:** [April 18, 2022, 8:24pm UTC](https://discourse.julialang.org/t/glmakie-record-with-high-resolution/79654 "2022-04-18T20:24:23Z")

</div>

The maximum resolution for recording seems to be bounded by the size of my screen. GLMakie.activate!() grid = zeros(2000, 2000) fig = Figure(resolution=(2000, 2000)) ax = Axis(fig\[1, 1\], aspect=DataAspect()) hm = heatma…

---

## [Create a chain object from a dataframe](https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640)

<div class="topic-metadata">

**Author:** [@99dB](https://discourse.julialang.org/u/99dB)\
**Replies:** 1\
**Last updated:** [April 18, 2022, 5:19pm UTC](https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640 "2022-04-18T17:19:10Z")

</div>

Hi all, I would like to do some statistics using the package MCMCChains on a dataframe object. But it is not working because I think I need to have my chains in a MCMC chain object. Is there a way to create a chain obj…

---

## [Performance when dispatching on type](https://discourse.julialang.org/t/performance-when-dispatching-on-type/79617)

<div class="topic-metadata">

**Author:** [@ArjunNarayanan](https://discourse.julialang.org/u/ArjunNarayanan)\
**Replies:** 4\
**Last updated:** [April 18, 2022, 5:13pm UTC](https://discourse.julialang.org/t/performance-when-dispatching-on-type/79617 "2022-04-18T17:13:14Z")

</div>

A colleague recently showed me this example, and I’m curious as to the underlying reason for the performance hit. using BenchmarkTools, StaticArrays f(u, v) = u\*v' struct ConcType end ctyp = ConcType cvar = ConcType(…

---

## [Is there a option for different \`MethodError\` printing?](https://discourse.julialang.org/t/is-there-a-option-for-different-methoderror-printing/79523)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 2\
**Last updated:** [April 18, 2022, 2:14pm UTC](https://discourse.julialang.org/t/is-there-a-option-for-different-methoderror-printing/79523 "2022-04-18T14:14:14Z")

</div>

Hi all :slight\_smile: Sometimes I would like to switch to a different MethodError printing. The following is as it is: julia\> f(a,b,c,d,e,f,g,h,i,j,k) = nothing f (generic function with 1 method) julia\> f(1) ERROR: Me…

---

## [Why does JET give these "runtime dispatch detected" lines for some LDLFactorizations calls in Tulip](https://discourse.julialang.org/t/why-does-jet-give-these-runtime-dispatch-detected-lines-for-some-ldlfactorizations-calls-in-tulip/79583)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 4\
**Last updated:** [April 18, 2022, 12:57pm UTC](https://discourse.julialang.org/t/why-does-jet-give-these-runtime-dispatch-detected-lines-for-some-ldlfactorizations-calls-in-tulip/79583 "2022-04-18T12:57:07Z")

</div>

I’m playing around with linear programming using Tulip.jl and BigFloat, and I wanted to decrease the time necessary for finding each LP solution, so it seemed like JET.jl might be helpful to investigate possible performa…

---

## [Is it possible to reduce the allocation in replace missing value?](https://discourse.julialang.org/t/is-it-possible-to-reduce-the-allocation-in-replace-missing-value/79524)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 5\
**Last updated:** [April 18, 2022, 8:25am UTC](https://discourse.julialang.org/t/is-it-possible-to-reduce-the-allocation-in-replace-missing-value/79524 "2022-04-18T08:25:49Z")

</div>

Hi , I wanna replace the missing value to 0 in a large vector, but I got a hugh memory allocation for example: A = rand(10\_000\_000); @time replace!(A, -Inf =\> 0, Inf =\> 0, NaN =\> 0); this takes only 0.065884 seconds…

---

## [Zooming with PyPlot.jl](https://discourse.julialang.org/t/zooming-with-pyplot-jl/79606)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 2\
**Last updated:** [April 17, 2022, 7:16pm UTC](https://discourse.julialang.org/t/zooming-with-pyplot-jl/79606 "2022-04-17T19:16:42Z")

</div>

When trying to use the box zoom controls with PyPlot.jl, the updated region is frequently incorrect. Sometimes it gets it right, but usually it zooms into an entirely different region of the image or plot. The resulting …

---

## [Spatial binning with julia GeoStats packages](https://discourse.julialang.org/t/spatial-binning-with-julia-geostats-packages/79286)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 3\
**Last updated:** [April 17, 2022, 5:20pm UTC](https://discourse.julialang.org/t/spatial-binning-with-julia-geostats-packages/79286 "2022-04-17T17:20:18Z")

</div>

I have a bunch of spatially distributed event data. Each observation has a latitude, longitude coordinate, but no other attribute. I am looking at events happening in Ukraine, so the region is based upon national boundar…

---

## [Vector conversion mixed rational integers](https://discourse.julialang.org/t/vector-conversion-mixed-rational-integers/79546)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 32\
**Last updated:** [April 17, 2022, 4:48pm UTC](https://discourse.julialang.org/t/vector-conversion-mixed-rational-integers/79546 "2022-04-17T16:48:26Z")

</div>

Is there (or how could one write) a function that gives me this vector \[0, 1//2, 1, 3//2, 2\] from this vector \[0//2, 1//2, 2//2, 3//2, 4//2\]?

---

## [How to build a setInterval-like task?](https://discourse.julialang.org/t/how-to-build-a-setinterval-like-task/79595)

<div class="topic-metadata">

**Author:** [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Replies:** 1\
**Last updated:** [April 17, 2022, 1:30pm UTC](https://discourse.julialang.org/t/how-to-build-a-setinterval-like-task/79595 "2022-04-17T13:30:09Z")

</div>

This is my idea task=@task begin while true sleep(1) foo() if should\_end # ? end end end But are there any simple ways to contact other than using global should\_end? how to end the task from inside the expression…

---

## [Find nearest value in AxisArray](https://discourse.julialang.org/t/find-nearest-value-in-axisarray/75820)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 7\
**Last updated:** [April 17, 2022, 10:42am UTC](https://discourse.julialang.org/t/find-nearest-value-in-axisarray/75820 "2022-04-17T10:42:01Z")

</div>

I am playing around with AxisArrays, as it seems like a great package for adding axis with geographical locations to gridded data. What I would like is to let AxisArray give me the value of the nearest location, without …

---

## [Makie: How to make a figure with exactly correct font size?](https://discourse.julialang.org/t/makie-how-to-make-a-figure-with-exactly-correct-font-size/79553)

<div class="topic-metadata">

**Author:** [@DenisTitov](https://discourse.julialang.org/u/DenisTitov)\
**Replies:** 8\
**Last updated:** [April 17, 2022, 6:00am UTC](https://discourse.julialang.org/t/makie-how-to-make-a-figure-with-exactly-correct-font-size/79553 "2022-04-17T06:00:42Z")

</div>

Hi all, I’m using Makie to make figures for a publication and I want to be able to insert a figure (e.g., 6.5" by 3" figure) into word so that font size of my various labels is exactly correct (e.g., Ariel 11 that will …

---

## [How to manage various date format in a csv file](https://discourse.julialang.org/t/how-to-manage-various-date-format-in-a-csv-file/22696)

<div class="topic-metadata">

**Author:** [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Replies:** 3\
**Last updated:** [April 17, 2022, 1:01am UTC](https://discourse.julialang.org/t/how-to-manage-various-date-format-in-a-csv-file/22696 "2022-04-17T01:01:17Z")

</div>

Hello, I have to create a CSV file with various date format. Up to now, I use: using DataFrames using Dates format\_date\_1=“yyyymmddHHMMSS” format\_date\_2=“yyyymmdd” df\_out=DataFrame(hre\_deb\_calc=DateTime\[DateTime(“2…

---

## [What general-purpose commands do you usually end up adding to your projects?](https://discourse.julialang.org/t/what-general-purpose-commands-do-you-usually-end-up-adding-to-your-projects/4889)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 3\
**Last updated:** [April 16, 2022, 9:11pm UTC](https://discourse.julialang.org/t/what-general-purpose-commands-do-you-usually-end-up-adding-to-your-projects/4889 "2022-04-16T21:11:33Z")

</div>

Related to this response from Stefan, https://github.com/JuliaLang/julia/issues/14672#issuecomment-171665475 What commands do you usually end up adding to your projects to get around common nuisances?

---

## [How to remove type when converting to string](https://discourse.julialang.org/t/how-to-remove-type-when-converting-to-string/79574)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 2\
**Last updated:** [April 16, 2022, 4:20pm UTC](https://discourse.julialang.org/t/how-to-remove-type-when-converting-to-string/79574 "2022-04-16T16:20:16Z")

</div>

I want to convert this Any\[1,2,3,4\] to string but it gives “Any\[1,2,3,4\]”, it should give “\[1,2,3,4\]”

---

## [Random seed LTS vs latest stable](https://discourse.julialang.org/t/random-seed-lts-vs-latest-stable/64370)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 8\
**Last updated:** [April 16, 2022, 3:58pm UTC](https://discourse.julialang.org/t/random-seed-lts-vs-latest-stable/64370 "2022-04-16T15:58:16Z")

</div>

I am testing the same package on two different environments (LTS and current stable). I have noticed that the default random number generator is different. How do I change it on either environment to get the same sequenc…

---

## [How to extract components in an array of arrays](https://discourse.julialang.org/t/how-to-extract-components-in-an-array-of-arrays/79515)

<div class="topic-metadata">

**Author:** [@BVPs](https://discourse.julialang.org/u/BVPs)\
**Replies:** 11\
**Last updated:** [April 16, 2022, 12:57pm UTC](https://discourse.julialang.org/t/how-to-extract-components-in-an-array-of-arrays/79515 "2022-04-16T12:57:07Z")

</div>

Suppose I have an array of arrays, say a 2 x 2 matrix whose entries are 1 x 2 vectors, e.g., julia\> A 2×2 Matrix{Matrix{Int64}}: \[1 2\] \[3 4\] \[5 6\] \[7 8\] I am wondering, without using for loops, how to extract a 2 x…

---

## [Multi-threaded inverse of a matrix](https://discourse.julialang.org/t/multi-threaded-inverse-of-a-matrix/79543)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 6\
**Last updated:** [April 16, 2022, 6:07am UTC](https://discourse.julialang.org/t/multi-threaded-inverse-of-a-matrix/79543 "2022-04-16T06:07:57Z")

</div>

Hi there, I thought that BLAS.set\_num\_threads(n) was enough to run all LinearAlgebra functions in a multi-threaded fashion. However, I came to realise that this actually applies mostly to matrix products. Inverses see…

---

## [Julia geostats and measuring units for spatial lags between variables](https://discourse.julialang.org/t/julia-geostats-and-measuring-units-for-spatial-lags-between-variables/79511)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 4\
**Last updated:** [April 16, 2022, 12:58am UTC](https://discourse.julialang.org/t/julia-geostats-and-measuring-units-for-spatial-lags-between-variables/79511 "2022-04-16T00:58:23Z")

</div>

I am using the wonderful GeoStats package and associated JuliaEarth tools. For my project I have to compute the variogram from a sample of data. The tricky thing is that the EmpiricalVariogram() function in julia asks fo…

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

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