# General Usage

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

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

**Page:** 450

---

## [Excessive compilation time](https://discourse.julialang.org/t/excessive-compilation-time/81114)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 6\
**Last updated:** [May 15, 2022, 10:02pm UTC](https://discourse.julialang.org/t/excessive-compilation-time/81114 "2022-05-15T22:02:36Z")

</div>

I have a problem with excessive compilation time. The problem is with code automatically translated from another system (gap3) so I cannot easily change it. As an example, the function below takes 2 minutes to compile; a…

---

## [Ggplot2 does not accept the function "theme"](https://discourse.julialang.org/t/ggplot2-does-not-accept-the-function-theme/41474)

<div class="topic-metadata">

**Author:** [@thomas\_vilches](https://discourse.julialang.org/u/thomas_vilches)\
**Replies:** 8\
**Last updated:** [May 15, 2022, 7:29pm UTC](https://discourse.julialang.org/t/ggplot2-does-not-accept-the-function-theme/41474 "2022-05-15T19:29:16Z")

</div>

I am trying to use ggplot2 inside julia, because I am used to its usage and I think it makes nice plots. It works when making a basic plot, or using a “fixed theme” (such as theme\_bw). however, when using “theme()” in o…

---

## [Trying to write a macro that will cause a function to be traced](https://discourse.julialang.org/t/trying-to-write-a-macro-that-will-cause-a-function-to-be-traced/80847)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 5\
**Last updated:** [May 15, 2022, 4:39pm UTC](https://discourse.julialang.org/t/trying-to-write-a-macro-that-will-cause-a-function-to-be-traced/80847 "2022-05-15T16:39:15Z")

</div>

I want to be able to conitionally trace some of my methods, that is, to log the arguments and return values of each invocation. For example, given this function definition function hanoi(from, to, other, count) if …

---

## [Weird cygwin path mess](https://discourse.julialang.org/t/weird-cygwin-path-mess/31375)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 4\
**Last updated:** [November 22, 2019, 6:20pm UTC](https://discourse.julialang.org/t/weird-cygwin-path-mess/31375 "2019-11-22T18:20:18Z")

</div>

Julia is run in a cygwin window. It is julia\> versioninfo() Julia Version 1.3.0-rc4.1 Commit 8c4656b97a (2019-10-15 14:08 UTC) Platform Info: OS: Windows (x86\_64-w64-mingw32) CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.…

---

## [Reading a txt. file with two different delimiters](https://discourse.julialang.org/t/reading-a-txt-file-with-two-different-delimiters/81087)

<div class="topic-metadata">

**Author:** [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Replies:** 5\
**Last updated:** [May 15, 2022, 4:08pm UTC](https://discourse.julialang.org/t/reading-a-txt-file-with-two-different-delimiters/81087 "2022-05-15T16:08:05Z")

</div>

Hey guys, ich want to read in the following text file. So the first two rows are irrelevant, but the problem is that the file has space and ; as a delimiter. If I try to read in the file I get the following result: …

---

## [Pullback method error for Diagonal() call inside array generator](https://discourse.julialang.org/t/pullback-method-error-for-diagonal-call-inside-array-generator/81016)

<div class="topic-metadata">

**Author:** [@pr0physicist](https://discourse.julialang.org/u/pr0physicist)\
**Replies:** 4\
**Last updated:** [May 15, 2022, 1:28pm UTC](https://discourse.julialang.org/t/pullback-method-error-for-diagonal-call-inside-array-generator/81016 "2022-05-15T13:28:19Z")

</div>

Here’s a minimal example of an error I’ve encountered with my code using Flux. const x = zeros(Float32, 10, 4) p = Flux.params(x) function f() x1 = softmax(x, dims=2) x\_d = \[Diagonal(x1\[:, k\]) for k = 1:4\] x…

---

## [Specifying compat bounds via the REPL](https://discourse.julialang.org/t/specifying-compat-bounds-via-the-repl/81093)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 3\
**Last updated:** [May 15, 2022, 1:13pm UTC](https://discourse.julialang.org/t/specifying-compat-bounds-via-the-repl/81093 "2022-05-15T13:13:41Z")

</div>

For quite a while, I have wanted the ability to specify compat bounds from the REPL. I came across this PR after doing a search. Does anyone know when this will be added to Julia? As a related question, does the PR incl…

---

## [Allocations when calling eigen for hermitian 3x3 SMatrix](https://discourse.julialang.org/t/allocations-when-calling-eigen-for-hermitian-3x3-smatrix/80994)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 5\
**Last updated:** [May 15, 2022, 12:59pm UTC](https://discourse.julialang.org/t/allocations-when-calling-eigen-for-hermitian-3x3-smatrix/80994 "2022-05-15T12:59:56Z")

</div>

Hi, so today I found out that appearantly calling eigen on a hermitian 3x3 SMatrix{ComplexF64} allocates quite a bit of memory which I do not quite understand, since there are no allocations for a real matrix: using Sta…

---

## [ProcessExitedException while using Pardiso.jl](https://discourse.julialang.org/t/processexitedexception-while-using-pardiso-jl/81073)

<div class="topic-metadata">

**Author:** [@ahmed](https://discourse.julialang.org/u/ahmed)\
**Replies:** 0\
**Last updated:** [May 14, 2022, 8:01pm UTC](https://discourse.julialang.org/t/processexitedexception-while-using-pardiso-jl/81073 "2022-05-14T20:01:12Z")

</div>

I’m trying to learn Pardiso.jl to use it to do matrix factorization. The following code creates random Hermitian matrices and then do the numerical factorization on them. For some matrices, this works fine and sometimes …

---

## [How to efficiently construct a large SparseArray? Packages for this?](https://discourse.julialang.org/t/how-to-efficiently-construct-a-large-sparsearray-packages-for-this/64863)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 20\
**Last updated:** [May 15, 2022, 12:16pm UTC](https://discourse.julialang.org/t/how-to-efficiently-construct-a-large-sparsearray-packages-for-this/64863 "2022-05-15T12:16:10Z")

</div>

Problem Does Julia have an efficient way of constructing a huge sparse matrix from a given list of entries u,v,w, some of which can have the same locations u,v, and in that case, their weights w must be summed. Thus u,v,…

---

## [Integrator.sol.retcode does not update after reinit!(integrator)](https://discourse.julialang.org/t/integrator-sol-retcode-does-not-update-after-reinit-integrator/80417)

<div class="topic-metadata">

**Author:** [@Elyco](https://discourse.julialang.org/u/Elyco)\
**Replies:** 8\
**Last updated:** [May 15, 2022, 7:46am UTC](https://discourse.julialang.org/t/integrator-sol-retcode-does-not-update-after-reinit-integrator/80417 "2022-05-15T07:46:52Z")

</div>

Hi all, In my code I need to check the status of my integrator, and if it got terminated (because of my own callback) I want to know about that. But I have some difficulty with the MWE down below. It seems like the ret…

---

## [Creating a mesh with Meshes(need to use smoothing-Taubin) and getting afterwards a mesh compatible with Makie](https://discourse.julialang.org/t/creating-a-mesh-with-meshes-need-to-use-smoothing-taubin-and-getting-afterwards-a-mesh-compatible-with-makie/81029)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 1\
**Last updated:** [May 15, 2022, 1:34am UTC](https://discourse.julialang.org/t/creating-a-mesh-with-meshes-need-to-use-smoothing-taubin-and-getting-afterwards-a-mesh-compatible-with-makie/81029 "2022-05-15T01:34:03Z")

</div>

After doing some reading I did not found a way to create a simple mesh giving a set of points and then getting back a compatible mesh that can be plotted with Makie. Let’s say we have the following: using GLMakie Θ = L…

---

## [Why is this expression type unstable?](https://discourse.julialang.org/t/why-is-this-expression-type-unstable/80648)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 1\
**Last updated:** [May 9, 2022, 3:02am UTC](https://discourse.julialang.org/t/why-is-this-expression-type-unstable/80648 "2022-05-09T03:02:37Z")

</div>

I have the following function, and I’ve written two return statements which are identical in an input-output sense, but they have different syntax and mechanics. I like the format of the former statement because it’s a g…

---

## [UnStack dataframe with aggregated string column](https://discourse.julialang.org/t/unstack-dataframe-with-aggregated-string-column/81072)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 3\
**Last updated:** [May 14, 2022, 9:44pm UTC](https://discourse.julialang.org/t/unstack-dataframe-with-aggregated-string-column/81072 "2022-05-14T21:44:48Z")

</div>

Hello Can someone let me know if this is possible I have a dataframe like this \> julia\> df = DataFrame(x=\["a","a","b"\],y=\["x","x","y"\],z=\["l","m","n"\]) \> 3×3 DataFrame \> Row │ x y z \> │ String …

---

## [Automatically reimplement methods from one package to support equivalent type](https://discourse.julialang.org/t/automatically-reimplement-methods-from-one-package-to-support-equivalent-type/81074)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 0\
**Last updated:** [May 14, 2022, 8:10pm UTC](https://discourse.julialang.org/t/automatically-reimplement-methods-from-one-package-to-support-equivalent-type/81074 "2022-05-14T20:10:41Z")

</div>

Recently i’m have encountered an issue where i needed two packages. Package A exports a bunch of useful methods from some type T (also exported from A), and another package B that exported additional methods and a equiva…

---

## [Different inverse for almost equal matrices](https://discourse.julialang.org/t/different-inverse-for-almost-equal-matrices/81028)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 18\
**Last updated:** [May 14, 2022, 1:57pm UTC](https://discourse.julialang.org/t/different-inverse-for-almost-equal-matrices/81028 "2022-05-14T13:57:06Z")

</div>

Hello, I’m facing a problem and I do not know if it is due to precision errors or I may be doing something wrong. I have two square matrices A and B of type Array{Float64,2} with sizes size(A) = (120,120) and size(B) =…

---

## [Look for help for weird type inference](https://discourse.julialang.org/t/look-for-help-for-weird-type-inference/80834)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [May 14, 2022, 11:21am UTC](https://discourse.julialang.org/t/look-for-help-for-weird-type-inference/80834 "2022-05-14T11:21:00Z")

</div>

Hi there, I am the author of ExtensibleEffects.jl and am trying to optimize the package. I debugged a type-inference instability but am totally puzzled about the behaviour. I cannot easily minify it, but can show it to …

---

## [Is there a way to customize retcodes for different callback functions using DifferentialEquations?](https://discourse.julialang.org/t/is-there-a-way-to-customize-retcodes-for-different-callback-functions-using-differentialequations/81051)

<div class="topic-metadata">

**Author:** [@fsyhantis](https://discourse.julialang.org/u/fsyhantis)\
**Replies:** 1\
**Last updated:** [May 14, 2022, 8:45am UTC](https://discourse.julialang.org/t/is-there-a-way-to-customize-retcodes-for-different-callback-functions-using-differentialequations/81051 "2022-05-14T08:45:49Z")

</div>

I’m trying to solve odes using the package DifferentialEquations. The odes are constrained by several conditions. The solutions are terminated by different conditions. How should I determine the specific condition (co…

---

## [Stack overflow in type inference... julia 1.9.0-DEV](https://discourse.julialang.org/t/stack-overflow-in-type-inference-julia-1-9-0-dev/80694)

<div class="topic-metadata">

**Author:** [@jjiw](https://discourse.julialang.org/u/jjiw)\
**Replies:** 7\
**Last updated:** [May 14, 2022, 2:00am UTC](https://discourse.julialang.org/t/stack-overflow-in-type-inference-julia-1-9-0-dev/80694 "2022-05-14T02:00:31Z")

</div>

In following I show some code for the problem program, but don’t have a small demo for the problem, and at this point don’t have permission to post the whole 800-line program. I hope that someone can say what causes th…

---

## [Looking for book recommendations](https://discourse.julialang.org/t/looking-for-book-recommendations/80936)

<div class="topic-metadata">

**Author:** [@skypuppy](https://discourse.julialang.org/u/skypuppy)\
**Replies:** 18\
**Last updated:** [May 14, 2022, 12:20am UTC](https://discourse.julialang.org/t/looking-for-book-recommendations/80936 "2022-05-14T00:20:04Z")

</div>

Looking for books for Julia, I need one that takes my by the hand and leads me into the Julia REPL and then VScode environment. Also a book that gives the syntax for all (or most?) of the Julia primitives. Found one b…

---

## [Check if list of variables are defined](https://discourse.julialang.org/t/check-if-list-of-variables-are-defined/81024)

<div class="topic-metadata">

**Author:** [@jman87](https://discourse.julialang.org/u/jman87)\
**Replies:** 6\
**Last updated:** [May 13, 2022, 3:41pm UTC](https://discourse.julialang.org/t/check-if-list-of-variables-are-defined/81024 "2022-05-13T15:41:01Z")

</div>

Hi all, I’m trying to determine if a user has defined all the necessary input variables. I’d like to store the variable names in a list (either a tuple or array) and then be able to cycle through it and check if they’re…

---

## [Does Optim.jl calculate confidence interval?](https://discourse.julialang.org/t/does-optim-jl-calculate-confidence-interval/77698)

<div class="topic-metadata">

**Author:** [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Replies:** 17\
**Last updated:** [May 13, 2022, 3:03pm UTC](https://discourse.julialang.org/t/does-optim-jl-calculate-confidence-interval/77698 "2022-05-13T15:03:15Z")

</div>

Hello community, Does anyone know how to get confidence intervals from the result of Optim.jl? Thanks in advance!

---

## [\[Makie\] meshscatter with different axis scales](https://discourse.julialang.org/t/makie-meshscatter-with-different-axis-scales/81027)

<div class="topic-metadata">

**Author:** [@kunzaatko](https://discourse.julialang.org/u/kunzaatko)\
**Replies:** 0\
**Last updated:** [May 13, 2022, 2:52pm UTC](https://discourse.julialang.org/t/makie-meshscatter-with-different-axis-scales/81027 "2022-05-13T14:52:57Z")

</div>

I am using meshscatter for data that has a very different scale in the z axis. How would I go about it? My particular use-case is that I have points on an image 512×512 and the points of the third axis are somewhere in …

---

## [Receive callback if computer wakes from sleep on Windows](https://discourse.julialang.org/t/receive-callback-if-computer-wakes-from-sleep-on-windows/81015)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 0\
**Last updated:** [May 13, 2022, 12:59pm UTC](https://discourse.julialang.org/t/receive-callback-if-computer-wakes-from-sleep-on-windows/81015 "2022-05-13T12:59:21Z")

</div>

I’d like to get a callback when the computer wakes from sleep on Microsoft Windows. I see there are Windows APIs for this: and I’m a little familiar with calling c code but it’s talking about windows applications, servic…

---

## [Power electronics simulations with Julia](https://discourse.julialang.org/t/power-electronics-simulations-with-julia/80999)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [May 13, 2022, 11:38am UTC](https://discourse.julialang.org/t/power-electronics-simulations-with-julia/80999 "2022-05-13T11:38:37Z")

</div>

Are there any packages for the simulation of power electronics with Julia? Or did anybody look into this topic but did not create a package yet? I am looking for an open source alternative to PLECS | Plexim

---

## [Struct with partial explicit constructs that init subset of fields](https://discourse.julialang.org/t/struct-with-partial-explicit-constructs-that-init-subset-of-fields/79618)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 13\
**Last updated:** [May 13, 2022, 9:29am UTC](https://discourse.julialang.org/t/struct-with-partial-explicit-constructs-that-init-subset-of-fields/79618 "2022-05-13T09:29:27Z")

</div>

Hi, I have a struct with several fields, wherein various scenarios only some of them are filled. The total amount of combinations of which fields are filled is too big to have different types for each. For sake of simp…

---

## [Libreadstat not defined when using read\_dta from Pkg ReadStat](https://discourse.julialang.org/t/libreadstat-not-defined-when-using-read-dta-from-pkg-readstat/81004)

<div class="topic-metadata">

**Author:** [@Gast](https://discourse.julialang.org/u/Gast)\
**Replies:** 0\
**Last updated:** [May 13, 2022, 9:17am UTC](https://discourse.julialang.org/t/libreadstat-not-defined-when-using-read-dta-from-pkg-readstat/81004 "2022-05-13T09:17:40Z")

</div>

Hi all, I’m experiencing the following error when trying to import a dataset from Stata: UndefVarError: libreadstat not defined My code is the following: using Pkg, DataFrames, ReadStat Pkg.add("CSV") Pkg.add("Read…

---

## [Type parameter for each struct in \`Vararg\`](https://discourse.julialang.org/t/type-parameter-for-each-struct-in-vararg/80142)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 2\
**Last updated:** [May 13, 2022, 6:37am UTC](https://discourse.julialang.org/t/type-parameter-for-each-struct-in-vararg/80142 "2022-05-13T06:37:58Z")

</div>

I have the function f(args::Vararg{MyStruct{T, V}}) where {T,V}. However, I would actually like to allow the V’s to be completely different (possibly not even promotable) for different elements of the Vararg, but I would…

---

## [Large matrix operations involving inversion](https://discourse.julialang.org/t/large-matrix-operations-involving-inversion/80993)

<div class="topic-metadata">

**Author:** [@Rajesh\_Nakka](https://discourse.julialang.org/u/Rajesh_Nakka)\
**Replies:** 5\
**Last updated:** [May 13, 2022, 5:57am UTC](https://discourse.julialang.org/t/large-matrix-operations-involving-inversion/80993 "2022-05-13T05:57:35Z")

</div>

In a particular problem, I have the following set of three evaluations involving matrices A, B, C of the SparseMatrixCSC type as B' \* A^{-} \* B B' \* A^{-} \* C C' \* A^{-} \* C Here, shape(A) = (n, n) shape(B) = (n, p…

---

## [A question about how arrays work, how memory is allocated and what happen when chunks of code inside a function are moved into another function](https://discourse.julialang.org/t/a-question-about-how-arrays-work-how-memory-is-allocated-and-what-happen-when-chunks-of-code-inside-a-function-are-moved-into-another-function/80971)

<div class="topic-metadata">

**Author:** [@Andrea\_Vigliotti](https://discourse.julialang.org/u/Andrea_Vigliotti)\
**Replies:** 10\
**Last updated:** [May 13, 2022, 3:30am UTC](https://discourse.julialang.org/t/a-question-about-how-arrays-work-how-memory-is-allocated-and-what-happen-when-chunks-of-code-inside-a-function-are-moved-into-another-function/80971 "2022-05-13T03:30:32Z")

</div>

I am trying to understand how to speed up some code when going multithreading and I posted a question about this a few days ago here. while trying things out I encountered some behavior that I can’t explain, here it goe…

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

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