# General Usage

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

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

**Page:** 106

---

## [Save() with px\_per\_unit rescales display of plot (how to unzoom)](https://discourse.julialang.org/t/save-with-px-per-unit-rescales-display-of-plot-how-to-unzoom/123506)

<div class="topic-metadata">

**Author:** [@devel-chm](https://discourse.julialang.org/u/devel-chm)\
**Replies:** 2\
**Last updated:** [December 5, 2024, 9:55pm UTC](https://discourse.julialang.org/t/save-with-px-per-unit-rescales-display-of-plot-how-to-unzoom/123506 "2024-12-05T21:55:42Z")

</div>

I’m using GLMakie v0.10.16 for plotting with save(png\_filename,fig,px\_per\_unit=3) to output the plot for presentation/printing. However, when I do that, the pixel scaling is applied to the current display and the Ctrl…

---

## [How to use juliac with imported packages?](https://discourse.julialang.org/t/how-to-use-juliac-with-imported-packages/123511)

<div class="topic-metadata">

**Author:** [@TheHedgehog2000](https://discourse.julialang.org/u/TheHedgehog2000)\
**Replies:** 5\
**Last updated:** [December 5, 2024, 7:37pm UTC](https://discourse.julialang.org/t/how-to-use-juliac-with-imported-packages/123511 "2024-12-05T19:37:44Z")

</div>

I am trying to use juliac to turn some code into an executable. The following minimal example works: module HelloWorld Base.@ccallable function main()::Cint println(Core.stdout, "Hello, World!") return 0 end e…

---

## [Is there any way to use QtCharts 6 in QML.jl?](https://discourse.julialang.org/t/is-there-any-way-to-use-qtcharts-6-in-qml-jl/123497)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 0\
**Last updated:** [December 5, 2024, 1:45pm UTC](https://discourse.julialang.org/t/is-there-any-way-to-use-qtcharts-6-in-qml-jl/123497 "2024-12-05T13:45:53Z")

</div>

Hi! We are missing the package Qt6Charts\_jll so that we can use QtCharts with QML out-of-the-box. I have already opened an issue to track this feature request (Support for QtCharts 6 · Issue #210 · JuliaGraphics/QML.jl …

---

## [Nested iteration in comprehension](https://discourse.julialang.org/t/nested-iteration-in-comprehension/123437)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 8\
**Last updated:** [December 5, 2024, 12:46pm UTC](https://discourse.julialang.org/t/nested-iteration-in-comprehension/123437 "2024-12-05T12:46:16Z")

</div>

I was expecting the following to read a file into an N x M array of characters: load(file) = \[c for l in eachline(file), c in l\] where the file’s contents are: MMMSXXMASM MSAMXMSMSA AMXSXMAAMM MSAMASMSMX XMASAMXAMM XX…

---

## [Simple recursive Fibonaci example. How to make it faster?](https://discourse.julialang.org/t/simple-recursive-fibonaci-example-how-to-make-it-faster/32369)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 40\
**Last updated:** [December 5, 2024, 12:26pm UTC](https://discourse.julialang.org/t/simple-recursive-fibonaci-example-how-to-make-it-faster/32369 "2024-12-05T12:26:10Z")

</div>

I’ve found this benchmark comparing several languages with a simple Fibonaci code. https://github.com/drujensen/fib function fib(n) if n \<= 1 return 1 end return fib(n - 1) + fib(n - 2) end @btime(fib(46)) Julia …

---

## [OOM and saving solutions of \`SDEProblem\` only at specific timepoints](https://discourse.julialang.org/t/oom-and-saving-solutions-of-sdeproblem-only-at-specific-timepoints/123450)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 2\
**Last updated:** [December 5, 2024, 9:33am UTC](https://discourse.julialang.org/t/oom-and-saving-solutions-of-sdeproblem-only-at-specific-timepoints/123450 "2024-12-05T09:33:33Z")

</div>

For large systems, I am running into memory issues (which lead to crashes) when solving an SDEProblem with an adaptive scheme. I have found that these are related to the dense output of the solver, yet I just cannot seem…

---

## [@cfunction with CxxWrap arguments](https://discourse.julialang.org/t/cfunction-with-cxxwrap-arguments/123473)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 1\
**Last updated:** [December 5, 2024, 9:31am UTC](https://discourse.julialang.org/t/cfunction-with-cxxwrap-arguments/123473 "2024-12-05T09:31:14Z")

</div>

Hi! Is it possible to get pointer by @function if this function argument is CxxWrap binded struct? Class binding types.add\_type\<DataBase\>("Database") .method("GetProperty", &DataBase::getProperty); and julia funct…

---

## [How to use OpenCV.jl's calibrateCamera correctly?](https://discourse.julialang.org/t/how-to-use-opencv-jls-calibratecamera-correctly/113765)

<div class="topic-metadata">

**Author:** [@Kadii](https://discourse.julialang.org/u/Kadii)\
**Replies:** 6\
**Last updated:** [December 4, 2024, 11:46pm UTC](https://discourse.julialang.org/t/how-to-use-opencv-jls-calibratecamera-correctly/113765 "2024-12-04T23:46:50Z")

</div>

Hi, I’m trying to reproduce :OpenCV: Camera Calibration using OpenCV.jl. I made some adjustments but could not figure out how to properly pass the arguments to cv.calibrateCamera. 1st and 2nd arguments I passed were Ve…

---

## [Numpy.sort vs Julia sort](https://discourse.julialang.org/t/numpy-sort-vs-julia-sort/123421)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 10\
**Last updated:** [December 4, 2024, 10:17pm UTC](https://discourse.julialang.org/t/numpy-sort-vs-julia-sort/123421 "2024-12-04T22:17:08Z")

</div>

I recently tried numpy.sort and it is really fast for a vector of 100 millions floats. It seems to be parallelized by default and/or using AVX-512. It is like 5 times faster on my system. If someone has a benchmark vs J…

---

## [Parse json to vector{T} for known T](https://discourse.julialang.org/t/parse-json-to-vector-t-for-known-t/123469)

<div class="topic-metadata">

**Author:** [@kingoslo](https://discourse.julialang.org/u/kingoslo)\
**Replies:** 1\
**Last updated:** [December 4, 2024, 8:07pm UTC](https://discourse.julialang.org/t/parse-json-to-vector-t-for-known-t/123469 "2024-12-04T20:07:06Z")

</div>

Am trying to use the JSON package to parse “\[1,2,3\]” to a vector{Int64}. I notice that the parse method has optional arguments dicttype and inttype. But it seems that whatever I give as as dicttype and inttype the funct…

---

## [How to use \`readdlm\` to read in a Matrix{Char}](https://discourse.julialang.org/t/how-to-use-readdlm-to-read-in-a-matrix-char/123464)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 2\
**Last updated:** [December 4, 2024, 7:40pm UTC](https://discourse.julialang.org/t/how-to-use-readdlm-to-read-in-a-matrix-char/123464 "2024-12-04T19:40:28Z")

</div>

Sometimes it’s useful to read in the file as a matrix of characters, in other words, split on empty char – but currently, readdlm(path, dlm::Char) the second argument has to be a Char and there’s no empty Char. am I miss…

---

## [Showing list of package changes?](https://discourse.julialang.org/t/showing-list-of-package-changes/123462)

<div class="topic-metadata">

**Author:** [@dgleich](https://discourse.julialang.org/u/dgleich)\
**Replies:** 2\
**Last updated:** [December 4, 2024, 4:37pm UTC](https://discourse.julialang.org/t/showing-list-of-package-changes/123462 "2024-12-04T16:37:12Z")

</div>

Is there any way to get the list of package changes in response to changing to a new version that would occur without actually changing them? (i.e. a “dry-run” option?) For instance, if I have a large project and do: (…

---

## [Passing GMP variables from C(++) to Julia](https://discourse.julialang.org/t/passing-gmp-variables-from-c-to-julia/123167)

<div class="topic-metadata">

**Author:** [@Questioner](https://discourse.julialang.org/u/Questioner)\
**Replies:** 9\
**Last updated:** [December 4, 2024, 3:38pm UTC](https://discourse.julialang.org/t/passing-gmp-variables-from-c-to-julia/123167 "2024-12-04T15:38:07Z")

</div>

Hello there, let me start by thanking the entirely altruistic help; in the long run, I hope to contribute to Julia myself. Unfortunately, I’ve run into another issue: I’d like to convert a GNU MP type (such as mpz\_t) i…

---

## [Cmdline option/shortcut for activate --temp?](https://discourse.julialang.org/t/cmdline-option-shortcut-for-activate-temp/53956)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 6\
**Last updated:** [December 4, 2024, 3:12pm UTC](https://discourse.julialang.org/t/cmdline-option-shortcut-for-activate-temp/53956 "2024-12-04T15:12:02Z")

</div>

Do we have a command line option to start julia with a temporary environment, instead of having to manually \] activate --temp? I imagine something like julia --project=@temp. If not, what do you think, should we add some…

---

## [Excel's pivot table equivalent with DataFramesMeta](https://discourse.julialang.org/t/excels-pivot-table-equivalent-with-dataframesmeta/123456)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [December 4, 2024, 2:44pm UTC](https://discourse.julialang.org/t/excels-pivot-table-equivalent-with-dataframesmeta/123456 "2024-12-04T14:44:33Z")

</div>

Hello, So I have a table like df = DataFrame(a= \[1,1,2,2\], b = \[1,2,1,2\], c = \[1,2,3,4\]) And I would like to create a table that, if I were to work in Excel, I could obtain with a pivot table with a for the Rows and b …

---

## [Arbitrary \`:meta\` expression AST nodes for a linter](https://discourse.julialang.org/t/arbitrary-meta-expression-ast-nodes-for-a-linter/123455)

<div class="topic-metadata">

**Author:** [@0x0f0f0f](https://discourse.julialang.org/u/0x0f0f0f)\
**Replies:** 0\
**Last updated:** [December 4, 2024, 2:09pm UTC](https://discourse.julialang.org/t/arbitrary-meta-expression-ast-nodes-for-a-linter/123455 "2024-12-04T14:09:47Z")

</div>

I’m building some tooling that performs static analysis of Julia code, which is similar to eslint in some ways. It’s currently using Expr and Expronicon.jl for parsing and pattern matching with MLStyle.jl. Let’s call it C…

---

## [Embedding Julia and multiple foreign threads](https://discourse.julialang.org/t/embedding-julia-and-multiple-foreign-threads/123394)

<div class="topic-metadata">

**Author:** [@peremato](https://discourse.julialang.org/u/peremato)\
**Replies:** 3\
**Last updated:** [December 4, 2024, 1:51pm UTC](https://discourse.julialang.org/t/embedding-julia-and-multiple-foreign-threads/123394 "2024-12-04T13:51:14Z")

</div>

The embedding documentation says clearly that you can only use the functions jl\_...() from a single foreign thread in which you have called jl\_init(). The question is, has anything changed with respect this restriction i…

---

## [Daytona.io - an open-source Development Environment Manager - Julia usage?](https://discourse.julialang.org/t/daytona-io-an-open-source-development-environment-manager-julia-usage/123011)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 3\
**Last updated:** [December 4, 2024, 12:01pm UTC](https://discourse.julialang.org/t/daytona-io-an-open-source-development-environment-manager-julia-usage/123011 "2024-12-04T12:01:40Z")

</div>

Hello, I recently read a LinkedIn post about Daytona.io. Daytona.io is an open-source Development Environment Manager designed to simplify and streamline the process of setting up development environments\[1\]\[3\]. Key fe…

---

## [Adding \[sources\] information for a dependency which is in a subdirectory](https://discourse.julialang.org/t/adding-sources-information-for-a-dependency-which-is-in-a-subdirectory/121104)

<div class="topic-metadata">

**Author:** [@SamBrand](https://discourse.julialang.org/u/SamBrand)\
**Replies:** 5\
**Last updated:** [December 4, 2024, 11:39am UTC](https://discourse.julialang.org/t/adding-sources-information-for-a-dependency-which-is-in-a-subdirectory/121104 "2024-12-04T11:39:32Z")

</div>

Hi everyone, In a current project I’m using Pkg.add(url="url/to/pkg", subdir = "in/this/subdir") . Now with 1.11 there is a \[sources\] section of the Project.toml file that makes this approach just a little bit nicer (e.…

---

## [How exactly is deepcopy defined?](https://discourse.julialang.org/t/how-exactly-is-deepcopy-defined/6445)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 12\
**Last updated:** [December 4, 2024, 10:58am UTC](https://discourse.julialang.org/t/how-exactly-is-deepcopy-defined/6445 "2024-12-04T10:58:47Z")

</div>

Observe the following: julia\> a = \[8,7,6\] 3-element Array{Int64,1}: 8 7 6 julia\> b = \[a,a\] 2-element Array{Array{Int64,1},1}: \[8, 7, 6\] \[8, 7, 6\] julia\> c=deepcopy(b) 2-element Array{Array{Int64,1},1}: \[8, 7, 6\] …

---

## [Does stdlib network sockets use only first thread?](https://discourse.julialang.org/t/does-stdlib-network-sockets-use-only-first-thread/123027)

<div class="topic-metadata">

**Author:** [@Pedro](https://discourse.julialang.org/u/Pedro)\
**Replies:** 6\
**Last updated:** [December 4, 2024, 10:16am UTC](https://discourse.julialang.org/t/does-stdlib-network-sockets-use-only-first-thread/123027 "2024-12-04T10:16:17Z")

</div>

I am writing a multi-threaded applications with a GUI (CImGui.jl) and a network sockets (Base.Sockets) to handle low-latency data stream over local network via UDP. I have a few independent threads to handle data proces…

---

## [How (best) to transform a huge DataFrame into wide-format](https://discourse.julialang.org/t/how-best-to-transform-a-huge-dataframe-into-wide-format/123415)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 8\
**Last updated:** [December 4, 2024, 10:14am UTC](https://discourse.julialang.org/t/how-best-to-transform-a-huge-dataframe-into-wide-format/123415 "2024-12-04T10:14:13Z")

</div>

I have a DataFrame with columns like open, high, low, close, and vol for multiple tickers, e.g. df1 = DataFrame( date\_time = repeat(\["2024-12-02T14:30:00", "2024-12-02T16:00:00","2024-12-02T17:30:00", "2024-12-02T19:00:…

---

## [Extend julia module](https://discourse.julialang.org/t/extend-julia-module/123407)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 7\
**Last updated:** [December 4, 2024, 10:02am UTC](https://discourse.julialang.org/t/extend-julia-module/123407 "2024-12-04T10:02:25Z")

</div>

Hi. I try to understand modules in julia. And cant figure out how to extend julia module. Suppose i have a module: module Test t :: Float64 = 0 end how to add new function or variable to the module from another …

---

## [Evaluate MvNormal pdf on gpu array](https://discourse.julialang.org/t/evaluate-mvnormal-pdf-on-gpu-array/123443)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 0\
**Last updated:** [December 4, 2024, 9:45am UTC](https://discourse.julialang.org/t/evaluate-mvnormal-pdf-on-gpu-array/123443 "2024-12-04T09:45:04Z")

</div>

Is there a way to evaluate MvNormal densities on GPU data? using Distributions, CUDA julia\> logpdf(MvNormal((rand(2)), (diagm(rand(2)))), rand(2)) -1.251537609209612 julia\> logpdf(MvNormal(cu(rand(2)), cu(diagm(rand(2…

---

## [How to achieve collision-free "hash codes" in one single Julia session?](https://discourse.julialang.org/t/how-to-achieve-collision-free-hash-codes-in-one-single-julia-session/123428)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 2\
**Last updated:** [December 3, 2024, 11:08pm UTC](https://discourse.julialang.org/t/how-to-achieve-collision-free-hash-codes-in-one-single-julia-session/123428 "2024-12-03T23:08:19Z")

</div>

I have many mixed composite-type instances that I need to compare their equality (by ===) when I don’t necessarily (want to) have access to them directly. I do not want to directly store a reference (like Ref or a struc…

---

## [Symbolics islinear issue](https://discourse.julialang.org/t/symbolics-islinear-issue/123423)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 4\
**Last updated:** [December 3, 2024, 10:30pm UTC](https://discourse.julialang.org/t/symbolics-islinear-issue/123423 "2024-12-03T22:30:10Z")

</div>

Why the equation below is triggering islinear assertion if the equation is linear? julia\> f = 2x -4 == 0 (-4 + 2x) == 0 julia\> symbolic\_linear\_solve(f, x) ERROR: AssertionError: islinear Stacktrace: \[1\] symbolic\_linea…

---

## [Experiments with LoopVectorization and convolutions](https://discourse.julialang.org/t/experiments-with-loopvectorization-and-convolutions/123188)

<div class="topic-metadata">

**Author:** [@Marco\_Lombardi](https://discourse.julialang.org/u/Marco_Lombardi)\
**Replies:** 24\
**Last updated:** [December 3, 2024, 8:35pm UTC](https://discourse.julialang.org/t/experiments-with-loopvectorization-and-convolutions/123188 "2024-12-03T20:35:27Z")

</div>

I have been doing some experiments with the great LoopVectorization for convolution, and I must admit that in spite of my efforts to manually refactor my code, I have been unable to even approach the speed that this pack…

---

## [Wrapping kw-based Parameters.jl constructor, for deprecation](https://discourse.julialang.org/t/wrapping-kw-based-parameters-jl-constructor-for-deprecation/122909)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 4\
**Last updated:** [December 3, 2024, 6:21pm UTC](https://discourse.julialang.org/t/wrapping-kw-based-parameters-jl-constructor-for-deprecation/122909 "2024-12-03T18:21:14Z")

</div>

I have a config object like this: using Parameters @with\_kw mutable struct Config "Param 1" param1::Float64 # ... several other items ... "Whether to iterate randomly." use\_random::Bool = false en…

---

## [Error in trying to use Optimization.jl for LSTM training based on Lux.jl](https://discourse.julialang.org/t/error-in-trying-to-use-optimization-jl-for-lstm-training-based-on-lux-jl/123335)

<div class="topic-metadata">

**Author:** [@chooron](https://discourse.julialang.org/u/chooron)\
**Replies:** 2\
**Last updated:** [December 3, 2024, 5:56pm UTC](https://discourse.julialang.org/t/error-in-trying-to-use-optimization-jl-for-lstm-training-based-on-lux-jl/123335 "2024-12-03T17:56:29Z")

</div>

Hello, I want to try using Optimization.jl to perform model optimization based on Lux.jl. Here’s my code. using Lux using Zygote using StableRNGs using ComponentArrays using Optimization using OptimizationOptimisers fu…

---

## [Time period conversion to seconds, for plotting](https://discourse.julialang.org/t/time-period-conversion-to-seconds-for-plotting/123422)

<div class="topic-metadata">

**Author:** [@merlin](https://discourse.julialang.org/u/merlin)\
**Replies:** 2\
**Last updated:** [December 3, 2024, 5:07pm UTC](https://discourse.julialang.org/t/time-period-conversion-to-seconds-for-plotting/123422 "2024-12-03T17:07:07Z")

</div>

Meganecroposting here because of this problem I ran into while trying to format ticks on a logarithmic x-axis that represents time intervals. using Dates convert(Second, Week(100)) 60480000 seconds convert(Second, Mon…

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

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