# General Usage

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

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

**Page:** 454

---

## [Tracking JIT compiled objects](https://discourse.julialang.org/t/tracking-jit-compiled-objects/80553)

<div class="topic-metadata">

**Author:** [@felipenoris](https://discourse.julialang.org/u/felipenoris)\
**Replies:** 1\
**Last updated:** [May 5, 2022, 6:35pm UTC](https://discourse.julialang.org/t/tracking-jit-compiled-objects/80553 "2022-05-05T18:35:22Z")

</div>

Hi! I’m getting a lot of memory consumption on my Julia sessions after running some heavy workloads. My best bet is that I’m JIT compiling too many functions and maybe I need to use nospecialize somewhere. What’s the b…

---

## [Minimising top-level project latency](https://discourse.julialang.org/t/minimising-top-level-project-latency/80546)

<div class="topic-metadata">

**Author:** [@danielsoutar](https://discourse.julialang.org/u/danielsoutar)\
**Replies:** 3\
**Last updated:** [May 5, 2022, 5:25pm UTC](https://discourse.julialang.org/t/minimising-top-level-project-latency/80546 "2022-05-05T17:25:03Z")

</div>

If I want to use a third-party package with minimal latency overhead, I can do so by having it precompiled. However, I am in the top-level project in a codebase that implements a complex pipeline and get this error when i…

---

## [Generating plots from the ALGORITHMS FOR OPTIMIZATION book by Kochenderfer et al](https://discourse.julialang.org/t/generating-plots-from-the-algorithms-for-optimization-book-by-kochenderfer-et-al/80552)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 2\
**Last updated:** [May 5, 2022, 5:06pm UTC](https://discourse.julialang.org/t/generating-plots-from-the-algorithms-for-optimization-book-by-kochenderfer-et-al/80552 "2022-05-05T17:06:26Z")

</div>

I was reading through the Algorithms for Optimization book by Kochenderfer and Wheeler. The books is replete with excellent julia code for running optimization algorithms. One challenge I have with the book is that they …

---

## [Julia not 220 times faster than C++](https://discourse.julialang.org/t/julia-not-220-times-faster-than-c/80512)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 10\
**Last updated:** [May 5, 2022, 4:11pm UTC](https://discourse.julialang.org/t/julia-not-220-times-faster-than-c/80512 "2022-05-05T16:11:22Z")

</div>

I have a small piece of code that I actually use in my simulation, and just compared the performance between C++ and Julia. One function call needs about 7ns with Julia and 1550 ns with C++ and Eigen3. Why is C++ so slo…

---

## [Smoothing tracks with a Kalman filter](https://discourse.julialang.org/t/smoothing-tracks-with-a-kalman-filter/24209)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 35\
**Last updated:** [May 5, 2022, 3:54pm UTC](https://discourse.julialang.org/t/smoothing-tracks-with-a-kalman-filter/24209 "2022-05-05T15:54:23Z")

</div>

Hi all, I have videos of dung beetles rolling balls of dung: The pixel coordinates of the beeltes’ locations (x,y per time) have been extracted from these videos. Using the calibrations of these videos, the pixel coo…

---

## [Dynamically Create and Destroy Modules (to avoid memory leaks in program synthesis)](https://discourse.julialang.org/t/dynamically-create-and-destroy-modules-to-avoid-memory-leaks-in-program-synthesis/39729)

<div class="topic-metadata">

**Author:** [@zennatavares](https://discourse.julialang.org/u/zennatavares)\
**Replies:** 6\
**Last updated:** [May 5, 2022, 2:52pm UTC](https://discourse.julialang.org/t/dynamically-create-and-destroy-modules-to-avoid-memory-leaks-in-program-synthesis/39729 "2022-05-05T14:52:17Z")

</div>

I’m trying to do some program synthesis in Julia. This means generating a lot of programs (Julia Exprs) evaluating them, and scoring them. These Expressions can create new types, structs, functions, etc. The most reas…

---

## [LoadError: ArgumentError: Converting an instance of ReverseDiff.TrackedReal{Float64, Float64, Nothing} to Float64 is not defined. Please use \`ReverseDiff.value\` instead](https://discourse.julialang.org/t/loaderror-argumenterror-converting-an-instance-of-reversediff-trackedreal-float64-float64-nothing-to-float64-is-not-defined-please-use-reversediff-value-instead/80544)

<div class="topic-metadata">

**Author:** [@beryl](https://discourse.julialang.org/u/beryl)\
**Replies:** 0\
**Last updated:** [May 5, 2022, 2:02pm UTC](https://discourse.julialang.org/t/loaderror-argumenterror-converting-an-instance-of-reversediff-trackedreal-float64-float64-nothing-to-float64-is-not-defined-please-use-reversediff-value-instead/80544 "2022-05-05T14:02:16Z")

</div>

Hi, I’d like to take a gradient of a simple function using ReverseDiff, however I stumbled upon an error which I haven’t been able figure out, the code which throws the error is using ReverseDiff function f\_V(R, a, b,…

---

## [Symmetrically permute a matrix](https://discourse.julialang.org/t/symmetrically-permute-a-matrix/80537)

<div class="topic-metadata">

**Author:** [@psanan](https://discourse.julialang.org/u/psanan)\
**Replies:** 1\
**Last updated:** [May 5, 2022, 11:39am UTC](https://discourse.julialang.org/t/symmetrically-permute-a-matrix/80537 "2022-05-05T11:39:38Z")

</div>

I’d like to symmetrically permute a matrix. For example, I want to transform \\left\[ \\begin{array}{ccc} 1 & 2 & 3 \\\\ 4 & 5 & 6 \\\\ 7 & 8 & 9\\end{array}\\right\] by rearranging the rows and columns according to the permuat…

---

## [Capturing the output of \`@time\` as a String](https://discourse.julialang.org/t/capturing-the-output-of-time-as-a-string/80524)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 2\
**Last updated:** [May 5, 2022, 11:26am UTC](https://discourse.julialang.org/t/capturing-the-output-of-time-as-a-string/80524 "2022-05-05T11:26:29Z")

</div>

I would like to print the output of a @time in a production environment. To avoid cluttering up the logs, I try to keep a bit of discipline with the logging so everything should use a log level. Now my question is, how c…

---

## [Comparison of IntervalArithmetic.jl and Measurements.jl](https://discourse.julialang.org/t/comparison-of-intervalarithmetic-jl-and-measurements-jl/80474)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 11\
**Last updated:** [May 5, 2022, 9:53am UTC](https://discourse.julialang.org/t/comparison-of-intervalarithmetic-jl-and-measurements-jl/80474 "2022-05-05T09:53:29Z")

</div>

I was just discussing with colleagues some of the classical theoretical oddities of interval arithmetic, in particular the fact that, for an interval X = \[a,b\], we have X-X \\neq 0 (we have instead only the inclusion 0 \\i…

---

## [Capturing functions defined in global scope](https://discourse.julialang.org/t/capturing-functions-defined-in-global-scope/80400)

<div class="topic-metadata">

**Author:** [@jbu](https://discourse.julialang.org/u/jbu)\
**Replies:** 9\
**Last updated:** [May 5, 2022, 9:24am UTC](https://discourse.julialang.org/t/capturing-functions-defined-in-global-scope/80400 "2022-05-05T09:24:17Z")

</div>

The Performance Tips discuss the drawbacks of capturing global variables inside of functions. Are there any performance penalties for capturing functions inside of other functions? For example, function predict(x) #…

---

## [Is there no declarative / functional solution for "between" problems?](https://discourse.julialang.org/t/is-there-no-declarative-functional-solution-for-between-problems/80528)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 2\
**Last updated:** [May 5, 2022, 9:11am UTC](https://discourse.julialang.org/t/is-there-no-declarative-functional-solution-for-between-problems/80528 "2022-05-05T09:11:56Z")

</div>

I was wondering what a more declarative approach is to the simple problem space of doing something between the elements of some iterator. I feel like that is a task that constantly comes up but can’t be solved with just m…

---

## [Which function is the inverse of the ellipsis?](https://discourse.julialang.org/t/which-function-is-the-inverse-of-the-ellipsis/80459)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 3\
**Last updated:** [May 5, 2022, 7:26am UTC](https://discourse.julialang.org/t/which-function-is-the-inverse-of-the-ellipsis/80459 "2022-05-05T07:26:33Z")

</div>

The ellipsis transforms a vector into a list of function arguments: (+)(\[1,2\]...) # 3 Is there a function foo that performs the inverse operation: foo3(x, y, z) = \[x, y, z\] # for the special case of three arguments f…

---

## [Julia Win10 - REPL and OhMyREPL - neat trick for nice copy/past - works in VsCode, WT, etc](https://discourse.julialang.org/t/julia-win10-repl-and-ohmyrepl-neat-trick-for-nice-copy-past-works-in-vscode-wt-etc/67662)

<div class="topic-metadata">

**Author:** [@ylvain](https://discourse.julialang.org/u/ylvain)\
**Replies:** 2\
**Last updated:** [May 5, 2022, 6:45am UTC](https://discourse.julialang.org/t/julia-win10-repl-and-ohmyrepl-neat-trick-for-nice-copy-past-works-in-vscode-wt-etc/67662 "2022-05-05T06:45:21Z")

</div>

First all credit goes to @ MarcMush for the idea in this thread (Apr 25). I only quasi-repost because there’s an added step for making it works with VsCode and because I stumbled on it after having be bogged down by the…

---

## [\`collect\` gives different result than \`for\` loop](https://discourse.julialang.org/t/collect-gives-different-result-than-for-loop/80509)

<div class="topic-metadata">

**Author:** [@MillironX](https://discourse.julialang.org/u/MillironX)\
**Replies:** 3\
**Last updated:** [May 4, 2022, 9:29pm UTC](https://discourse.julialang.org/t/collect-gives-different-result-than-for-loop/80509 "2022-05-04T21:29:29Z")

</div>

I’ve somehow created an iterator function where calling collect on the Alignment struct returns a 5-element vector, while iterating produces only three elements. Context: I’m working on a patch for BioAlignments (https:…

---

## [Pipe not working, unexpectedly](https://discourse.julialang.org/t/pipe-not-working-unexpectedly/80504)

<div class="topic-metadata">

**Author:** [@DorianT](https://discourse.julialang.org/u/DorianT)\
**Replies:** 4\
**Last updated:** [May 4, 2022, 8:38pm UTC](https://discourse.julialang.org/t/pipe-not-working-unexpectedly/80504 "2022-05-04T20:38:35Z")

</div>

\# throws error split("123456789", "") .|\> x -\> parse(Int8,x) |\> x -\> reshape(x, 3, 3) # works as expected A = split("123456789", "") .|\> x -\> parse(Int8,x) reshape(A, 3, 3) Hey guys :wave: Can someone explain me why pi…

---

## [Style Question: How should I write a long error message?](https://discourse.julialang.org/t/style-question-how-should-i-write-a-long-error-message/80502)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 2\
**Last updated:** [May 4, 2022, 8:12pm UTC](https://discourse.julialang.org/t/style-question-how-should-i-write-a-long-error-message/80502 "2022-05-04T20:12:07Z")

</div>

I’m writing a function that includes a long-winded error message. I can write it all on one line like this: error("Lorem interdum nescio ubi sordida iter ducis, interdum nec video cur. Ego coniecto ego servo in ludum p…

---

## [ISTA e FISTA](https://discourse.julialang.org/t/ista-e-fista/80498)

<div class="topic-metadata">

**Author:** [@DOUGLAS\_NASCIMENTO\_R](https://discourse.julialang.org/u/DOUGLAS_NASCIMENTO_R)\
**Replies:** 3\
**Last updated:** [May 4, 2022, 7:11pm UTC](https://discourse.julialang.org/t/ista-e-fista/80498 "2022-05-04T19:11:00Z")

</div>

I’m trying to implement ISTA and FISTA methods in Julia. Theoretically, the efficiency of FISTA is superior to that of ISTA. However in the computational results, I am getting that the complexity per iteration of ISTA …

---

## [Recursive definition of zero, one](https://discourse.julialang.org/t/recursive-definition-of-zero-one/80492)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 1\
**Last updated:** [May 4, 2022, 4:02pm UTC](https://discourse.julialang.org/t/recursive-definition-of-zero-one/80492 "2022-05-04T16:02:49Z")

</div>

Hi all, Imagine I have a data type like: struct foo{T,N} c::NTuple{N,T} end and I want to define the zero function import Base.zero zero(s::foo{T,N}) where {T,N} = foo{T,N}(ntuple(i -\> zero(T), N)) This allows me …

---

## [A Julia DataAnalysis Sysimage from PackageCompiler It's so easy you should do it too!](https://discourse.julialang.org/t/a-julia-dataanalysis-sysimage-from-packagecompiler-its-so-easy-you-should-do-it-too/68127)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 24\
**Last updated:** [May 4, 2022, 3:19pm UTC](https://discourse.julialang.org/t/a-julia-dataanalysis-sysimage-from-packagecompiler-its-so-easy-you-should-do-it-too/68127 "2022-05-04T15:19:57Z")

</div>

If you want to use Julia for the kind of thing where you might fire up R and read a couple CSV files into some DataFrames, maybe grab some data from a SQLite file, manipulate the data a little, make a few plots, and be d…

---

## [Saving LinearModel without data](https://discourse.julialang.org/t/saving-linearmodel-without-data/28889)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 3\
**Last updated:** [May 4, 2022, 2:53pm UTC](https://discourse.julialang.org/t/saving-linearmodel-without-data/28889 "2022-05-04T14:53:52Z")

</div>

My question: How can I save the results of a regression (say a LinearModel from GLM.jl) without the data that are stored inside the object? Context: I run several regressions using GLM.jl. At some point after all the …

---

## [Re-evaluate function in another module](https://discourse.julialang.org/t/re-evaluate-function-in-another-module/80472)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 1\
**Last updated:** [May 4, 2022, 1:30pm UTC](https://discourse.julialang.org/t/re-evaluate-function-in-another-module/80472 "2022-05-04T13:30:56Z")

</div>

Consider the following: module A export foo whoami() = "A" foo() = whoami() end module B using Main.A whoami() = "B" end B.foo() # "A" I understand why that’s the case but is there a way to call A…

---

## [Julia script using zmq works run from cli but NOT from cronjob](https://discourse.julialang.org/t/julia-script-using-zmq-works-run-from-cli-but-not-from-cronjob/80447)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 10\
**Last updated:** [May 4, 2022, 1:02pm UTC](https://discourse.julialang.org/t/julia-script-using-zmq-works-run-from-cli-but-not-from-cronjob/80447 "2022-05-04T13:02:49Z")

</div>

Hi there not sure if this is a linux ( I’m running linux mint 20.3) and have set up 3 cronjobs. the first starts a ZMQ PULL server that gets messages and println’s the messages to stdout which I pipe out to a text f…

---

## [Unexpected ambigiuity in subtype constructor](https://discourse.julialang.org/t/unexpected-ambigiuity-in-subtype-constructor/80475)

<div class="topic-metadata">

**Author:** [@sjrodahl](https://discourse.julialang.org/u/sjrodahl)\
**Replies:** 2\
**Last updated:** [May 4, 2022, 12:21pm UTC](https://discourse.julialang.org/t/unexpected-ambigiuity-in-subtype-constructor/80475 "2022-05-04T12:21:00Z")

</div>

Consider this example: julia\> abstract type AbstractT end julia\> struct A \<: AbstractT i::Int end julia\> struct Param myparam::Int end julia\> (::Type{T})(p::Param) where T\<:AbstractT …

---

## [How to sum elements raised to a power](https://discourse.julialang.org/t/how-to-sum-elements-raised-to-a-power/77013)

<div class="topic-metadata">

**Author:** [@ovt](https://discourse.julialang.org/u/ovt)\
**Replies:** 9\
**Last updated:** [May 4, 2022, 11:57am UTC](https://discourse.julialang.org/t/how-to-sum-elements-raised-to-a-power/77013 "2022-05-04T11:57:30Z")

</div>

Let’s assume that X is a matrix. I want to efficiently compute sum(X.^2) but without computing X.^2 which will allocate some memory for nothing. So I’m trying to do something like sum(^(2),X) which throws a method error.…

---

## [Parsing DateTime, what should be the default(s)?](https://discourse.julialang.org/t/parsing-datetime-what-should-be-the-default-s/80428)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 4\
**Last updated:** [May 4, 2022, 9:55am UTC](https://discourse.julialang.org/t/parsing-datetime-what-should-be-the-default-s/80428 "2022-05-04T09:55:00Z")

</div>

I CAN parse without the T, it’s just not the default: julia\> DateTime("2021-08-28 00:00:59", dateformat"yyyy-mm-dd HH:MM:SS.s") 2021-08-28T00:00:59 while: julia\> DateTime("2021-08-28 00:00:59") ERROR: ArgumentError: I…

---

## [Allow 3-argument sum in Julia?](https://discourse.julialang.org/t/allow-3-argument-sum-in-julia/80457)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 16\
**Last updated:** [May 4, 2022, 9:10am UTC](https://discourse.julialang.org/t/allow-3-argument-sum-in-julia/80457 "2022-05-04T09:10:52Z")

</div>

Julia’s sum accepts a function as a first argument, like sum(abs, arr). This feature becomes very useful and efficient in many situations when we want to apply the function on the array before sum. However, if the funct…

---

## [An analog to Common Lisp EQL specialization?](https://discourse.julialang.org/t/an-analog-to-common-lisp-eql-specialization/80380)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 6\
**Last updated:** [May 3, 2022, 7:25pm UTC](https://discourse.julialang.org/t/an-analog-to-common-lisp-eql-specialization/80380 "2022-05-03T19:25:02Z")

</div>

The Essentials section of the Julia documentation suggests that methods can be specalied on Val types. Perhaps I’m misunderstanding, but this seems analogous to Common Lisp’s EQL specialization. Assuming that’s the cas…

---

## [Bug with Pkg up? (for DifferentialEquations.jl)](https://discourse.julialang.org/t/bug-with-pkg-up-for-differentialequations-jl/80425)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 2\
**Last updated:** [May 3, 2022, 1:22pm UTC](https://discourse.julialang.org/t/bug-with-pkg-up-for-differentialequations-jl/80425 "2022-05-03T13:22:26Z")

</div>

I do: (@v1.9) pkg\> up --major DifferentialEquations@7.1.0 It took a lot of time, updated at least some other packages, even precompiled DifferentialEquations, but it’s still at older version. So if this is the wrong co…

---

## [Cannot use apps created with PackageCompiler that have LLVM.jl in them](https://discourse.julialang.org/t/cannot-use-apps-created-with-packagecompiler-that-have-llvm-jl-in-them/79986)

<div class="topic-metadata">

**Author:** [@thazhemadam](https://discourse.julialang.org/u/thazhemadam)\
**Replies:** 2\
**Last updated:** [May 3, 2022, 11:22am UTC](https://discourse.julialang.org/t/cannot-use-apps-created-with-packagecompiler-that-have-llvm-jl-in-them/79986 "2022-05-03T11:22:05Z")

</div>

I’m trying to create an app with LLVM.jl in it. The create\_app call runs successfully, but I get an error when I try to run the app itself because the LLVMExtra artifact is apparently not downloaded and set up while the…

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

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