# General Usage

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

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

**Page:** 134

---

## [QuantumOptics.jl Time dependent Hamiltonian definition](https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-definition/119287)

<div class="topic-metadata">

**Author:** [@Bruno\_Piveta](https://discourse.julialang.org/u/Bruno_Piveta)\
**Replies:** 0\
**Last updated:** [September 11, 2024, 4:30pm UTC](https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-definition/119287 "2024-09-11T16:30:51Z")

</div>

I’m having some problems trying to implement the evolution of a time dependent Hamiltonian using the TimeDependentSum method, as recommended in the documentation. In the documentation the Hamiltonian H = sin(t)\*sigmax i…

---

## [Complexity/implementation of disjoint-set (union-find) in \`DataStructures.jl\`](https://discourse.julialang.org/t/complexity-implementation-of-disjoint-set-union-find-in-datastructures-jl/119050)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 4\
**Last updated:** [September 11, 2024, 4:11pm UTC](https://discourse.julialang.org/t/complexity-implementation-of-disjoint-set-union-find-in-datastructures-jl/119050 "2024-09-11T16:11:10Z")

</div>

I didn’t see it in the docs and am trying to identify what algorithm is used in the implementation of find (and union) in the DisjointSets object in the DataStructures.jl package. find The docs say that “path compressi…

---

## [Julia regularly crashing when trying to use packages](https://discourse.julialang.org/t/julia-regularly-crashing-when-trying-to-use-packages/115829)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 32\
**Last updated:** [September 11, 2024, 2:12pm UTC](https://discourse.julialang.org/t/julia-regularly-crashing-when-trying-to-use-packages/115829 "2024-09-11T14:12:44Z")

</div>

I originally thought this was a VSCode issue but it seems to just happen most times I try and use a package since I can reproduce this inside of a terminal. If I startup Julia and try and use a package, 90% of the time I…

---

## [Keep dimensionality of slices](https://discourse.julialang.org/t/keep-dimensionality-of-slices/119261)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [September 10, 2024, 11:48pm UTC](https://discourse.julialang.org/t/keep-dimensionality-of-slices/119261 "2024-09-10T23:48:52Z")

</div>

The slices are rows internally but they come out as columns. julia\> let x = \[1 2 3 4 5 6 7 8\] collect(first(eachslice(x; dims=1))) end 4-element Vector{Int64}: 1 2 3 4 How can …

---

## [Finding function definition in package](https://discourse.julialang.org/t/finding-function-definition-in-package/119243)

<div class="topic-metadata">

**Author:** [@el\_desesperado](https://discourse.julialang.org/u/el_desesperado)\
**Replies:** 2\
**Last updated:** [September 10, 2024, 7:28pm UTC](https://discourse.julialang.org/t/finding-function-definition-in-package/119243 "2024-09-10T19:28:19Z")

</div>

I am trying to understand how a particular package is working and I don’t know how to find the definitions of some functions. I can Ctrl click some functions to go to the definitions but others I don’t know how to reach,…

---

## [Why do simple arithmetics cause weird Precision bugs](https://discourse.julialang.org/t/why-do-simple-arithmetics-cause-weird-precision-bugs/119218)

<div class="topic-metadata">

**Author:** [@The\_Mastermage](https://discourse.julialang.org/u/The_Mastermage)\
**Replies:** 10\
**Last updated:** [September 10, 2024, 11:44am UTC](https://discourse.julialang.org/t/why-do-simple-arithmetics-cause-weird-precision-bugs/119218 "2024-09-10T11:44:49Z")

</div>

Why does it happen when i do 295.8 - 360.0 that i am returned with -64.19999999999999 I know this has something todo with Loss of Precission due to the way floating point numbers work. But i Find it a bit weird that …

---

## [Corrupted double-linked list DifferentialEquations.jl](https://discourse.julialang.org/t/corrupted-double-linked-list-differentialequations-jl/119120)

<div class="topic-metadata">

**Author:** [@mm-crj](https://discourse.julialang.org/u/mm-crj)\
**Replies:** 4\
**Last updated:** [September 10, 2024, 9:13am UTC](https://discourse.julialang.org/t/corrupted-double-linked-list-differentialequations-jl/119120 "2024-09-10T09:13:20Z")

</div>

I am trying to solve a large system of odes as a finite volume discretisation of the heat equation on an unstructured mesh. However, as I approach the 10-15k equations mark, by deceasing grid size the solvers start to fa…

---

## [Where is the excessive memory consumption](https://discourse.julialang.org/t/where-is-the-excessive-memory-consumption/119174)

<div class="topic-metadata">

**Author:** [@Betristor](https://discourse.julialang.org/u/Betristor)\
**Replies:** 13\
**Last updated:** [September 10, 2024, 6:20am UTC](https://discourse.julialang.org/t/where-is-the-excessive-memory-consumption/119174 "2024-09-10T06:20:53Z")

</div>

I have a JuMP model with about 0.2 billion variables. Gurobi reports 50 GB of memory consumption and htop reports consistent 350 GB of memory consumption during solving. I’m most curious about the excessive memory consu…

---

## [Closing files when using CSV.Rows](https://discourse.julialang.org/t/closing-files-when-using-csv-rows/29169)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 3\
**Last updated:** [September 9, 2024, 11:37pm UTC](https://discourse.julialang.org/t/closing-files-when-using-csv-rows/29169 "2024-09-09T23:37:20Z")

</div>

I’m using CSV.Rows to iterate through a very large CSV file. In base Julia, files that are opened with open should be closed with close (or you can use the do syntax instead). However, after perusing the CSV.jl docs, the…

---

## [Rolling Median vs Rolling Mean:](https://discourse.julialang.org/t/rolling-median-vs-rolling-mean/119227)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://discourse.julialang.org/u/GeodeticR)\
**Replies:** 6\
**Last updated:** [September 9, 2024, 10:23pm UTC](https://discourse.julialang.org/t/rolling-median-vs-rolling-mean/119227 "2024-09-09T22:23:11Z")

</div>

Hi all; I have a questions that I am hoping someone smarter than me (not a difficult thing to be) can help me out with. I am smoothing out some GPS/GNSS data and I am wondering why at many of the “excursions” the absol…

---

## [Binding non-trivial C++ examples using CxxWrap.jl](https://discourse.julialang.org/t/binding-non-trivial-c-examples-using-cxxwrap-jl/119228)

<div class="topic-metadata">

**Author:** [@bthorne93](https://discourse.julialang.org/u/bthorne93)\
**Replies:** 0\
**Last updated:** [September 9, 2024, 9:31pm UTC](https://discourse.julialang.org/t/binding-non-trivial-c-examples-using-cxxwrap-jl/119228 "2024-09-09T21:31:56Z")

</div>

I am trying to write Julia bindings for a C++ library with types that depend on other types. It is unclear from the CxxWrap.jl docs or examples how to deal with this case. An example of the interdependent C++ structs are…

---

## [GC problems surfaced... there is a reason Julia can't have void references. How do I make a type-stable entity update system?](https://discourse.julialang.org/t/gc-problems-surfaced-there-is-a-reason-julia-cant-have-void-references-how-do-i-make-a-type-stable-entity-update-system/118971)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 24\
**Last updated:** [September 9, 2024, 4:04pm UTC](https://discourse.julialang.org/t/gc-problems-surfaced-there-is-a-reason-julia-cant-have-void-references-how-do-i-make-a-type-stable-entity-update-system/118971 "2024-09-09T16:04:19Z")

</div>

Imagine I had a list of entities, and an update function. However, updating them could pose a challenge as the type of each group of entity is different. So, what if I use the function wrapper? But then, how do I store …

---

## [Help me learn concurrency: live manipulation of continuous sound](https://discourse.julialang.org/t/help-me-learn-concurrency-live-manipulation-of-continuous-sound/119150)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 9\
**Last updated:** [September 9, 2024, 3:41pm UTC](https://discourse.julialang.org/t/help-me-learn-concurrency-live-manipulation-of-continuous-sound/119150 "2024-09-09T15:41:04Z")

</div>

I have a program here that plays a continuous tone. If you press the ‘r’ key, the pitch rises. If you press ‘f’, the pitch falls. If you press ‘q’, the program quits. The first while loop continuously takes in keyboard i…

---

## [OffsetArray of size 1 from elementwise multiplication](https://discourse.julialang.org/t/offsetarray-of-size-1-from-elementwise-multiplication/119135)

<div class="topic-metadata">

**Author:** [@liamh](https://discourse.julialang.org/u/liamh)\
**Replies:** 3\
**Last updated:** [September 9, 2024, 2:57pm UTC](https://discourse.julialang.org/t/offsetarray-of-size-1-from-elementwise-multiplication/119135 "2024-09-09T14:57:53Z")

</div>

When I elementwise multiply an offset array by a regular array, I get the result I expect - the resulting array is offset properly - except when the size is 1. In this example, the input array dimension is 6:10, and the…

---

## [A macro to inspect global variables used in a function?](https://discourse.julialang.org/t/a-macro-to-inspect-global-variables-used-in-a-function/119119)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 3\
**Last updated:** [September 9, 2024, 2:22pm UTC](https://discourse.julialang.org/t/a-macro-to-inspect-global-variables-used-in-a-function/119119 "2024-09-09T14:22:43Z")

</div>

Hello, When packing inside a function a code previously developed on the Main module in the command line (e.g. work done in a Jupyter notebook), it’s easy to forget to put parameters as function arguments. See e.g. this…

---

## [A puzzling result with a simple calculation](https://discourse.julialang.org/t/a-puzzling-result-with-a-simple-calculation/119118)

<div class="topic-metadata">

**Author:** [@grahamstark](https://discourse.julialang.org/u/grahamstark)\
**Replies:** 36\
**Last updated:** [September 9, 2024, 12:05pm UTC](https://discourse.julialang.org/t/a-puzzling-result-with-a-simple-calculation/119118 "2024-09-09T12:05:11Z")

</div>

Hi, is this an anomaly? julia\> 6/2(2+1) 1.0 against, with an explicit times operator: julia\> 6/2\*(2+1) 9.0 (this was prompted by a video on Dave Cutler’s channel). Using Julia 1.10.3. Graham

---

## [Unitful and generic function types](https://discourse.julialang.org/t/unitful-and-generic-function-types/119198)

<div class="topic-metadata">

**Author:** [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)\
**Replies:** 3\
**Last updated:** [September 9, 2024, 5:50am UTC](https://discourse.julialang.org/t/unitful-and-generic-function-types/119198 "2024-09-09T05:50:15Z")

</div>

I have a function not using Unitful that reads like function foo(x :: Matrix{T}, y :: Vector{T}) where T my\_array = zeros(T, 100) # other stuff end Now, I want to implement my code using Unitful to make it eas…

---

## [Package extension version restriction](https://discourse.julialang.org/t/package-extension-version-restriction/108571)

<div class="topic-metadata">

**Author:** [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Replies:** 0\
**Last updated:** [January 9, 2024, 3:57pm UTC](https://discourse.julialang.org/t/package-extension-version-restriction/108571 "2024-01-09T15:57:50Z")

</div>

Hi everyone, I’m having some issues with the package extensions. Recently I’ve added Makie as an extension to my data processing package Batsrus.jl. I listed Makie.jl in the \[weakdeps\] and added the \[compat\] info for it…

---

## [\`Vector{Function}\` behaves strangely when length is one](https://discourse.julialang.org/t/vector-function-behaves-strangely-when-length-is-one/119197)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 3\
**Last updated:** [September 8, 2024, 8:11pm UTC](https://discourse.julialang.org/t/vector-function-behaves-strangely-when-length-is-one/119197 "2024-09-08T20:11:09Z")

</div>

julia\> f(x)=x+1 f (generic function with 1 method) julia\> isa(f, Function) true julia\> typeof(\[f\]) Vector{typeof(f)} (alias for Array{typeof(f), 1}) julia\> f1(x)=x+1 f1 (generic function with 1 method) julia\> typeof(…

---

## [Is Symbolics.jl incompatible with plotting, cannot convert Num to subtype, MethodError: no method matching Float64(::Num)](https://discourse.julialang.org/t/is-symbolics-jl-incompatible-with-plotting-cannot-convert-num-to-subtype-methoderror-no-method-matching-float64-num/119183)

<div class="topic-metadata">

**Author:** [@MonkeyZK](https://discourse.julialang.org/u/MonkeyZK)\
**Replies:** 5\
**Last updated:** [September 8, 2024, 8:02pm UTC](https://discourse.julialang.org/t/is-symbolics-jl-incompatible-with-plotting-cannot-convert-num-to-subtype-methoderror-no-method-matching-float64-num/119183 "2024-09-08T20:02:01Z")

</div>

I was trying to write the analyical solution of a cantilever beam problem as a symbolic expressions and I ran into a problem when I had just finished substituting the variables by numerical values and I wanted to plot t…

---

## [Understanding a Julia codebase, or, How do you navigate inter-package specializations?](https://discourse.julialang.org/t/understanding-a-julia-codebase-or-how-do-you-navigate-inter-package-specializations/119173)

<div class="topic-metadata">

**Author:** [@jbkcc](https://discourse.julialang.org/u/jbkcc)\
**Replies:** 6\
**Last updated:** [September 8, 2024, 4:44pm UTC](https://discourse.julialang.org/t/understanding-a-julia-codebase-or-how-do-you-navigate-inter-package-specializations/119173 "2024-09-08T16:44:43Z")

</div>

I have a specific question, but I think it’s an instance of a general question. The general question is: suppose some funny behavior is happening when you use a library written in Julia, and that it’s not obvious where t…

---

## [Is this \`Test.detect\_unbound\_args\` result valid or a bug?](https://discourse.julialang.org/t/is-this-test-detect-unbound-args-result-valid-or-a-bug/96987)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 3\
**Last updated:** [September 8, 2024, 4:23pm UTC](https://discourse.julialang.org/t/is-this-test-detect-unbound-args-result-valid-or-a-bug/96987 "2024-09-08T16:23:31Z")

</div>

A module: module M f(::Tuple{}) = nothing f(::NTuple{n, F}) where {n, F} = F end The second method gets flagged as having an unbound argument, even though the first method protects it from ever being called in such…

---

## [Cannot install FTS extension in DuckDB](https://discourse.julialang.org/t/cannot-install-fts-extension-in-duckdb/117996)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 28\
**Last updated:** [September 8, 2024, 11:25am UTC](https://discourse.julialang.org/t/cannot-install-fts-extension-in-duckdb/117996 "2024-09-08T11:25:06Z")

</div>

I cannot install the fts extension in DuckDB. The docs say it should auto-install, but it reports that it fails. I have also tried to install manually using DBInterface.execute(con, "INSTALL fts FROM 'http://extensi…

---

## [Symbolics to Float64](https://discourse.julialang.org/t/symbolics-to-float64/119022)

<div class="topic-metadata">

**Author:** [@Paul\_Warburton](https://discourse.julialang.org/u/Paul_Warburton)\
**Replies:** 19\
**Last updated:** [September 8, 2024, 9:38am UTC](https://discourse.julialang.org/t/symbolics-to-float64/119022 "2024-09-08T09:38:33Z")

</div>

I have the output from symbolics\_solve What am I to do with this? Can someone tell me how to access this information in a usable form as in I want the maximum value for this output ? The answer should be π\*2 + π va…

---

## [Stack with new axis last](https://discourse.julialang.org/t/stack-with-new-axis-last/119090)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 2\
**Last updated:** [September 7, 2024, 2:45pm UTC](https://discourse.julialang.org/t/stack-with-new-axis-last/119090 "2024-09-07T14:45:05Z")

</div>

This makes a 5×2×3 array. If I want instead a 2×3×5 array, can I do it by passing ;dims= or do I need to permutedims afterwards? julia\> a = map(collect∘join, (Iterators.product((\["AB", "CD"\], \["rst", "uvw", "xyz"\])...))…

---

## [Minecraft nuclearcraft optimization problem](https://discourse.julialang.org/t/minecraft-nuclearcraft-optimization-problem/119058)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 6\
**Last updated:** [September 8, 2024, 7:37am UTC](https://discourse.julialang.org/t/minecraft-nuclearcraft-optimization-problem/119058 "2024-09-08T07:37:51Z")

</div>

I have a toy optimization problem for you. Out of all the Minecraft mods, nuclearcraft stood out to me, particularly, the fission reactors. Unlike other items in the mod itself or other mods, fission reactor in nuclearc…

---

## [Benchmark game challenge and some optimization questions](https://discourse.julialang.org/t/benchmark-game-challenge-and-some-optimization-questions/79653)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 29\
**Last updated:** [January 13, 2024, 7:12pm UTC](https://discourse.julialang.org/t/benchmark-game-challenge-and-some-optimization-questions/79653 "2024-01-13T19:12:59Z")

</div>

First the good news, at the Debian benchmark game, clicking “summary stats”: I see the top graph showing Julia is best for “Geometric Mean - Time plus Source Code size”. \[Then further down a similar graph, at first co…

---

## [What is precompiled in a package by default?](https://discourse.julialang.org/t/what-is-precompiled-in-a-package-by-default/119128)

<div class="topic-metadata">

**Author:** [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Replies:** 4\
**Last updated:** [September 7, 2024, 7:44pm UTC](https://discourse.julialang.org/t/what-is-precompiled-in-a-package-by-default/119128 "2024-09-07T19:44:20Z")

</div>

I’m sorry if this should be common knowledge, but somehow I haven’t been able to find any explicit information on this. I’m just wondering what (if anything) is precompiled in a package that doesn’t have any precompile s…

---

## [Use CxxWrap with embedded julia without shared lib](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 4\
**Last updated:** [September 7, 2024, 7:43pm UTC](https://discourse.julialang.org/t/use-cxxwrap-with-embedded-julia-without-shared-lib/119159 "2024-09-07T19:43:34Z")

</div>

From example i saw that cxxwrap define some module like this int greet() { return 12; } void define\_julia\_module(jlcxx::Module& mod) { mod.method("greet", &greet); } We could create jlcxx::Module ++ several w…

---

## [Is it possible to use embedded julia without julia installed](https://discourse.julialang.org/t/is-it-possible-to-use-embedded-julia-without-julia-installed/119145)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 5\
**Last updated:** [September 7, 2024, 4:58pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-embedded-julia-without-julia-installed/119145 "2024-09-07T16:58:32Z")

</div>

Hi. Hope for community member experience! Im trying to extend my c++ app with power of julia. But i cant figure out some important questions: Should julia be installed on another computer Could i provide some library…

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

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