# General Usage

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

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

**Page:** 294

---

## [Failed to Precompile Direct Dependencies](https://discourse.julialang.org/t/failed-to-precompile-direct-dependencies/98665)

<div class="topic-metadata">

**Author:** [@eivindaf](https://discourse.julialang.org/u/eivindaf)\
**Replies:** 2\
**Last updated:** [May 11, 2023, 9:52am UTC](https://discourse.julialang.org/t/failed-to-precompile-direct-dependencies/98665 "2023-05-11T09:52:31Z")

</div>

Hi! I am working in a Github project for my thesis. I have imported all relevant packages, however, when importing “KernelEstimator.jl”, Julia fails to precompile certain direct dependencies. The error log suggests that …

---

## [Informal interfaces and abstract types](https://discourse.julialang.org/t/informal-interfaces-and-abstract-types/95993)

<div class="topic-metadata">

**Author:** [@nolb](https://discourse.julialang.org/u/nolb)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 8:57am UTC](https://discourse.julialang.org/t/informal-interfaces-and-abstract-types/95993 "2023-05-11T08:57:06Z")

</div>

Hi everyone, I have a question regarding best practices for the design of informal interfaces. Let’s say that I want to implement a service that continuously reads in data from a source, processes the data, and publish…

---

## [Julia wrapper for hiredis](https://discourse.julialang.org/t/julia-wrapper-for-hiredis/98559)

<div class="topic-metadata">

**Author:** [@nolb](https://discourse.julialang.org/u/nolb)\
**Replies:** 2\
**Last updated:** [May 11, 2023, 8:54am UTC](https://discourse.julialang.org/t/julia-wrapper-for-hiredis/98559 "2023-05-11T08:54:36Z")

</div>

Hi everyone, I am currently trying to write a Julia wrapper for the C library hiredis, so that I can write data to and read data from a Redis Cache with Julia. There are already two Julia libraries for this, namely Red…

---

## [Trouble using SciMLSensitivity with observed states: "no method matching fast\_materialize"](https://discourse.julialang.org/t/trouble-using-scimlsensitivity-with-observed-states-no-method-matching-fast-materialize/98526)

<div class="topic-metadata">

**Author:** [@contradict](https://discourse.julialang.org/u/contradict)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 8:22am UTC](https://discourse.julialang.org/t/trouble-using-scimlsensitivity-with-observed-states-no-method-matching-fast-materialize/98526 "2023-05-11T08:22:52Z")

</div>

I am trying to fit some data to a model created with ModelingToolkit using the example here. This script reproduces the error I get with my model. Is this worth an issue or is there an easier fix? using DifferentialEqu…

---

## [CalculusWithJulia' Euler Method for certain step size $h$ returns NaN](https://discourse.julialang.org/t/calculuswithjulia-euler-method-for-certain-step-size-h-returns-nan/98659)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 6:46am UTC](https://discourse.julialang.org/t/calculuswithjulia-euler-method-for-certain-step-size-h-returns-nan/98659 "2023-05-11T06:46:46Z")

</div>

Good day all, For simple y'=y Why is the Euler computation returns NaN for h=0.1 , and several other h values? Take a look at the Pretty Tables below. This is my code: using SymPy, CalculusWithJulia, LaTeXStrings,…

---

## [Surprising behavior when function contains variable with same name](https://discourse.julialang.org/t/surprising-behavior-when-function-contains-variable-with-same-name/98511)

<div class="topic-metadata">

**Author:** [@anodos](https://discourse.julialang.org/u/anodos)\
**Replies:** 3\
**Last updated:** [May 11, 2023, 6:37am UTC](https://discourse.julialang.org/t/surprising-behavior-when-function-contains-variable-with-same-name/98511 "2023-05-11T06:37:40Z")

</div>

I have been running into issues with Julia functions whose name matches the name of an internal variable. For example, the following function seems pretty harmless to me: function speed(distance,time) speed = distan…

---

## [How to limit scope of evaluated variable assignment?](https://discourse.julialang.org/t/how-to-limit-scope-of-evaluated-variable-assignment/98506)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 3\
**Last updated:** [May 11, 2023, 4:58am UTC](https://discourse.julialang.org/t/how-to-limit-scope-of-evaluated-variable-assignment/98506 "2023-05-11T04:58:06Z")

</div>

As described in this early draft essay, I’m developing a somewhat terse text specification of 3D meshes as an attempt to make 3D modeling more accessible to the blind. The code is probably working good enough for now but…

---

## [Difference between datashader and scatter/heatmap?](https://discourse.julialang.org/t/difference-between-datashader-and-scatter-heatmap/98646)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 3:22am UTC](https://discourse.julialang.org/t/difference-between-datashader-and-scatter-heatmap/98646 "2023-05-11T03:22:24Z")

</div>

What is the difference between datashader and scatter plots or heatmap?

---

## [Performance penalty of \`\>(1)\` vs \`x -\> x \>1\`?](https://discourse.julialang.org/t/performance-penalty-of-1-vs-x-x-1/98547)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 36\
**Last updated:** [May 11, 2023, 12:47am UTC](https://discourse.julialang.org/t/performance-penalty-of-1-vs-x-x-1/98547 "2023-05-11T00:47:30Z")

</div>

Why is there this performance penalty in using \>(1) vs x -\> x \> 1 in these examples? (happens in 1.8.5 and 1.9-rc3): julia\> using BenchmarkTools julia\> mat = randn(1000, 1000); julia\> @btime sum(\>(1), $mat) 557.740 …

---

## [Eigen values and vectors sorting](https://discourse.julialang.org/t/eigen-values-and-vectors-sorting/98637)

<div class="topic-metadata">

**Author:** [@papar](https://discourse.julialang.org/u/papar)\
**Replies:** 7\
**Last updated:** [May 10, 2023, 11:33pm UTC](https://discourse.julialang.org/t/eigen-values-and-vectors-sorting/98637 "2023-05-10T23:33:41Z")

</div>

I am trying to work out how to sort eigen values and eigen vectors that are consistent with other languages. I use the following code on a covariance matrix: eigen\_vals, eigen\_vector = eigen(covariance\_matrix) This gi…

---

## [StackOverflowError related to \`SizedMatrix\`](https://discourse.julialang.org/t/stackoverflowerror-related-to-sizedmatrix/98647)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 1\
**Last updated:** [May 10, 2023, 10:09pm UTC](https://discourse.julialang.org/t/stackoverflowerror-related-to-sizedmatrix/98647 "2023-05-10T22:09:39Z")

</div>

I have a complex code and received a StackOverflowError associated with \`StaticArrays’. More precisely, I received the message: ERROR: StackOverflowError: Stacktrace: \[1\] SizedMatrix{3, 3, Float32, 2, Matrix{Float32}}(…

---

## [Where are those 3 sec TTFP hiding?](https://discourse.julialang.org/t/where-are-those-3-sec-ttfp-hiding/98615)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 14\
**Last updated:** [May 10, 2023, 8:35pm UTC](https://discourse.julialang.org/t/where-are-those-3-sec-ttfp-hiding/98615 "2023-05-10T20:35:36Z")

</div>

In my PrecompileTools workload I have this line plot(rand(5,2)) But when I run it again on a fresh session, I see julia\> @time @eval plot(rand(5,2)) 3.232747 seconds (7.55 M allocations: 479.328 MiB, 5.31% gc time, …

---

## [How to take union of interval elements in Interval Vector?](https://discourse.julialang.org/t/how-to-take-union-of-interval-elements-in-interval-vector/98422)

<div class="topic-metadata">

**Author:** [@Ashu](https://discourse.julialang.org/u/Ashu)\
**Replies:** 18\
**Last updated:** [May 10, 2023, 2:26pm UTC](https://discourse.julialang.org/t/how-to-take-union-of-interval-elements-in-interval-vector/98422 "2023-05-10T14:26:57Z")

</div>

Hello, I have an interval vector of the form as X = \[ \[0,0.1\], \[1,2\], \[0.1,0.2\], \[9,10\], \[2,3\], \[0.2,0.3\], \[10,11\], \[2,3\], \[9,10\] \] I wish to get it in the form as Y = \[ \[0,0.3\], \[1,3\], \[9,11\] \] I am using the “Int…

---

## [Pkg.gc() deletion failure warnings](https://discourse.julialang.org/t/pkg-gc-deletion-failure-warnings/98631)

<div class="topic-metadata">

**Author:** [@hdavid16](https://discourse.julialang.org/u/hdavid16)\
**Replies:** 0\
**Last updated:** [May 10, 2023, 4:35pm UTC](https://discourse.julialang.org/t/pkg-gc-deletion-failure-warnings/98631 "2023-05-10T16:35:05Z")

</div>

I’m getting a bunch of these warnings: ┌ Warning: Failed to delete C:\\...\\.julia\\packages\\ZipFile\\oD4uG │ exception = IOError: chmod("C:\\\\....\\\\.julia\\\\packages\\\\ZipFile\\\\oD4uG\\\\.appveyor.yml", 0o777): invalid argumen…

---

## [PSA: The right dependency to reduce from DifferentialEquations.jl](https://discourse.julialang.org/t/psa-the-right-dependency-to-reduce-from-differentialequations-jl/72757)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 3\
**Last updated:** [May 10, 2023, 4:24pm UTC](https://discourse.julialang.org/t/psa-the-right-dependency-to-reduce-from-differentialequations-jl/72757 "2023-05-10T16:24:39Z")

</div>

It’s no secret that DifferentialEquations.jl is a big package, so sometimes you will not want to depend on it directly downstream. That’s not only okay but a good idea, only depend on what you need! However, I have seen …

---

## [Updated julia via juliaup, packages are no longer avaiable](https://discourse.julialang.org/t/updated-julia-via-juliaup-packages-are-no-longer-avaiable/98612)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 4\
**Last updated:** [May 10, 2023, 3:27pm UTC](https://discourse.julialang.org/t/updated-julia-via-juliaup-packages-are-no-longer-avaiable/98612 "2023-05-10T15:27:20Z")

</div>

With Julia 1.9.0 being released, I ran juliaup update in my (ubuntu 22.04) terminal to get the latest version. when I then start julia I got a ERROR: LoadError: ArgumentError: Package OhMyREPL not found in current path.…

---

## [\[ANN\] BlockEnums another enums package](https://discourse.julialang.org/t/ann-blockenums-another-enums-package/98591)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 1\
**Last updated:** [May 10, 2023, 3:25pm UTC](https://discourse.julialang.org/t/ann-blockenums-another-enums-package/98591 "2023-05-10T15:25:31Z")

</div>

BlockEnums.jl is in the general registry. I started this before I knew about EnumsX.jl, which has some overlap in features. A couple of useful features of BlockEnums are You can define additional instances of an enum …

---

## [Change in behaviour of ForwardDiff in Julia 1.9](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 3:05pm UTC](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616 "2023-05-10T15:05:43Z")

</div>

Does anyone know why there would be a change in the output type of the following code between Julia versions 1.8 and 1.9?: using ForwardDiff, StaticArrays ForwardDiff.jacobian(z -\> SVector{2}(z\[1\], z\[2\]), zeros(SVector{…

---

## [Is Julia reliable for solving ordinary and stochastic differential equations?](https://discourse.julialang.org/t/is-julia-reliable-for-solving-ordinary-and-stochastic-differential-equations/98374)

<div class="topic-metadata">

**Author:** [@soldin](https://discourse.julialang.org/u/soldin)\
**Replies:** 12\
**Last updated:** [May 10, 2023, 2:22pm UTC](https://discourse.julialang.org/t/is-julia-reliable-for-solving-ordinary-and-stochastic-differential-equations/98374 "2023-05-10T14:22:43Z")

</div>

I got a bit worried about using Julia after reading Yuri Vishnevsky’s article (“Why I no longer recommend Julia”). I want to use this language for solving ordinary and stochastic differential equations. Besides this, I a…

---

## [Calling my own Julia functions from C](https://discourse.julialang.org/t/calling-my-own-julia-functions-from-c/98617)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 0\
**Last updated:** [May 10, 2023, 2:12pm UTC](https://discourse.julialang.org/t/calling-my-own-julia-functions-from-c/98617 "2023-05-10T14:12:46Z")

</div>

Hi everyone, I have been trying to call a user defined function in Julia in a very simple C code and I am not able too. The code builds up from the most simple Julia function call to what I actually want which is callin…

---

## [Declare a structure as a subtype of another structure](https://discourse.julialang.org/t/declare-a-structure-as-a-subtype-of-another-structure/98611)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 4\
**Last updated:** [May 10, 2023, 1:49pm UTC](https://discourse.julialang.org/t/declare-a-structure-as-a-subtype-of-another-structure/98611 "2023-05-10T13:49:52Z")

</div>

Curiously didn’t find anything on this, even after some decent amount of googling… I have a structure, and then I have a version of it with some additional info. Can I make the latter inherit from the former? Naively, I…

---

## [How to interpret results from \`Profile.take\_heap\_snapshot\`?](https://discourse.julialang.org/t/how-to-interpret-results-from-profile-take-heap-snapshot/98610)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 0\
**Last updated:** [May 10, 2023, 12:28pm UTC](https://discourse.julialang.org/t/how-to-interpret-results-from-profile-take-heap-snapshot/98610 "2023-05-10T12:28:55Z")

</div>

I tried to use the new Profile.take\_heap\_snapshot function, by following the steps provided in the blog post (on of my Pluto notebooks takes a lot of memory, and I’d like to understand where this comes from) However, I …

---

## [Flux.jl versus Lux.jl](https://discourse.julialang.org/t/flux-jl-versus-lux-jl/98499)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 5\
**Last updated:** [May 10, 2023, 6:44am UTC](https://discourse.julialang.org/t/flux-jl-versus-lux-jl/98499 "2023-05-10T06:44:13Z")

</div>

The Scientific machine ecosystem in Julia now recommends Lux.jl as opposed to Flux.jl. What are the use cases in general where Flux.jl is better than Lux.jl? Looking at the questions on Discourse, I have the impression t…

---

## [Freezing problems with GENIE/Stipple whilst updating using ZMQ feed](https://discourse.julialang.org/t/freezing-problems-with-genie-stipple-whilst-updating-using-zmq-feed/98347)

<div class="topic-metadata">

**Author:** [@1153dent](https://discourse.julialang.org/u/1153dent)\
**Replies:** 33\
**Last updated:** [May 9, 2023, 5:44pm UTC](https://discourse.julialang.org/t/freezing-problems-with-genie-stipple-whilst-updating-using-zmq-feed/98347 "2023-05-09T17:44:35Z")

</div>

could we use genie to represent real time ( 1 sec) updates of a data structure. We tried stipple.jl but it freezes on the web page but the dataframe is still being updated.

---

## [Precompiling CSV.jl fails](https://discourse.julialang.org/t/precompiling-csv-jl-fails/75103)

<div class="topic-metadata">

**Author:** [@mindaslab](https://discourse.julialang.org/u/mindaslab)\
**Replies:** 13\
**Last updated:** [May 9, 2023, 11:58pm UTC](https://discourse.julialang.org/t/precompiling-csv-jl-fails/75103 "2023-05-09T23:58:45Z")

</div>

Hello All, I am running Julia 1.7.1 on MacOS Monterey 12.1, I to use CSV by running the command using CSV and I got this: ┌ Info: Precompiling CSV \[336ed68f-0bac-5ca0-87d4-7b16caf5d00b\] └ @ Base loading.jl:1423 ERROR: …

---

## [ERROR: InexactError: Int64(NaN) in LsqFit.jl](https://discourse.julialang.org/t/error-inexacterror-int64-nan-in-lsqfit-jl/98580)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 1\
**Last updated:** [May 9, 2023, 11:28pm UTC](https://discourse.julialang.org/t/error-inexacterror-int64-nan-in-lsqfit-jl/98580 "2023-05-09T23:28:50Z")

</div>

If you face this issue working with LsqFit.jl it might help to specify the initial values p0 as floating point numbers, instead of Int. This was wrong in my example: p0 = \[100, 2000, 4000\] This cured the issue: p0 …

---

## [Julia crashes when using a @cfunction from another module](https://discourse.julialang.org/t/julia-crashes-when-using-a-cfunction-from-another-module/98576)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 2\
**Last updated:** [May 9, 2023, 9:32pm UTC](https://discourse.julialang.org/t/julia-crashes-when-using-a-cfunction-from-another-module/98576 "2023-05-09T21:32:37Z")

</div>

I’m trying to define some Julia callbacks to give to a C library, but hit some strange crashes when those functions are invoked. In an attempt to pin down the problem I have created a very simple project which still cras…

---

## [Help calling fortran subroutines using ccall](https://discourse.julialang.org/t/help-calling-fortran-subroutines-using-ccall/98572)

<div class="topic-metadata">

**Author:** [@GiovanniLavezzi](https://discourse.julialang.org/u/GiovanniLavezzi)\
**Replies:** 0\
**Last updated:** [May 9, 2023, 8:02pm UTC](https://discourse.julialang.org/t/help-calling-fortran-subroutines-using-ccall/98572 "2023-05-09T20:02:20Z")

</div>

Hi, I’m trying to replicate SWxTREC/pymsis in Julia, specifically the fortran call of the following subroutines (pymsis/src/wrappers at main · SWxTREC/pymsis · GitHub). To do so, I have created the following fortran scri…

---

## [CSV.Row very slow for reading files line by line](https://discourse.julialang.org/t/csv-row-very-slow-for-reading-files-line-by-line/98563)

<div class="topic-metadata">

**Author:** [@amael](https://discourse.julialang.org/u/amael)\
**Replies:** 0\
**Last updated:** [May 9, 2023, 4:39pm UTC](https://discourse.julialang.org/t/csv-row-very-slow-for-reading-files-line-by-line/98563 "2023-05-09T16:39:20Z")

</div>

Hi @stevengj @quinnj @CodeGodz, I’m trying to use CSV.Row as well as ViewReader to read files line by line as efficiently as possible (following the topic ViewReader discussion). Ultimately the goal is to process on the…

---

## [Where do these allocations come from?](https://discourse.julialang.org/t/where-do-these-allocations-come-from/98549)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 4\
**Last updated:** [May 9, 2023, 4:29pm UTC](https://discourse.julialang.org/t/where-do-these-allocations-come-from/98549 "2023-05-09T16:29:13Z")

</div>

I want to write a function g(w, x...) with the following properties: If none of the arguments following w is a vector, then the tuple x is appended to w (a vector). For each of the other vector arguments, the function sh…

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

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