# General Usage

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

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

**Page:** 508

---

## [Vscode: plots pane keeps occupying the full screen](https://discourse.julialang.org/t/vscode-plots-pane-keeps-occupying-the-full-screen/73100)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 7\
**Last updated:** [December 15, 2021, 12:41pm UTC](https://discourse.julialang.org/t/vscode-plots-pane-keeps-occupying-the-full-screen/73100 "2021-12-15T12:41:39Z")

</div>

Before the last update of VScode, when I had a layout like this: and modified the code to produce a new/tuned plot, the plot appeared in the same position. Now whenever (not always, actually) I update the plot, this …

---

## [Clear terminal window](https://discourse.julialang.org/t/clear-terminal-window/17046)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 8\
**Last updated:** [December 15, 2021, 12:09pm UTC](https://discourse.julialang.org/t/clear-terminal-window/17046 "2021-12-15T12:09:53Z")

</div>

How can I programmatically clear the terminal window, equivalent to pressing Ctrl+l?

---

## [Memory usage in DifferentialEquations.jl](https://discourse.julialang.org/t/memory-usage-in-differentialequations-jl/73117)

<div class="topic-metadata">

**Author:** [@Sarthak\_Choudhury](https://discourse.julialang.org/u/Sarthak_Choudhury)\
**Replies:** 1\
**Last updated:** [December 15, 2021, 10:45am UTC](https://discourse.julialang.org/t/memory-usage-in-differentialequations-jl/73117 "2021-12-15T10:45:38Z")

</div>

Hi , I am encountering a problem with DifferentialEquations.jl running out of memory when using threads. So I have created a function which is non-allocating and then used threads to speed up the process. The function i…

---

## [3D printing apriltags](https://discourse.julialang.org/t/3d-printing-apriltags/73128)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [December 15, 2021, 9:55am UTC](https://discourse.julialang.org/t/3d-printing-apriltags/73128 "2021-12-15T09:55:04Z")

</div>

I’ve recently managed to 3D print an apriltag with the help of folks on slack. Since there was some interest in how it worked, I wrote what I did here. Apriltags consist of two colors, black and white. So I need the pri…

---

## [Interpolation.jl + Cuda.jl? Possible?](https://discourse.julialang.org/t/interpolation-jl-cuda-jl-possible/73096)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 2\
**Last updated:** [December 15, 2021, 9:17am UTC](https://discourse.julialang.org/t/interpolation-jl-cuda-jl-possible/73096 "2021-12-15T09:17:02Z")

</div>

Hi everyone. I want to add Cuda.jl and GPU processing to my current workflow. I know NOTHING about GPU but I like what I have seen in CUDA.jl. My main problem is that I (over)use Interpolations.jl to create interpolati…

---

## [KrylovKit.svdsolve() terminating too early, with non-orthogonal singular vectors](https://discourse.julialang.org/t/krylovkit-svdsolve-terminating-too-early-with-non-orthogonal-singular-vectors/73109)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 0\
**Last updated:** [December 15, 2021, 2:36am UTC](https://discourse.julialang.org/t/krylovkit-svdsolve-terminating-too-early-with-non-orthogonal-singular-vectors/73109 "2021-12-15T02:36:28Z")

</div>

I have for long had troubles with the KrylovKit.svdsolve() method. I am using Julia version 1.7.0, and I am trying to find the SVD of a sparse 1001X1001 matrix. It seems that if I try to find L=150 svd pairs, the U, V ma…

---

## [Text Mining: Detect Strings: Word Lookup in a Large Corpus of Phrases Using a Large Dictionary](https://discourse.julialang.org/t/text-mining-detect-strings-word-lookup-in-a-large-corpus-of-phrases-using-a-large-dictionary/72665)

<div class="topic-metadata">

**Author:** [@aourednik](https://discourse.julialang.org/u/aourednik)\
**Replies:** 27\
**Last updated:** [December 15, 2021, 12:39am UTC](https://discourse.julialang.org/t/text-mining-detect-strings-word-lookup-in-a-large-corpus-of-phrases-using-a-large-dictionary/72665 "2021-12-15T00:39:19Z")

</div>

I am trying to port a multithreaded #RStats algorithm for detecting strings from a 200k long dictionary in a corpus of 1 million phrases (cf. Text Mining: Detect Strings: Very Fast Word Lookup in a Large Dictionary in R …

---

## [Disallow more subtypes](https://discourse.julialang.org/t/disallow-more-subtypes/73103)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [December 15, 2021, 12:18am UTC](https://discourse.julialang.org/t/disallow-more-subtypes/73103 "2021-12-15T00:18:45Z")

</div>

abstract type Foo end struct FooA \<: Foo x end struct FooB \<: Foo x end I want to disallow any other concrete types of Foo. Is that possible?

---

## [Mass matrices for cases of du/dt = f(du, u, p, t) where du and u are matrices?](https://discourse.julialang.org/t/mass-matrices-for-cases-of-du-dt-f-du-u-p-t-where-du-and-u-are-matrices/73094)

<div class="topic-metadata">

**Author:** [@jqbond](https://discourse.julialang.org/u/jqbond)\
**Replies:** 2\
**Last updated:** [December 14, 2021, 11:53pm UTC](https://discourse.julialang.org/t/mass-matrices-for-cases-of-du-dt-f-du-u-p-t-where-du-and-u-are-matrices/73094 "2021-12-14T23:53:38Z")

</div>

I wrote an ad hoc script for a method of lines problem where I discretized the spatial domain and used and ODE solver to integrate in the time domain. At the moment, I’m not interested in a discussion of whether this is …

---

## [Extending a Package (without forking)](https://discourse.julialang.org/t/extending-a-package-without-forking/73091)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [December 14, 2021, 10:24pm UTC](https://discourse.julialang.org/t/extending-a-package-without-forking/73091 "2021-12-14T22:24:10Z")

</div>

I have a package that I wrote which is part of the Julia package registry that I would like to extend in a nonstandard way. It’s organized in the same spirit as Optim.jl in the sense that there are a much of different s…

---

## [Trying to use JLD.jl with Julia v1.7.0-beta3](https://discourse.julialang.org/t/trying-to-use-jld-jl-with-julia-v1-7-0-beta3/66017)

<div class="topic-metadata">

**Author:** [@aaraujo71](https://discourse.julialang.org/u/aaraujo71)\
**Replies:** 8\
**Last updated:** [December 14, 2021, 8:29pm UTC](https://discourse.julialang.org/t/trying-to-use-jld-jl-with-julia-v1-7-0-beta3/66017 "2021-12-14T20:29:12Z")

</div>

I need to save variables of different types in Julia, and I’ve tried JLD.jl in Julia v1.6.2 without any problem. However, since I’m using the new Mac M1, I moved to the new upcoming release v1.7.0-beta3 (and it’s really …

---

## [Finding Jacobian using automatic differentiation for a vector function](https://discourse.julialang.org/t/finding-jacobian-using-automatic-differentiation-for-a-vector-function/73078)

<div class="topic-metadata">

**Author:** [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Replies:** 3\
**Last updated:** [December 14, 2021, 4:32pm UTC](https://discourse.julialang.org/t/finding-jacobian-using-automatic-differentiation-for-a-vector-function/73078 "2021-12-14T16:32:13Z")

</div>

Hi, I want to use automatic differentiation to calculate the Jacobian of vector functions. However, I am running into errors that I don’t know how to solve. Here is a minimal working example: using ForwardDiff using Rev…

---

## [Square root of a matrix that has no square root](https://discourse.julialang.org/t/square-root-of-a-matrix-that-has-no-square-root/73081)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 3\
**Last updated:** [December 14, 2021, 4:01pm UTC](https://discourse.julialang.org/t/square-root-of-a-matrix-that-has-no-square-root/73081 "2021-12-14T16:01:22Z")

</div>

Is this expected? julia\> sqrt(\[0 1; 0 0\]) 2×2 Matrix{Float64}: 0.0 0.0 0.0 0.0 I thought it would give an error.

---

## [Specify interface methods to implement](https://discourse.julialang.org/t/specify-interface-methods-to-implement/73072)

<div class="topic-metadata">

**Author:** [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)\
**Replies:** 2\
**Last updated:** [December 14, 2021, 3:51pm UTC](https://discourse.julialang.org/t/specify-interface-methods-to-implement/73072 "2021-12-14T15:51:15Z")

</div>

Is there a way (other than documentation) to define an interface in a way allowing to automatically check that a struct implements all required methods at compile time?

---

## [Subplot of contours with different legends (Plots.jl; plotly backend)](https://discourse.julialang.org/t/subplot-of-contours-with-different-legends-plots-jl-plotly-backend/73076)

<div class="topic-metadata">

**Author:** [@Fathya.Salih](https://discourse.julialang.org/u/Fathya.Salih)\
**Replies:** 0\
**Last updated:** [December 14, 2021, 2:35pm UTC](https://discourse.julialang.org/t/subplot-of-contours-with-different-legends-plots-jl-plotly-backend/73076 "2021-12-14T14:35:53Z")

</div>

Hello, I am using Plots.jl with a plotly() backend and I am trying to plot more than one contour plot in the same figure with their respective color bars, since are on different orders of magnitude. When I try the code…

---

## [Pluto inside Docker container](https://discourse.julialang.org/t/pluto-inside-docker-container/46386)

<div class="topic-metadata">

**Author:** [@Vadim\_Lebedev](https://discourse.julialang.org/u/Vadim_Lebedev)\
**Replies:** 5\
**Last updated:** [December 14, 2021, 2:11pm UTC](https://discourse.julialang.org/t/pluto-inside-docker-container/46386 "2021-12-14T14:11:07Z")

</div>

I’m running julia inside docker container, i’m unable to expose Pluto listening port 1234 to my host because Pluto binds to 127.0.0.1:1234 I need it to bind to 0:0.0.0:1234 Any advice?

---

## [Count various patterns simultaneously](https://discourse.julialang.org/t/count-various-patterns-simultaneously/73066)

<div class="topic-metadata">

**Author:** [@ludwig-austermann](https://discourse.julialang.org/u/ludwig-austermann)\
**Replies:** 5\
**Last updated:** [December 14, 2021, 1:34pm UTC](https://discourse.julialang.org/t/count-various-patterns-simultaneously/73066 "2021-12-14T13:34:10Z")

</div>

I was just wondering if there is a nicer way to do practically this: reduce( (d, c) -\> (d\[c\] = get(d, c, 0) + 1; d), "ACCACD", init=Dict{Char, Int}() ) hence, to do a non-binary count s = "ACCACD" Dict( c =\> c…

---

## [Solving quasi-linear heat diffusion using DiffEqTools.jl and DifferentialEquations.jl](https://discourse.julialang.org/t/solving-quasi-linear-heat-diffusion-using-diffeqtools-jl-and-differentialequations-jl/72954)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 2\
**Last updated:** [December 14, 2021, 1:31pm UTC](https://discourse.julialang.org/t/solving-quasi-linear-heat-diffusion-using-diffeqtools-jl-and-differentialequations-jl/72954 "2021-12-14T13:31:52Z")

</div>

Hi everyone. I am new to Julia and decided to give a try to the SciML framework. My goal is first to solve the quasi-linear heat equation using the method of Lines. \\partial\_t T = \\partial\_x (\\kappa(x) \\,\\, \\partial\_…

---

## [How to understand Makie.jl functions signatures](https://discourse.julialang.org/t/how-to-understand-makie-jl-functions-signatures/53157)

<div class="topic-metadata">

**Author:** [@akalinin](https://discourse.julialang.org/u/akalinin)\
**Replies:** 5\
**Last updated:** [December 14, 2021, 12:03pm UTC](https://discourse.julialang.org/t/how-to-understand-makie-jl-functions-signatures/53157 "2021-12-14T12:03:43Z")

</div>

I want to draw 3D mesh using Makie.jl. I try to inspect mesh function julia\> using GLMakie help?\> mesh mesh(x, y, z) mesh(mesh\_object) mesh(x, y, z, faces) mesh(xyz, faces) For me it is not clear what are th…

---

## [Storing and retrieving multi-dimensional arrays from a file](https://discourse.julialang.org/t/storing-and-retrieving-multi-dimensional-arrays-from-a-file/73017)

<div class="topic-metadata">

**Author:** [@JaydevSR](https://discourse.julialang.org/u/JaydevSR)\
**Replies:** 5\
**Last updated:** [December 14, 2021, 10:48am UTC](https://discourse.julialang.org/t/storing-and-retrieving-multi-dimensional-arrays-from-a-file/73017 "2021-12-14T10:48:49Z")

</div>

Let’s say, for some parameter k I have a 3-d array (in my case is a (N, N, M) array). Here, k can take a bunch of values. I want to store the arrays in a file in such a way that I can retrieve them for each value of k l…

---

## [Project precompilation fails with \`ArgumentError: Invalid header in cache file ...\`](https://discourse.julialang.org/t/project-precompilation-fails-with-argumenterror-invalid-header-in-cache-file/67256)

<div class="topic-metadata">

**Author:** [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Replies:** 4\
**Last updated:** [December 14, 2021, 10:33am UTC](https://discourse.julialang.org/t/project-precompilation-fails-with-argumenterror-invalid-header-in-cache-file/67256 "2021-12-14T10:33:31Z")

</div>

I have a julia project that refuses to \] precompile. I get the following error: Precompiling project... ✗ odecontrol 296 dependencies successfully precompiled in 290 seconds (8 already precompiled) ERROR: The follo…

---

## [\`Replace\` function defaulting to type Any when using broadcasting, but not with a for-loop](https://discourse.julialang.org/t/replace-function-defaulting-to-type-any-when-using-broadcasting-but-not-with-a-for-loop/73030)

<div class="topic-metadata">

**Author:** [@numberMX](https://discourse.julialang.org/u/numberMX)\
**Replies:** 3\
**Last updated:** [December 14, 2021, 4:34am UTC](https://discourse.julialang.org/t/replace-function-defaulting-to-type-any-when-using-broadcasting-but-not-with-a-for-loop/73030 "2021-12-14T04:34:15Z")

</div>

I had a situation the other day where I had a 2D vector of integers, and I wanted to use the replace function with a list of replacement pairs, on the integers in the inner vectors. If I use a for-loop list comprehensio…

---

## [Tracking down slowness of using](https://discourse.julialang.org/t/tracking-down-slowness-of-using/73048)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [December 14, 2021, 8:28am UTC](https://discourse.julialang.org/t/tracking-down-slowness-of-using/73048 "2021-12-14T08:28:22Z")

</div>

This is the speed I get with a clean .julia profile: julia\> @time using HTTP 0.185504 seconds (50.50 k allocations: 4.633 MiB, 85.81% compilation time) With non-default options I can get down to: julia\> @time using …

---

## [Does Julia optimise when we reuse function?](https://discourse.julialang.org/t/does-julia-optimise-when-we-reuse-function/73057)

<div class="topic-metadata">

**Author:** [@Minimum-Pollution-96](https://discourse.julialang.org/u/Minimum-Pollution-96)\
**Replies:** 4\
**Last updated:** [December 14, 2021, 4:04am UTC](https://discourse.julialang.org/t/does-julia-optimise-when-we-reuse-function/73057 "2021-12-14T04:04:09Z")

</div>

I have the following two functions defined separately. C(u\_nodes, X, t) = F(u\_nodes, X, t)'F(u\_nodes, X, t) b(u\_nodes, X, t) = F(u\_nodes, X, t)\* F(u\_nodes, X, t)' Now, if I create another 2 functions (called in a seq…

---

## [Determining xlims](https://discourse.julialang.org/t/determining-xlims/72921)

<div class="topic-metadata">

**Author:** [@sransome](https://discourse.julialang.org/u/sransome)\
**Replies:** 7\
**Last updated:** [December 14, 2021, 2:55am UTC](https://discourse.julialang.org/t/determining-xlims/72921 "2021-12-14T02:55:12Z")

</div>

Hi, I really like the ability of Makie to set the x and y limits automatically but sometimes I want to use the limits to fine tune my plot. Is there a way of returning the x and y limits for an axis when they have been…

---

## [Converting Date Formats from dd/mm/yyyy to yyyy-mm-dd](https://discourse.julialang.org/t/converting-date-formats-from-dd-mm-yyyy-to-yyyy-mm-dd/73056)

<div class="topic-metadata">

**Author:** [@Peter-Jolly](https://discourse.julialang.org/u/Peter-Jolly)\
**Replies:** 2\
**Last updated:** [December 14, 2021, 2:34am UTC](https://discourse.julialang.org/t/converting-date-formats-from-dd-mm-yyyy-to-yyyy-mm-dd/73056 "2021-12-14T02:34:40Z")

</div>

Could someone help with the correct code to convert date formats as follows. The simple code throws an error at line Date\_2 = … : #Change Date formats using Dates Start\_Date = "2000-02-01" Date\_1 = Date(Start\_Date,"yyy…

---

## [Custom structs in JuliaDiffEq: In-place broadcasting results in allocation and slowdown](https://discourse.julialang.org/t/custom-structs-in-juliadiffeq-in-place-broadcasting-results-in-allocation-and-slowdown/72686)

<div class="topic-metadata">

**Author:** [@taketwicedailey](https://discourse.julialang.org/u/taketwicedailey)\
**Replies:** 7\
**Last updated:** [December 14, 2021, 12:16am UTC](https://discourse.julialang.org/t/custom-structs-in-juliadiffeq-in-place-broadcasting-results-in-allocation-and-slowdown/72686 "2021-12-14T00:16:20Z")

</div>

I am trying to write a program that solves a set of partial differential equations. This includes one space dimension and one time dimension, so I would like to pass a spatial vector for each of my variables to the ODE s…

---

## [Cannot \`convert\` an object of type](https://discourse.julialang.org/t/cannot-convert-an-object-of-type/73052)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 3\
**Last updated:** [December 13, 2021, 9:47pm UTC](https://discourse.julialang.org/t/cannot-convert-an-object-of-type/73052 "2021-12-13T21:47:05Z")

</div>

What is wrong with this code? Can I fix it by implementing convert somehow? const Maybe{T} = Union{Some{T},Nothing} struct Wrapper{F} f::F end struct WrappedPerson{T} name::Wrapper{T} age::Wrapper{T} end …

---

## [Problems with Plots.jl figure](https://discourse.julialang.org/t/problems-with-plots-jl-figure/73006)

<div class="topic-metadata">

**Author:** [@Sarthak\_Choudhury](https://discourse.julialang.org/u/Sarthak_Choudhury)\
**Replies:** 1\
**Last updated:** [December 13, 2021, 9:42pm UTC](https://discourse.julialang.org/t/problems-with-plots-jl-figure/73006 "2021-12-13T21:42:57Z")

</div>

Hi, I am really having trouble getting a heatmap figure out. I would be grateful for any help regarding this. I am enclosing a mwe for it. x=collect(1:50) y=collect(1:50) z=rand(50,50) p1=Plots.heatmap(x,y,z,leg=false…

---

## [Wiping modules and persistent Base.show](https://discourse.julialang.org/t/wiping-modules-and-persistent-base-show/73049)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 1\
**Last updated:** [December 13, 2021, 9:15pm UTC](https://discourse.julialang.org/t/wiping-modules-and-persistent-base-show/73049 "2021-12-13T21:15:16Z")

</div>

I’d like to be able to overwrite an existing module within a session and have everything it defines dropped. This works fine for functions, structs, variable assignments but not for functions it extends from other module…

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

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