# General Usage

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

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

**Page:** 190

---

## [UndefVarError: HierarchicalClustering not defined](https://discourse.julialang.org/t/undefvarerror-hierarchicalclustering-not-defined/97767)

<div class="topic-metadata">

**Author:** [@Selly\_Shivute](https://discourse.julialang.org/u/Selly_Shivute)\
**Replies:** 14\
**Last updated:** [March 12, 2024, 11:36am UTC](https://discourse.julialang.org/t/undefvarerror-hierarchicalclustering-not-defined/97767 "2024-03-12T11:36:24Z")

</div>

i m trying create a HierarchicalClustering using linkage but i m getting UndefVarError: HierarchicalClustering not defined… the package is installed

---

## [Isposdef() true with small negative eigenvalues?](https://discourse.julialang.org/t/isposdef-true-with-small-negative-eigenvalues/111504)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 3\
**Last updated:** [March 12, 2024, 7:51am UTC](https://discourse.julialang.org/t/isposdef-true-with-small-negative-eigenvalues/111504 "2024-03-12T07:51:58Z")

</div>

Hi all, I’m puzzled by eigen() and isposdef() acting on r'r for this matrix r using LinearAlgebra r = \[ 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -1.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 -2.…

---

## [What is wrong with this function](https://discourse.julialang.org/t/what-is-wrong-with-this-function/111500)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 2\
**Last updated:** [March 12, 2024, 6:45am UTC](https://discourse.julialang.org/t/what-is-wrong-with-this-function/111500 "2024-03-12T06:45:40Z")

</div>

julia\> function setBit{I\<:Integer}(i::I,bit::Int64) return (i | (1 \<\< (bit-1)))::I end ERROR: UndefVarError: \`setBit\` not defined Stacktrace: \[1\] top-level scope @ REPL\[1\]:1 This function is from a…

---

## [Help Plotting with Ripserer](https://discourse.julialang.org/t/help-plotting-with-ripserer/111498)

<div class="topic-metadata">

**Author:** [@empty-inch](https://discourse.julialang.org/u/empty-inch)\
**Replies:** 0\
**Last updated:** [March 12, 2024, 3:12am UTC](https://discourse.julialang.org/t/help-plotting-with-ripserer/111498 "2024-03-12T03:12:01Z")

</div>

Hello! I am trying to use the Ripserer package to do some TDA on a time series, following the example here: Sublevel Set Persistent Homology · Ripserer.jl When I finished writing this post, I stumbled across a newer ver…

---

## [Failed to remove pidfile on close](https://discourse.julialang.org/t/failed-to-remove-pidfile-on-close/111497)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 0\
**Last updated:** [March 12, 2024, 1:38am UTC](https://discourse.julialang.org/t/failed-to-remove-pidfile-on-close/111497 "2024-03-12T01:38:53Z")

</div>

I am trying to run a Julia script on a Linux cluster, and I see the following warning/error. I use Distributed.jl package to addprocs. It would be helpful if someone could point at the exact cause and help resolve it! …

---

## [What does manifest\_usage.toml file do?](https://discourse.julialang.org/t/what-does-manifest-usage-toml-file-do/105633)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 6\
**Last updated:** [November 1, 2023, 7:39pm UTC](https://discourse.julialang.org/t/what-does-manifest-usage-toml-file-do/105633 "2023-11-01T19:39:12Z")

</div>

As the title says, what’s the purpose of manifest\_usage.toml? I have a Julia project that has its own project.toml and manifest.toml. When I try to test this project, I sometimes encounter an error that says: Activatin…

---

## [Derivatives at infinity issue](https://discourse.julialang.org/t/derivatives-at-infinity-issue/111445)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 15\
**Last updated:** [March 11, 2024, 10:07pm UTC](https://discourse.julialang.org/t/derivatives-at-infinity-issue/111445 "2024-03-11T22:07:39Z")

</div>

I am trying to implement L’Hôpital’s rule, and my first naive version looks like this: using ForwardDiff: derivative ∂(f) = x -\> derivative(f,x) function Hôpital(f,g,a) fₐ, gₐ = f(a), g(a) any(isnan.((fₐ,gₐ))) &&…

---

## [@btime alters subsequent @time result](https://discourse.julialang.org/t/btime-alters-subsequent-time-result/111384)

<div class="topic-metadata">

**Author:** [@chunjiw](https://discourse.julialang.org/u/chunjiw)\
**Replies:** 6\
**Last updated:** [March 11, 2024, 8:18pm UTC](https://discourse.julialang.org/t/btime-alters-subsequent-time-result/111384 "2024-03-11T20:18:31Z")

</div>

I’m trying to benchmark a struct implementation, where I encounter this. Minimal example: using BenchmarkTools struct S end (s::S)() = 1 let s = S() # @btime $s() @time s() end From which I get output 0.0…

---

## [String splatting inside comprehensions](https://discourse.julialang.org/t/string-splatting-inside-comprehensions/111464)

<div class="topic-metadata">

**Author:** [@cnaak](https://discourse.julialang.org/u/cnaak)\
**Replies:** 11\
**Last updated:** [March 11, 2024, 5:21pm UTC](https://discourse.julialang.org/t/string-splatting-inside-comprehensions/111464 "2024-03-11T17:21:52Z")

</div>

The following excerpt (taken from a julia-1.10.2 REPL) illustrates my question: julia\> src = ("Ab","Cd") ("Ab", "Cd") julia\> \[ "Ab"..., "Cd"... \] 4-element Vector{Char}: 'A': ASCII/Unicode U+0041 (category Lu: Letter,…

---

## [Compile errors on HPC](https://discourse.julialang.org/t/compile-errors-on-hpc/47264)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 11\
**Last updated:** [March 11, 2024, 4:55pm UTC](https://discourse.julialang.org/t/compile-errors-on-hpc/47264 "2024-03-11T16:55:16Z")

</div>

I am running code via slurm on an HPC. Most of the time, the code compiles without issue. Sometimes, it throws errors such as: \[lhendri@longleaf-login2 CollegeStrat\]$ cat ../log/hProdBounded.out ┌ Warning: The call to c…

---

## [Make Julia complete the inference of some recursive code](https://discourse.julialang.org/t/make-julia-complete-the-inference-of-some-recursive-code/111449)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 2\
**Last updated:** [March 11, 2024, 2:44pm UTC](https://discourse.julialang.org/t/make-julia-complete-the-inference-of-some-recursive-code/111449 "2024-03-11T14:44:47Z")

</div>

Background I have a function with a real number input coming from a finite interval. To implement the function, I break down that interval into several subintervals and implement the function on each of them. Suppose, fo…

---

## [Static array or tuple allocate at construction](https://discourse.julialang.org/t/static-array-or-tuple-allocate-at-construction/111447)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 2\
**Last updated:** [March 11, 2024, 9:11am UTC](https://discourse.julialang.org/t/static-array-or-tuple-allocate-at-construction/111447 "2024-03-11T09:11:28Z")

</div>

I have some code that allocates on the heap (and shouldn’t) while constructing a StaticArray. The hunt leads me to this MWE: using StaticArrays, BenchmarkTools @btime SVector{4,Float64}(2. \*i for i=1:4) # good, no…

---

## [Works in debugger, segfaults when compiled](https://discourse.julialang.org/t/works-in-debugger-segfaults-when-compiled/111385)

<div class="topic-metadata">

**Author:** [@mpeters2](https://discourse.julialang.org/u/mpeters2)\
**Replies:** 3\
**Last updated:** [March 11, 2024, 2:28am UTC](https://discourse.julialang.org/t/works-in-debugger-segfaults-when-compiled/111385 "2024-03-11T02:28:54Z")

</div>

I’m trying to translate some C/C++ code to take a screenshot of an SDL window. My code works in the debugger, but not in normal compiled mode. It’s based on the following C/C++ code: void SosariaInputController::SaveS…

---

## [Pecuzal Tmax](https://discourse.julialang.org/t/pecuzal-tmax/111436)

<div class="topic-metadata">

**Author:** [@ccccc](https://discourse.julialang.org/u/ccccc)\
**Replies:** 0\
**Last updated:** [March 10, 2024, 11:28pm UTC](https://discourse.julialang.org/t/pecuzal-tmax/111436 "2024-03-10T23:28:35Z")

</div>

Does anyone know what’s the relation of the PECUZAL algorithm to Tmax? What’s a reasonable Tmax to use? I had thought that length(dataset) ÷ 2 - 1 should be ok, but I get a bounds error when I go up this high (only, som…

---

## [Error when compiling PyCall with PackageCompiler.jl](https://discourse.julialang.org/t/error-when-compiling-pycall-with-packagecompiler-jl/111422)

<div class="topic-metadata">

**Author:** [@bd1](https://discourse.julialang.org/u/bd1)\
**Replies:** 0\
**Last updated:** [March 10, 2024, 1:17pm UTC](https://discourse.julialang.org/t/error-when-compiling-pycall-with-packagecompiler-jl/111422 "2024-03-10T13:17:09Z")

</div>

I wanted to use Julia code in my Python script via PyJulia. However, every time the JIT run takes too long, so I turned to PackageCompiler.jl to make it faster by compiling the required functions into a system image. I n…

---

## [Package to save/read defaults](https://discourse.julialang.org/t/package-to-save-read-defaults/111407)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 1\
**Last updated:** [March 10, 2024, 10:24am UTC](https://discourse.julialang.org/t/package-to-save-read-defaults/111407 "2024-03-10T10:24:35Z")

</div>

I’ve seen some time ago a post mentioning a package enabling to save and read package (and probably user) defaults. Unfortunately at the moment I didn’t need it, and now can’t remember the name, no can find the post. Any…

---

## [PowerDynamics read each vector from simulation](https://discourse.julialang.org/t/powerdynamics-read-each-vector-from-simulation/111416)

<div class="topic-metadata">

**Author:** [@Igor](https://discourse.julialang.org/u/Igor)\
**Replies:** 0\
**Last updated:** [March 10, 2024, 9:30am UTC](https://discourse.julialang.org/t/powerdynamics-read-each-vector-from-simulation/111416 "2024-03-10T09:30:52Z")

</div>

PowerDynamics.ju, Example\_node\_construction.ju I get solution = simulate(fault1, powergrid, operationpoint, timespan) How read own vector from solution? I try determin type julia\> typeof(solution1) PowerDynamics.P…

---

## [Creating a CLI app in Julia](https://discourse.julialang.org/t/creating-a-cli-app-in-julia/111160)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 7\
**Last updated:** [March 10, 2024, 8:40am UTC](https://discourse.julialang.org/t/creating-a-cli-app-in-julia/111160 "2024-03-10T08:40:31Z")

</div>

I have to share my code in a way that my non-programming colleagues can use it on their own. Currently there is a Julia function which accepts a path to an Excel file, containing all data and metadata, does processing, c…

---

## [Scalar and Arrays: indexing the same way?](https://discourse.julialang.org/t/scalar-and-arrays-indexing-the-same-way/111409)

<div class="topic-metadata">

**Author:** [@hsgg](https://discourse.julialang.org/u/hsgg)\
**Replies:** 5\
**Last updated:** [March 10, 2024, 4:36am UTC](https://discourse.julialang.org/t/scalar-and-arrays-indexing-the-same-way/111409 "2024-03-10T04:36:05Z")

</div>

I have a situation where an array of objects, say galaxies, can have either the same value for a property, or each has a different value. I would like to use the same function in both cases. For example, if the property …

---

## [Convert NamedTuple with matrix to DataFrame](https://discourse.julialang.org/t/convert-namedtuple-with-matrix-to-dataframe/111399)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 7\
**Last updated:** [March 9, 2024, 11:09pm UTC](https://discourse.julialang.org/t/convert-namedtuple-with-matrix-to-dataframe/111399 "2024-03-09T23:09:05Z")

</div>

Hello, I was wondering if there is a simple way to convert a NamedTuple with a mix of vectors and matrices, such as, np = (x = \[1 1; 1 2; 2 1; 2 2\], y = \[1,2,3,4\]) to a DataFrame, such as df = DataFrame(x1 = \[1,1,2,2…

---

## [Bit manipulations with llvmcall give strange results](https://discourse.julialang.org/t/bit-manipulations-with-llvmcall-give-strange-results/111403)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 11\
**Last updated:** [March 9, 2024, 10:58pm UTC](https://discourse.julialang.org/t/bit-manipulations-with-llvmcall-give-strange-results/111403 "2024-03-09T22:58:28Z")

</div>

I’m playing around with llvmcall. The following function g is supposed to convert x::UInt8 into an Int8 tuple of length N whose first 8 entries are the bits of x and the higher ones are zero. unvec(t::Tuple{Vararg{VecEl…

---

## [Makie.jl updating Observable causes "cannot convert a value to nothing for assignment"](https://discourse.julialang.org/t/makie-jl-updating-observable-causes-cannot-convert-a-value-to-nothing-for-assignment/111076)

<div class="topic-metadata">

**Author:** [@bryaan](https://discourse.julialang.org/u/bryaan)\
**Replies:** 3\
**Last updated:** [March 9, 2024, 9:10pm UTC](https://discourse.julialang.org/t/makie-jl-updating-observable-causes-cannot-convert-a-value-to-nothing-for-assignment/111076 "2024-03-09T21:10:15Z")

</div>

Since Makie does not have a mechanism for detecting axis limit updates I decided to make my own wrapper with Observables. I am having a strange error when triggering the notify in set\_xlims!. I think this is a deeper b…

---

## [@printf: significant digits in floating point representation](https://discourse.julialang.org/t/printf-significant-digits-in-floating-point-representation/29978)

<div class="topic-metadata">

**Author:** [@MatFi](https://discourse.julialang.org/u/MatFi)\
**Replies:** 12\
**Last updated:** [March 9, 2024, 8:58pm UTC](https://discourse.julialang.org/t/printf-significant-digits-in-floating-point-representation/29978 "2024-03-09T20:58:32Z")

</div>

hi i want tu use @sprintf to format a number to floating point representation with a fixed amount of significant digits how can I do that? The function shout act the following way: .000012340000 -\> 0.000012 .12340000…

---

## [BinaryBuild failure on Mac](https://discourse.julialang.org/t/binarybuild-failure-on-mac/111216)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 2\
**Last updated:** [March 9, 2024, 8:37pm UTC](https://discourse.julialang.org/t/binarybuild-failure-on-mac/111216 "2024-03-09T20:37:50Z")

</div>

Hi, I got an BinaryBuild compiler error on Mac (on Mac only) with /opt/x86\_64-apple-darwin14/x86\_64-apple-darwin14/sys-root/usr/include/hfs/hfs\_format.h:794:2: error: unknown type name 'uuid\_string\_t'; did you mean 'io…

---

## [Alternative to 7zip when installing packages](https://discourse.julialang.org/t/alternative-to-7zip-when-installing-packages/111141)

<div class="topic-metadata">

**Author:** [@jarroyoe](https://discourse.julialang.org/u/jarroyoe)\
**Replies:** 16\
**Last updated:** [March 9, 2024, 6:43pm UTC](https://discourse.julialang.org/t/alternative-to-7zip-when-installing-packages/111141 "2024-03-09T18:43:45Z")

</div>

I just started a job where 7zip is blocked as a potential security threat (I talked to IT about it and unblocking it is basically a nonnegotiable), which basically renders installing most packages impossible. Is there a…

---

## [Source location of a method defined by a macro](https://discourse.julialang.org/t/source-location-of-a-method-defined-by-a-macro/111402)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 0\
**Last updated:** [March 9, 2024, 6:02pm UTC](https://discourse.julialang.org/t/source-location-of-a-method-defined-by-a-macro/111402 "2024-03-09T18:02:31Z")

</div>

I’m having trouble getting the source location of a method definition to be correct. The method is defined by a macro. I would like for the source location of the method to be the location of the macro call, rather tha…

---

## [Impact of a local eval on performance](https://discourse.julialang.org/t/impact-of-a-local-eval-on-performance/111362)

<div class="topic-metadata">

**Author:** [@mnemnion](https://discourse.julialang.org/u/mnemnion)\
**Replies:** 14\
**Last updated:** [March 9, 2024, 4:47pm UTC](https://discourse.julialang.org/t/impact-of-a-local-eval-on-performance/111362 "2024-03-09T16:47:17Z")

</div>

Continuing the discussion from Eval a string with runtime defined functions: This can’t be the problem with local eval, because we can do that right now with plain-old eval: julia\> function global\_mutating(a, b) …

---

## [Equation handling in a MTK](https://discourse.julialang.org/t/equation-handling-in-a-mtk/111348)

<div class="topic-metadata">

**Author:** [@Sushrut\_Deshpande](https://discourse.julialang.org/u/Sushrut_Deshpande)\
**Replies:** 8\
**Last updated:** [March 9, 2024, 4:45pm UTC](https://discourse.julialang.org/t/equation-handling-in-a-mtk/111348 "2024-03-09T16:45:09Z")

</div>

Hello, I am playing with a toy problem. I apologies in advance if it is a trivial question. I am curious on how the equations of a model are handled. For example the following code gives expected results: using Model…

---

## ['dump' beyond stdout](https://discourse.julialang.org/t/dump-beyond-stdout/111346)

<div class="topic-metadata">

**Author:** [@improf](https://discourse.julialang.org/u/improf)\
**Replies:** 4\
**Last updated:** [March 9, 2024, 1:39pm UTC](https://discourse.julialang.org/t/dump-beyond-stdout/111346 "2024-03-09T13:39:00Z")

</div>

My Julia programs generally have number of mutable structs, each containing some multi-dimensional arrays. Sometimes I just want to quickly inspect what is going on with them and for that the best tool I found is dump. H…

---

## [Clearing axis cache on Julia REPL](https://discourse.julialang.org/t/clearing-axis-cache-on-julia-repl/111369)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 5\
**Last updated:** [March 9, 2024, 7:58am UTC](https://discourse.julialang.org/t/clearing-axis-cache-on-julia-repl/111369 "2024-03-09T07:58:39Z")

</div>

I have this program using PythonPlot x = \[1, 2\] y = Float64\[1.01, 1.02\] fig1 = pyplot.figure(1) ax1 = fig1.add\_subplot(1, 1, 1) plot(x, y, '.') pyplot.suptitle(L"title", fontsize=12) ax1.set\_ylabel(L"x \\ axis", fontsi…

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

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