# General Usage

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

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

**Page:** 15

---

## [How to get file encoding?](https://discourse.julialang.org/t/how-to-get-file-encoding/72325)

<div class="topic-metadata">

**Author:** [@mathdeep](https://discourse.julialang.org/u/mathdeep)\
**Replies:** 5\
**Last updated:** [March 24, 2026, 9:54am UTC](https://discourse.julialang.org/t/how-to-get-file-encoding/72325 "2026-03-24T09:54:46Z")

</div>

Hi there, Is there a way to find out how a file is encoded with functions? I’m getting a text file and want to do sume stuff. In order to do right stuff, I have to know how the file is encoded, but I can’t find how to …

---

## [Julia crashes on Fedora 43](https://discourse.julialang.org/t/julia-crashes-on-fedora-43/136350)

<div class="topic-metadata">

**Author:** [@stustd](https://discourse.julialang.org/u/stustd)\
**Replies:** 7\
**Last updated:** [March 23, 2026, 10:00pm UTC](https://discourse.julialang.org/t/julia-crashes-on-fedora-43/136350 "2026-03-23T22:00:23Z")

</div>

On my Fedora 43 machine, the system default julia-1.11 crashes. Compiling (with gcc-14) the latest release (julia-1.12) from the github source also gets stuck: ../build/gcc-14/usr/share/julia/Compiler/src/reinfer.jl ../…

---

## [Concise encoding of \`nothing\` in Arrow.jl](https://discourse.julialang.org/t/concise-encoding-of-nothing-in-arrow-jl/136348)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 0\
**Last updated:** [March 23, 2026, 7:57pm UTC](https://discourse.julialang.org/t/concise-encoding-of-nothing-in-arrow-jl/136348 "2026-03-23T19:57:58Z")

</div>

Arrow.jl encodes Union{Missing, T} concisely, but Union{Nothing, T} takes more space. using Arrow for (label, col) in \[ "Union{Missing,String}" =\> Union{Missing,String}\["a", missing, "b"\], "Union{Nothing,String…

---

## [AOT compilation error on Julia 1.12 due to strip-metadata or filter\_stdlibs](https://discourse.julialang.org/t/aot-compilation-error-on-julia-1-12-due-to-strip-metadata-or-filter-stdlibs/133218)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 3\
**Last updated:** [March 23, 2026, 7:08pm UTC](https://discourse.julialang.org/t/aot-compilation-error-on-julia-1-12-due-to-strip-metadata-or-filter-stdlibs/133218 "2026-03-23T19:08:14Z")

</div>

Normally I use create\_app from PackageCompiler.jl and it completes successfully on Julia 1.11 with complex case (multiple dependencies). On 1.12 it fails so I decided to narrow down the example. Using PackageCompiler 2.2…

---

## [Exposing julia packages to python users](https://discourse.julialang.org/t/exposing-julia-packages-to-python-users/136272)

<div class="topic-metadata">

**Author:** [@aris](https://discourse.julialang.org/u/aris)\
**Replies:** 13\
**Last updated:** [March 23, 2026, 10:24am UTC](https://discourse.julialang.org/t/exposing-julia-packages-to-python-users/136272 "2026-03-23T10:24:27Z")

</div>

Hello everyone. I have a Julia package which I would like to expose to python users. Seems the most obvious way would be using juliacall, similar to how diffeqpy seems to do it. I tried working with that approach for n…

---

## [Rolling forecast with StateSpaceModels.jl](https://discourse.julialang.org/t/rolling-forecast-with-statespacemodels-jl/136189)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 8\
**Last updated:** [March 23, 2026, 8:42am UTC](https://discourse.julialang.org/t/rolling-forecast-with-statespacemodels-jl/136189 "2026-03-23T08:42:42Z")

</div>

Hello, I have a question on using StateSpaceModels.jl to do a rolling window prediction of a time series. This means: At time t using past data y\_1...y\_t, predict h steps ahead (\\hat{y}\_{t+1|t} to \\hat{y}\_{t+h|t}). T…

---

## [Write nice representation of Flux chain to file](https://discourse.julialang.org/t/write-nice-representation-of-flux-chain-to-file/136338)

<div class="topic-metadata">

**Author:** [@Fourier](https://discourse.julialang.org/u/Fourier)\
**Replies:** 0\
**Last updated:** [March 23, 2026, 7:36am UTC](https://discourse.julialang.org/t/write-nice-representation-of-flux-chain-to-file/136338 "2026-03-23T07:36:09Z")

</div>

Hi, I am training some neural networks using Flux.jl. I noticed that the output of display is much nicer than the output of print and show. I am making a file for evaluating which architectures I think look promising. …

---

## [Trimming partially type erased functions](https://discourse.julialang.org/t/trimming-partially-type-erased-functions/136314)

<div class="topic-metadata">

**Author:** [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Replies:** 2\
**Last updated:** [March 22, 2026, 10:04pm UTC](https://discourse.julialang.org/t/trimming-partially-type-erased-functions/136314 "2026-03-22T22:04:43Z")

</div>

I’m using FunctionWrappers.jl to create type stable wrappers for functions I know input and output types. These functions are often closures created in local scopes. When trying to trim a function from FunctionWrappers.j…

---

## [Vector autoregressive models](https://discourse.julialang.org/t/vector-autoregressive-models/136333)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 3\
**Last updated:** [March 22, 2026, 5:19pm UTC](https://discourse.julialang.org/t/vector-autoregressive-models/136333 "2026-03-22T17:19:26Z")

</div>

Hello! What’s currently the situation on fitting and making predictions from vector autoregressive models? Here’s the related packages I’ve found, but they either are not vector models, or look like scratch code: …

---

## [How to pass a reference to a vector to C](https://discourse.julialang.org/t/how-to-pass-a-reference-to-a-vector-to-c/136320)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [March 21, 2026, 2:18pm UTC](https://discourse.julialang.org/t/how-to-pass-a-reference-to-a-vector-to-c/136320 "2026-03-21T14:18:33Z")

</div>

I’m calling SimpleBLE which has an API where both the reading and writing functions take (uint8\_t\*\* data, size\_t\* data\_length) that are used to return data in the read case and pass data in the write case. My confusion …

---

## [In which julia release will JuliaLowering be used for lowering?](https://discourse.julialang.org/t/in-which-julia-release-will-julialowering-be-used-for-lowering/136302)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 2\
**Last updated:** [March 21, 2026, 11:59am UTC](https://discourse.julialang.org/t/in-which-julia-release-will-julialowering-be-used-for-lowering/136302 "2026-03-21T11:59:28Z")

</div>

Just out of curiosity, for which julia release do we expect to see the femtolisp lowering be replaced by JuliaLowering? Thanks to all of the people who work very hard on JuliaLowering! Best Olivier

---

## [Does \`String(unsafe\_wrap(cstring, len, own=true))\` free the memory it points to?](https://discourse.julialang.org/t/does-string-unsafe-wrap-cstring-len-own-true-free-the-memory-it-points-to/136315)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [March 21, 2026, 1:47am UTC](https://discourse.julialang.org/t/does-string-unsafe-wrap-cstring-len-own-true-free-the-memory-it-points-to/136315 "2026-03-21T01:47:02Z")

</div>

If I have a Cstring from a @ccall that I am responsible for freeing, does converting that Cstring to a Julia String via s = String(unsafe\_wrap(Vector{UInt8}, Ptr{UInt8}(cstring), len, own=true)) automatically free the as…

---

## [Why writing to closed stream doesn't error](https://discourse.julialang.org/t/why-writing-to-closed-stream-doesnt-error/136301)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 8\
**Last updated:** [March 20, 2026, 9:03pm UTC](https://discourse.julialang.org/t/why-writing-to-closed-stream-doesnt-error/136301 "2026-03-20T21:03:20Z")

</div>

I have been tracking down a bug which where a stream as not open when write happened. MWE: io = open("/tmp/test", "w") close(io) print(io, "test") # why no error? Though the docstrings do not explicitly s…

---

## [Pickle.Defer when loading PyTorch tensors in Julia](https://discourse.julialang.org/t/pickle-defer-when-loading-pytorch-tensors-in-julia/136313)

<div class="topic-metadata">

**Author:** [@Uneeb\_Hasan](https://discourse.julialang.org/u/Uneeb_Hasan)\
**Replies:** 0\
**Last updated:** [March 20, 2026, 7:49pm UTC](https://discourse.julialang.org/t/pickle-defer-when-loading-pytorch-tensors-in-julia/136313 "2026-03-20T19:49:38Z")

</div>

Hi everyone! I’m working on implementing the ZINC molecular dataset for MLDatasets.jl and ran into something I wanted to get thoughts on. The raw ZINC data is distributed as Python pickle files where the tensors are sto…

---

## [Warning: Runtime invalidation was disabled, but the CPU info is out-of-date](https://discourse.julialang.org/t/warning-runtime-invalidation-was-disabled-but-the-cpu-info-is-out-of-date/134519)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 2\
**Last updated:** [March 20, 2026, 11:43am UTC](https://discourse.julialang.org/t/warning-runtime-invalidation-was-disabled-but-the-cpu-info-is-out-of-date/134519 "2026-03-20T11:43:31Z")

</div>

Hi, I’m using the $JULIA\_CPU\_TARGET variable with Julia 1.12.2. Some time ago, I started to get this message when updating the packages: HostCPUFeatures │ ┌ Warning: Runtime invalidation was disabled, but the CPU in…

---

## [The location of Julia functions](https://discourse.julialang.org/t/the-location-of-julia-functions/136296)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 5\
**Last updated:** [March 20, 2026, 2:13am UTC](https://discourse.julialang.org/t/the-location-of-julia-functions/136296 "2026-03-20T02:13:47Z")

</div>

I have dozens of helper functions in my program. First of all, why do I have to put them at the beginning of the program? Is there a way I can put them in a separate jl file for all these functions? Thanks.

---

## [What is the fastest way of realizing transpose of a CSR (or CSC) matrix?](https://discourse.julialang.org/t/what-is-the-fastest-way-of-realizing-transpose-of-a-csr-or-csc-matrix/136241)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 33\
**Last updated:** [March 19, 2026, 7:37pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-of-realizing-transpose-of-a-csr-or-csc-matrix/136241 "2026-03-19T19:37:49Z")

</div>

What is the fastest way of realizing sparse matrix transpose? I don’t mean a lazy transpose, I mean realization such that typeof(CSC') === typeof(CSC) (and analogously for CSR). There seems to be the algorithm of Gustav…

---

## [Old version (1.0.5) can't find BenchmarkTools in General registry](https://discourse.julialang.org/t/old-version-1-0-5-cant-find-benchmarktools-in-general-registry/136288)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 4\
**Last updated:** [March 19, 2026, 3:32pm UTC](https://discourse.julialang.org/t/old-version-1-0-5-cant-find-benchmarktools-in-general-registry/136288 "2026-03-19T15:32:31Z")

</div>

I’m trying to compare something on v1.12.5 with 1.0.5, but I immediately hit a snag on adding BenchmarkTools to the version environment. AFAIK BenchmarkTools does have versions in the General registry that is compatible …

---

## [How should a function report an error?](https://discourse.julialang.org/t/how-should-a-function-report-an-error/136266)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [March 19, 2026, 10:32am UTC](https://discourse.julialang.org/t/how-should-a-function-report-an-error/136266 "2026-03-19T10:32:05Z")

</div>

Functions can fail. I have functions that try to find a steady state of a DAE system, and that can fail. What is better: to raise an exception to return nothing While this error can be fatal, it does not have to be, t…

---

## [Try to create table, but database is closed](https://discourse.julialang.org/t/try-to-create-table-but-database-is-closed/136271)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 0\
**Last updated:** [March 19, 2026, 8:48am UTC](https://discourse.julialang.org/t/try-to-create-table-but-database-is-closed/136271 "2026-03-19T08:48:55Z")

</div>

I’ve created a database and am trying to create a table in it. mkpath(spoolDir\*"database") db=SQLite.DB(spoolDir\*"database/foo.db") function makeTables() global db SQLite.execute(db,"create table if not exists node…

---

## [How can I make my Julia code run faster?](https://discourse.julialang.org/t/how-can-i-make-my-julia-code-run-faster/136268)

<div class="topic-metadata">

**Author:** [@soumitradutta26](https://discourse.julialang.org/u/soumitradutta26)\
**Replies:** 3\
**Last updated:** [March 19, 2026, 8:35am UTC](https://discourse.julialang.org/t/how-can-i-make-my-julia-code-run-faster/136268 "2026-03-19T08:35:17Z")

</div>

Hi Everyone, I’m Soumitra Dutta – Entrepreneur & Photographer Based in Oxford. I’m trying to improve the performance of some Julia code I’m working on. Are there any tips, tricks, or best practices you’d recommend for ma…

---

## [Command line performance: pkg app, precompilation and juliac](https://discourse.julialang.org/t/command-line-performance-pkg-app-precompilation-and-juliac/136233)

<div class="topic-metadata">

**Author:** [@FerreolS](https://discourse.julialang.org/u/FerreolS)\
**Replies:** 4\
**Last updated:** [March 18, 2026, 7:30am UTC](https://discourse.julialang.org/t/command-line-performance-pkg-app-precompilation-and-juliac/136233 "2026-03-18T07:30:14Z")

</div>

Hi, I just want to share my experience building a command-line tool in Julia. A few years ago, I developed a small (unregistered) package, FITSexplore, to manipulate FITS files and their headers/keywords. Recently, I …

---

## [Problem with map() and function.() when using structs](https://discourse.julialang.org/t/problem-with-map-and-function-when-using-structs/83697)

<div class="topic-metadata">

**Author:** [@shabathq](https://discourse.julialang.org/u/shabathq)\
**Replies:** 3\
**Last updated:** [March 18, 2026, 5:26am UTC](https://discourse.julialang.org/t/problem-with-map-and-function-when-using-structs/83697 "2026-03-18T05:26:18Z")

</div>

Hello! I’ve run into this issue on multiple occasions, and I hoped someone here could help me out understand what’s going on. So after defining instances of a struct and a function that takes input as the struct instan…

---

## [Uninstalling Julia (with juliaup) on Windows](https://discourse.julialang.org/t/uninstalling-julia-with-juliaup-on-windows/136240)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 1\
**Last updated:** [March 17, 2026, 4:42pm UTC](https://discourse.julialang.org/t/uninstalling-julia-with-juliaup-on-windows/136240 "2026-03-17T16:42:25Z")

</div>

I have to test the installation of some package with a custom windows installer, and for that I need to remove the Julia installation each time. I am not able, at the moment, to remove Julia from windows machines. The w…

---

## [How to use workspaces to test?](https://discourse.julialang.org/t/how-to-use-workspaces-to-test/133670)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 31\
**Last updated:** [March 16, 2026, 10:42pm UTC](https://discourse.julialang.org/t/how-to-use-workspaces-to-test/133670 "2026-03-16T22:42:26Z")

</div>

I’m writing a program and I’d like to add tests. I search the web and find that there’s a new way: The recommended way to add test-specific dependencies is to use workspaces. This is done by: Adding a \[workspace\] se…

---

## [Reinterpret between SVector{N,ComplexF64} and SVector{2N,Float64} without accessing internal fields](https://discourse.julialang.org/t/reinterpret-between-svector-n-complexf64-and-svector-2n-float64-without-accessing-internal-fields/136183)

<div class="topic-metadata">

**Author:** [@pmc4](https://discourse.julialang.org/u/pmc4)\
**Replies:** 8\
**Last updated:** [March 16, 2026, 1:11pm UTC](https://discourse.julialang.org/t/reinterpret-between-svector-n-complexf64-and-svector-2n-float64-without-accessing-internal-fields/136183 "2026-03-16T13:11:19Z")

</div>

Hi, everyone. I want to ask you if you know a better way of doing the following that does not imply accessing internal fields. Imagine I have a vector of complex numbers: julia\> v1 = \[1.0 + 0.5im, 4.8 - 9.0im\] 2-elemen…

---

## [Solving linear systems without allocations, a comparison](https://discourse.julialang.org/t/solving-linear-systems-without-allocations-a-comparison/136193)

<div class="topic-metadata">

**Author:** [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)\
**Replies:** 6\
**Last updated:** [March 16, 2026, 10:49am UTC](https://discourse.julialang.org/t/solving-linear-systems-without-allocations-a-comparison/136193 "2026-03-16T10:49:42Z")

</div>

I wanted to see how important removing allocations were when repeatedly solving linear systems (Ax=b), so I built a quick test package to try things out: GitHub - RobertGregg/QRLite.jl · GitHub. The interface uses FastLa…

---

## [Hints for using the new JETLS.jl language server](https://discourse.julialang.org/t/hints-for-using-the-new-jetls-jl-language-server/135804)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 24\
**Last updated:** [March 16, 2026, 8:06am UTC](https://discourse.julialang.org/t/hints-for-using-the-new-jetls-jl-language-server/135804 "2026-03-16T08:06:59Z")

</div>

I reached a point where JETLS.JL is good enough for me and has no serious issues anymore. I needed some special configuration, though, and I want to share it with you: I find it much better than the old language serve…

---

## [How MLIR bridges Julia and other Languages](https://discourse.julialang.org/t/how-mlir-bridges-julia-and-other-languages/136213)

<div class="topic-metadata">

**Author:** [@obsidianjulua](https://discourse.julialang.org/u/obsidianjulua)\
**Replies:** 0\
**Last updated:** [March 16, 2026, 2:59am UTC](https://discourse.julialang.org/t/how-mlir-bridges-julia-and-other-languages/136213 "2026-03-16T02:59:28Z")

</div>

The short is MLIR can be a sort of ABI compiler so two languages can merge into the same IR. The long part is below. The Problem Julia’s ccall assumes C-compatible struct layouts — natural alignment, predictable padding…

---

## [Ignoring some files in coverage testing when github actions is taking care of continuous integration](https://discourse.julialang.org/t/ignoring-some-files-in-coverage-testing-when-github-actions-is-taking-care-of-continuous-integration/118847)

<div class="topic-metadata">

**Author:** [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Replies:** 2\
**Last updated:** [March 14, 2026, 11:29pm UTC](https://discourse.julialang.org/t/ignoring-some-files-in-coverage-testing-when-github-actions-is-taking-care-of-continuous-integration/118847 "2026-03-14T23:29:51Z")

</div>

I would like to skip the coverage testing (via codecov.io) for some of the files in a github repo. I’m using github actions to run workflows for continuous integration. The files I want to skip are not part of the primar…

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

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