# General Usage

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

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

**Page:** 109

---

## [Lambdify function to matrix](https://discourse.julialang.org/t/lambdify-function-to-matrix/123163)

<div class="topic-metadata">

**Author:** [@ccmejia](https://discourse.julialang.org/u/ccmejia)\
**Replies:** 2\
**Last updated:** [November 27, 2024, 5:57pm UTC](https://discourse.julialang.org/t/lambdify-function-to-matrix/123163 "2024-11-27T17:57:18Z")

</div>

Hi there! Im trying to obtain a 20x20 matrix from the next code fn = lambdify(t, \[V, g, k\]) ges = range(1, 2, 20); kes = range(1, 2, 20) fn.(1, ges, kes) But I obtain a vector… 20-element Vector{ComplexF64}: Functi…

---

## [Pkg: REPL \<-\> API equivalence](https://discourse.julialang.org/t/pkg-repl-api-equivalence/123177)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 4\
**Last updated:** [November 27, 2024, 4:42pm UTC](https://discourse.julialang.org/t/pkg-repl-api-equivalence/123177 "2024-11-27T16:42:15Z")

</div>

In order to automate the instantiation of projects in non-standard/complex cases, I sometimes write small setup.jl scripts relying on Pkg’s programmatic API. This is very nice, but I occasionally struggle finding the AP…

---

## [Comparison of tensor packages?](https://discourse.julialang.org/t/comparison-of-tensor-packages/11425)

<div class="topic-metadata">

**Author:** [@tparker](https://discourse.julialang.org/u/tparker)\
**Replies:** 29\
**Last updated:** [November 27, 2024, 4:07pm UTC](https://discourse.julialang.org/t/comparison-of-tensor-packages/11425 "2024-11-27T16:07:12Z")

</div>

Julia seems to have many different packages for tensor operations, like TensorFlow, TensorOperations, Tensors, TensorToolbox, and TensorWorkbench. Is there a general consensus as to which one(s) are the most useful? Coul…

---

## [Plotting with colorbar and NaN](https://discourse.julialang.org/t/plotting-with-colorbar-and-nan/123165)

<div class="topic-metadata">

**Author:** [@gasparalfaro](https://discourse.julialang.org/u/gasparalfaro)\
**Replies:** 2\
**Last updated:** [November 27, 2024, 3:46pm UTC](https://discourse.julialang.org/t/plotting-with-colorbar-and-nan/123165 "2024-11-27T15:46:41Z")

</div>

I found a code that I could execute a year ago (last time I executed was November 14th 2023, I think) but with packages updated as today it gives error. I could simplify the code to this MWE: y1 = \[1 2 3 ; 4 5 6; 7 8 9\]…

---

## [Expression Updating](https://discourse.julialang.org/t/expression-updating/123135)

<div class="topic-metadata">

**Author:** [@co1emi11er](https://discourse.julialang.org/u/co1emi11er)\
**Replies:** 2\
**Last updated:** [November 27, 2024, 3:35pm UTC](https://discourse.julialang.org/t/expression-updating/123135 "2024-11-27T15:35:39Z")

</div>

Say I have an expression block like the following: quote x = foo(args...) y = otherpackage.bar(args...) end I would like to turn that into the following: quote x = Module.foo(args...) y = Module.otherp…

---

## [Package to compute Hessian matrix numerically](https://discourse.julialang.org/t/package-to-compute-hessian-matrix-numerically/123151)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 2\
**Last updated:** [November 27, 2024, 1:23pm UTC](https://discourse.julialang.org/t/package-to-compute-hessian-matrix-numerically/123151 "2024-11-27T13:23:55Z")

</div>

Given numerical zᵢⱼ values defined over a regular 2D grid (xᵢⱼ, yᵢⱼ), is there a package to compute the Hessian matrix at each grid point?

---

## [Please help me to understand the \`OhMyThreads.jl\` parallel mutation example](https://discourse.julialang.org/t/please-help-me-to-understand-the-ohmythreads-jl-parallel-mutation-example/123114)

<div class="topic-metadata">

**Author:** [@scheidan1](https://discourse.julialang.org/u/scheidan1)\
**Replies:** 8\
**Last updated:** [November 27, 2024, 11:17am UTC](https://discourse.julialang.org/t/please-help-me-to-understand-the-ohmythreads-jl-parallel-mutation-example/123114 "2024-11-27T11:17:55Z")

</div>

Hi all, The documentation of OhMyThreads.jl contains an example of an apparently very simple parallelization: # Base.Threads using Base.Threads: @threads data = rand(10) @threads for i in eachindex(data) data\[i\] =…

---

## [Unexpected behavior of package loading in workers using Distributed](https://discourse.julialang.org/t/unexpected-behavior-of-package-loading-in-workers-using-distributed/122814)

<div class="topic-metadata">

**Author:** [@HanD](https://discourse.julialang.org/u/HanD)\
**Replies:** 7\
**Last updated:** [November 27, 2024, 10:32am UTC](https://discourse.julialang.org/t/unexpected-behavior-of-package-loading-in-workers-using-distributed/122814 "2024-11-27T10:32:55Z")

</div>

The following phenomenon gave me quite a headache and took me a while to track down. Take the following example (using Julia 1.11.1 or 1.10.6, probably older ones as well): julia\> using Distributed, Statistics julia\> a…

---

## [Type instability clarification](https://discourse.julialang.org/t/type-instability-clarification/123118)

<div class="topic-metadata">

**Author:** [@s\_amap](https://discourse.julialang.org/u/s_amap)\
**Replies:** 6\
**Last updated:** [November 27, 2024, 8:47am UTC](https://discourse.julialang.org/t/type-instability-clarification/123118 "2024-11-27T08:47:57Z")

</div>

Hi. I’m currently investigating performance and type stability matters relating to a package (and learning along the way). Here’s one type stability issue I don’t understand regarding a parametric type used in a variab…

---

## [Is it possible to enforce scheduler to instantly yield to specific task?](https://discourse.julialang.org/t/is-it-possible-to-enforce-scheduler-to-instantly-yield-to-specific-task/123133)

<div class="topic-metadata">

**Author:** [@Pedro](https://discourse.julialang.org/u/Pedro)\
**Replies:** 0\
**Last updated:** [November 27, 2024, 12:13am UTC](https://discourse.julialang.org/t/is-it-possible-to-enforce-scheduler-to-instantly-yield-to-specific-task/123133 "2024-11-27T00:13:27Z")

</div>

I writing a program with the aim of real-time and low-latency data processing that have multiple tasks running on a single thread. For two of those tasks, let’s call them A and B, I need a very tight synchronization on s…

---

## [Symbolics.jl rewrite rule](https://discourse.julialang.org/t/symbolics-jl-rewrite-rule/105041)

<div class="topic-metadata">

**Author:** [@Ian\_L](https://discourse.julialang.org/u/Ian_L)\
**Replies:** 2\
**Last updated:** [November 26, 2024, 10:55pm UTC](https://discourse.julialang.org/t/symbolics-jl-rewrite-rule/105041 "2024-11-26T22:55:38Z")

</div>

I defined the following rule: rlogexp = @rule log(exp(~x)) =\> ~x This seems to work for simple expressions: \> simplify(log(exp(x+3)), rewriter=rlogexp) 3+x However, this doesn’t seem to simplify \> simplify(log(exp(…

---

## [Symbolics.jl and predicates for pattern matching](https://discourse.julialang.org/t/symbolics-jl-and-predicates-for-pattern-matching/85202)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 1\
**Last updated:** [November 26, 2024, 10:42pm UTC](https://discourse.julialang.org/t/symbolics-jl-and-predicates-for-pattern-matching/85202 "2024-11-26T22:42:57Z")

</div>

I’m trying to translate some patterns written in Mathematica to Symbolics.jl to explore the latter package. I’m interested in conditions (e.g. type constraints) imposed on patterns. This is handled by “predicates” in Sym…

---

## [Function findall and overlapping](https://discourse.julialang.org/t/function-findall-and-overlapping/123126)

<div class="topic-metadata">

**Author:** [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Replies:** 3\
**Last updated:** [November 26, 2024, 9:42pm UTC](https://discourse.julialang.org/t/function-findall-and-overlapping/123126 "2024-11-26T21:42:00Z")

</div>

When I use the code findall("DD","DDDAADDD") I get the response 2-element Vector{UnitRange{Int64}}: 1:2 6:7 But perhaps the answer might include the others, such as 2:3 and 7:8? What am I missing here? The function…

---

## [Help with nested ForwardDiff.jl calculation](https://discourse.julialang.org/t/help-with-nested-forwarddiff-jl-calculation/123077)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 1\
**Last updated:** [November 26, 2024, 5:51pm UTC](https://discourse.julialang.org/t/help-with-nested-forwarddiff-jl-calculation/123077 "2024-11-26T17:51:00Z")

</div>

i’m trying to solve a non linear system of equations via newton’s method. the problem is along the lines of: f(model::Nothing,a,x) = sum(x)\*a + log(a/sum(x)) function g(model::Nothing,a,x) = ForwardDiff.gradient(z-\> f(m…

---

## [State Dependent Mass Matrix](https://discourse.julialang.org/t/state-dependent-mass-matrix/40238)

<div class="topic-metadata">

**Author:** [@321bwa](https://discourse.julialang.org/u/321bwa)\
**Replies:** 9\
**Last updated:** [November 26, 2024, 5:52pm UTC](https://discourse.julialang.org/t/state-dependent-mass-matrix/40238 "2024-11-26T17:52:29Z")

</div>

Hello, I’ve looked at the documentation for Handling Mass Matrices for DifferentialEquations.jl. In the example was a singular matrix. I would like to know how to implement a state dependent mass matrix, where the matri…

---

## [Gaussian Curvature calculation](https://discourse.julialang.org/t/gaussian-curvature-calculation/30037)

<div class="topic-metadata">

**Author:** [@Ameba\_Brain](https://discourse.julialang.org/u/Ameba_Brain)\
**Replies:** 8\
**Last updated:** [November 26, 2024, 5:06pm UTC](https://discourse.julialang.org/t/gaussian-curvature-calculation/30037 "2024-11-26T17:06:18Z")

</div>

Dear all, Please advise in which module can I find implementation of Gaussian Curvature of a surface? Something similar to the MATLAB function: Surface Curvature - File Exchange - MATLAB Central Thank you in advance

---

## [Define empty array with sizehint in single step](https://discourse.julialang.org/t/define-empty-array-with-sizehint-in-single-step/123082)

<div class="topic-metadata">

**Author:** [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Replies:** 6\
**Last updated:** [November 26, 2024, 3:12pm UTC](https://discourse.julialang.org/t/define-empty-array-with-sizehint-in-single-step/123082 "2024-11-26T15:12:34Z")

</div>

Is there a stdlib function to generate an empty array of a given type with a specific sizehint at construction time? Sometimes, push! based filling of arrays is just easier to write and read, even if you know exactly ho…

---

## [Resolve using local package and local\_julia\_registry](https://discourse.julialang.org/t/resolve-using-local-package-and-local-julia-registry/123062)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 3\
**Last updated:** [November 26, 2024, 2:56pm UTC](https://discourse.julialang.org/t/resolve-using-local-package-and-local-julia-registry/123062 "2024-11-26T14:56:19Z")

</div>

I have a Windows computer which is working fine and a Raspberry PI 4 with 8 Gig memory on Raspberry PI OS, a Debian derivative. On the Raspberry PI git always asks for a user name and password, where the password is the…

---

## [Function specialization based on values, not just types](https://discourse.julialang.org/t/function-specialization-based-on-values-not-just-types/123043)

<div class="topic-metadata">

**Author:** [@benc](https://discourse.julialang.org/u/benc)\
**Replies:** 18\
**Last updated:** [November 26, 2024, 12:42pm UTC](https://discourse.julialang.org/t/function-specialization-based-on-values-not-just-types/123043 "2024-11-26T12:42:38Z")

</div>

I’m working on Markov Chains where a lot of recursive functions have a mathematical parametric equation with a base case, simplified to function f(xs, 1) @info "Base case" end function f(xs, val) @info "Gene…

---

## [SVG to path sequence, that can be used by Luxor and Javis](https://discourse.julialang.org/t/svg-to-path-sequence-that-can-be-used-by-luxor-and-javis/103267)

<div class="topic-metadata">

**Author:** [@BuddhiLW](https://discourse.julialang.org/u/BuddhiLW)\
**Replies:** 9\
**Last updated:** [November 26, 2024, 4:49am UTC](https://discourse.julialang.org/t/svg-to-path-sequence-that-can-be-used-by-luxor-and-javis/103267 "2024-11-26T04:49:15Z")

</div>

Using this template: https://github.com/JuliaAnimators/Javis.jl/blob/main/examples/fourier.jl We have: Drawing() # julialogo needs a drawing julialogo(; action = :path, centered = true) shapes = pathtopoly(…

---

## [Fork and rename a repo](https://discourse.julialang.org/t/fork-and-rename-a-repo/122977)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 3\
**Last updated:** [November 26, 2024, 3:29am UTC](https://discourse.julialang.org/t/fork-and-rename-a-repo/122977 "2024-11-26T03:29:06Z")

</div>

I have a repo on my home computer, which I used to test some modules which are in private GitHub repos that my boss can see. I want to fork it into a new repo, which will go into another GitHub repo that my boss can see,…

---

## [PyCall pointing to correct venv but not picking up the correct path (likely related to .pythonstartup)](https://discourse.julialang.org/t/pycall-pointing-to-correct-venv-but-not-picking-up-the-correct-path-likely-related-to-pythonstartup/122922)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 2\
**Last updated:** [November 26, 2024, 2:51am UTC](https://discourse.julialang.org/t/pycall-pointing-to-correct-venv-but-not-picking-up-the-correct-path-likely-related-to-pythonstartup/122922 "2024-11-26T02:51:31Z")

</div>

Hi all, I have PyCall.jl configured to point towards my venv. For example: julia\> using PyCall julia\> PyCall.python "/home/colin/.pyvenv1/bin/python3" This is exactly where I want it to point. Next, I do the followin…

---

## [Dates/TimeZones clash when decoding string date with terminal Z](https://discourse.julialang.org/t/dates-timezones-clash-when-decoding-string-date-with-terminal-z/123025)

<div class="topic-metadata">

**Author:** [@bhalpin](https://discourse.julialang.org/u/bhalpin)\
**Replies:** 5\
**Last updated:** [November 25, 2024, 4:44pm UTC](https://discourse.julialang.org/t/dates-timezones-clash-when-decoding-string-date-with-terminal-z/123025 "2024-11-25T16:44:38Z")

</div>

Dates.DateTime() can decode string dates with a terminal Z (for UTC). However, if TimeZones has been loaded, it fails, even using the module name (Dates.DateTime()). What’s the best way of dealing with this? julia\> usi…

---

## [Binary dollar sign operator](https://discourse.julialang.org/t/binary-dollar-sign-operator/123046)

<div class="topic-metadata">

**Author:** [@phx](https://discourse.julialang.org/u/phx)\
**Replies:** 1\
**Last updated:** [November 25, 2024, 1:52pm UTC](https://discourse.julialang.org/t/binary-dollar-sign-operator/123046 "2024-11-25T13:52:25Z")

</div>

Hi everyone, I was reading an XML file describing a style for highlighting Julia syntax, when I noticed in the “operators” category the operators $ and $=. I only know $ for string interpolation, and that’s the only res…

---

## [How to import from indirect dependency to package extension](https://discourse.julialang.org/t/how-to-import-from-indirect-dependency-to-package-extension/123031)

<div class="topic-metadata">

**Author:** [@putianyi888](https://discourse.julialang.org/u/putianyi888)\
**Replies:** 4\
**Last updated:** [November 25, 2024, 10:28am UTC](https://discourse.julialang.org/t/how-to-import-from-indirect-dependency-to-package-extension/123031 "2024-11-25T10:28:31Z")

</div>

I’m writing a package extension, say ABExt.jl, where A and B are package names. B depends on C, fc is a method defined by C and not imported by B. I’d like to import fc to ABExt. I have two attempts so far: import B: f…

---

## [Why JLD2.jl is 40x slower than Arrow.jl](https://discourse.julialang.org/t/why-jld2-jl-is-40x-slower-than-arrow-jl/122217)

<div class="topic-metadata">

**Author:** [@Sixzero](https://discourse.julialang.org/u/Sixzero)\
**Replies:** 24\
**Last updated:** [November 25, 2024, 9:59am UTC](https://discourse.julialang.org/t/why-jld2-jl-is-40x-slower-than-arrow-jl/122217 "2024-11-25T09:59:38Z")

</div>

I have this gist: JLD2 is actually simply for reading in a 30 MB file with keys =\> randn(500) is 40x slower than Arrow.jl. How? I mean how come JLD2 generality sacrificed 40x speed difference?

---

## [Interpolation for missing data:](https://discourse.julialang.org/t/interpolation-for-missing-data/122829)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://discourse.julialang.org/u/GeodeticR)\
**Replies:** 10\
**Last updated:** [November 25, 2024, 4:02am UTC](https://discourse.julialang.org/t/interpolation-for-missing-data/122829 "2024-11-25T04:02:41Z")

</div>

Hi everyone: some background: I have a questions about data interpolation. I have some GPS station data which is missing data. This can occur for various reason (Software updates, hardware swaps, etc…). However, these …

---

## [Various BSODs when precompiling many packages in WSL on ARM64](https://discourse.julialang.org/t/various-bsods-when-precompiling-many-packages-in-wsl-on-arm64/119611)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 15\
**Last updated:** [November 24, 2024, 11:36pm UTC](https://discourse.julialang.org/t/various-bsods-when-precompiling-many-packages-in-wsl-on-arm64/119611 "2024-11-24T23:36:38Z")

</div>

I figured I should just post this in case others encounter this, because it seems like something that may be quite complicated to actually pin down. I have a Windows on ARM system (Surface Pro 11), and so need to run Ju…

---

## [DataFrames and MLJ](https://discourse.julialang.org/t/dataframes-and-mlj/122847)

<div class="topic-metadata">

**Author:** [@Jose\_Ghislain\_Quenum](https://discourse.julialang.org/u/Jose_Ghislain_Quenum)\
**Replies:** 4\
**Last updated:** [November 24, 2024, 7:04pm UTC](https://discourse.julialang.org/t/dataframes-and-mlj/122847 "2024-11-24T19:04:31Z")

</div>

Hi all, I am experiencing a weird behavior from Pluto. I have a dataset that contains more than 1M observations, although the size is about 75M. I’ve been able to cleanup the dataset and address the missing values. Howe…

---

## [Using a runtime-length \`SVector\` within a closure allocates memory](https://discourse.julialang.org/t/using-a-runtime-length-svector-within-a-closure-allocates-memory/123020)

<div class="topic-metadata">

**Author:** [@ferrolho](https://discourse.julialang.org/u/ferrolho)\
**Replies:** 6\
**Last updated:** [November 24, 2024, 5:40pm UTC](https://discourse.julialang.org/t/using-a-runtime-length-svector-within-a-closure-allocates-memory/123020 "2024-11-24T17:40:15Z")

</div>

Consider the Test struct below. julia\> using StaticArrays julia\> struct Test{T,V} x::Int v::V Test(x::Int, v::V) where {T\<:Real,V\<:AbstractVector{T}} = new{T,V}(x, v) end Let’s …

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

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