# General Usage

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

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

**Page:** 12

---

## [Short Documentary Video: An Experimental Emotional AI Model Running as an HTTP API (in Julia)](https://discourse.julialang.org/t/short-documentary-video-an-experimental-emotional-ai-model-running-as-an-http-api-in-julia/136934)

<div class="topic-metadata">

**Author:** [@mouad-tarif](https://discourse.julialang.org/u/mouad-tarif)\
**Replies:** 0\
**Last updated:** [April 30, 2026, 4:57pm UTC](https://discourse.julialang.org/t/short-documentary-video-an-experimental-emotional-ai-model-running-as-an-http-api-in-julia/136934 "2026-04-30T16:57:34Z")

</div>

I published a video showing an experimental model that interacts with basic emotions and is accessible via an API. What appears in the video: An HTTP server (using HTTP.jl) handling requests. The model responding to e…

---

## [Avoid display all data](https://discourse.julialang.org/t/avoid-display-all-data/136914)

<div class="topic-metadata">

**Author:** [@Rodrigo](https://discourse.julialang.org/u/Rodrigo)\
**Replies:** 12\
**Last updated:** [April 30, 2026, 3:05pm UTC](https://discourse.julialang.org/t/avoid-display-all-data/136914 "2026-04-30T15:05:12Z")

</div>

Hi all, I am new with Julia my background is Stata and R, I am comparing different command and results. I wonder if exist some way to avoid display all database without ask for it. Its complicated when I load millions…

---

## [Allocations from scalar arguments in functions](https://discourse.julialang.org/t/allocations-from-scalar-arguments-in-functions/136927)

<div class="topic-metadata">

**Author:** [@Pablo\_Montes](https://discourse.julialang.org/u/Pablo_Montes)\
**Replies:** 3\
**Last updated:** [April 30, 2026, 2:56pm UTC](https://discourse.julialang.org/t/allocations-from-scalar-arguments-in-functions/136927 "2026-04-30T14:56:08Z")

</div>

Hello, I am trying to optimize a code for simulating fluids that is currently allocating massive amounts of memory. I’m focusing on some specific functions that are simple but need to be called repeatedly (thousands of t…

---

## [Symbolics.jl sum](https://discourse.julialang.org/t/symbolics-jl-sum/136924)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 1\
**Last updated:** [April 29, 2026, 11:08pm UTC](https://discourse.julialang.org/t/symbolics-jl-sum/136924 "2026-04-29T23:08:18Z")

</div>

Hello. Good evening. There is a sum function for Symbolics.jl? Like a sympy sum(x^2, x, 1, n)?

---

## [Meshes and units (Meshes.jl)](https://discourse.julialang.org/t/meshes-and-units-meshes-jl/122235)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 10\
**Last updated:** [April 29, 2026, 9:46pm UTC](https://discourse.julialang.org/t/meshes-and-units-meshes-jl/122235 "2026-04-29T21:46:21Z")

</div>

I am defining geometries in meshes, but to perform computations, I must strip units and vectorize the data using ustrip.(to.(data)) to create unitless vectors. This process feels cumbersome, possibly indicating uninten…

---

## [Base.Semaphore and @spawn: The Illusion of Control vs. Explicit Resource Management](https://discourse.julialang.org/t/base-semaphore-and-spawn-the-illusion-of-control-vs-explicit-resource-management/136916)

<div class="topic-metadata">

**Author:** [@Alexander\_B](https://discourse.julialang.org/u/Alexander_B)\
**Replies:** 2\
**Last updated:** [April 29, 2026, 3:46pm UTC](https://discourse.julialang.org/t/base-semaphore-and-spawn-the-illusion-of-control-vs-explicit-resource-management/136916 "2026-04-29T15:46:52Z")

</div>

All the best to everyone The Problem When using Base.Semaphore to limit the number of concurrently executing heavy tasks, there is a fundamental difference in the behavior of the two approaches: Option A (Syntactic su…

---

## [New problem for Pkg.update() with proxy/antivirus](https://discourse.julialang.org/t/new-problem-for-pkg-update-with-proxy-antivirus/136851)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 5\
**Last updated:** [April 28, 2026, 8:34am UTC](https://discourse.julialang.org/t/new-problem-for-pkg-update-with-proxy-antivirus/136851 "2026-04-28T08:34:41Z")

</div>

Hi, I use Julia behind a firewall and since a few days I cannot do Pkg.update() anymore (even with a clean environment with no dependencies) . The command stalls at 49.9 % and finally times out. I wonder if this is…

---

## [Creating and Solving Block Sparse Matrices with PETSc](https://discourse.julialang.org/t/creating-and-solving-block-sparse-matrices-with-petsc/90831)

<div class="topic-metadata">

**Author:** [@Azurezaber](https://discourse.julialang.org/u/Azurezaber)\
**Replies:** 15\
**Last updated:** [April 27, 2026, 1:12pm UTC](https://discourse.julialang.org/t/creating-and-solving-block-sparse-matrices-with-petsc/90831 "2026-04-27T13:12:55Z")

</div>

Hello! I am using Julia to write a finite volume CFD code, which requires solving large (40,000x40,000) block sparse matrices. Currently, I am using the PETSc interface provided by PETSc.jl, as its GMRES routine is notab…

---

## [Pathological compile times training a Lux+CUDA descriptor CNN with a similarity-matrix (SupCon) loss — Reactant, Zygote, and manual loops all hang on first step](https://discourse.julialang.org/t/pathological-compile-times-training-a-lux-cuda-descriptor-cnn-with-a-similarity-matrix-supcon-loss-reactant-zygote-and-manual-loops-all-hang-on-first-step/136884)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 2\
**Last updated:** [April 26, 2026, 11:49am UTC](https://discourse.julialang.org/t/pathological-compile-times-training-a-lux-cuda-descriptor-cnn-with-a-similarity-matrix-supcon-loss-reactant-zygote-and-manual-loops-all-hang-on-first-step/136884 "2026-04-26T11:49:43Z")

</div>

\--- Body: I’ve been trying to train a small descriptor CNN (~1M params, 64×64 grayscale patch input → 128-dim L2-normalized embedding) with a Supervised Contrastive (SupCon) loss in pure Julia / Lux on a single B200…

---

## [Puzzling construction with executable statements in struct definition](https://discourse.julialang.org/t/puzzling-construction-with-executable-statements-in-struct-definition/136887)

<div class="topic-metadata">

**Author:** [@sgaure](https://discourse.julialang.org/u/sgaure)\
**Replies:** 2\
**Last updated:** [April 26, 2026, 9:22am UTC](https://discourse.julialang.org/t/puzzling-construction-with-executable-statements-in-struct-definition/136887 "2026-04-26T09:22:11Z")

</div>

I thought I had seen most things in julia, but I’ve come across the following construction which I don’t think I’ve seen in the docs: using MacroTools const gotit = Set() macro genconstructor(spec) if !@capture(spe…

---

## [Writing parameter dependent methods for abstract type](https://discourse.julialang.org/t/writing-parameter-dependent-methods-for-abstract-type/136830)

<div class="topic-metadata">

**Author:** [@Tbl](https://discourse.julialang.org/u/Tbl)\
**Replies:** 2\
**Last updated:** [April 25, 2026, 6:31pm UTC](https://discourse.julialang.org/t/writing-parameter-dependent-methods-for-abstract-type/136830 "2026-04-25T18:31:51Z")

</div>

I want to write method for all subtypes of an abstract type which would make use of type parameter. Can you do that? Example, let us say we have concrete type MyType{T} and some method which needs T, like struct MyType{…

---

## [Examples of Julia-based End-User Tools](https://discourse.julialang.org/t/examples-of-julia-based-end-user-tools/136677)

<div class="topic-metadata">

**Author:** [@MDSW](https://discourse.julialang.org/u/MDSW)\
**Replies:** 13\
**Last updated:** [April 24, 2026, 5:58pm UTC](https://discourse.julialang.org/t/examples-of-julia-based-end-user-tools/136677 "2026-04-24T17:58:27Z")

</div>

All, I’m looking for examples of tools with an end-user facing interface of some sort for using them, with accessible code repositories. My interest is in surveying how these are structured, built and distributed. A few …

---

## [My journey training an LLM from scratch in Julia (and why I see huge potential)](https://discourse.julialang.org/t/my-journey-training-an-llm-from-scratch-in-julia-and-why-i-see-huge-potential/136843)

<div class="topic-metadata">

**Author:** [@mouad-tarif](https://discourse.julialang.org/u/mouad-tarif)\
**Replies:** 5\
**Last updated:** [April 24, 2026, 5:07pm UTC](https://discourse.julialang.org/t/my-journey-training-an-llm-from-scratch-in-julia-and-why-i-see-huge-potential/136843 "2026-04-24T17:07:59Z")

</div>

I started training a language model from scratch in Julia. Not using pre-built libraries for the core - building my own BPE tokenizer, my own training loop, facing hallucinations, and rebuilding. I tried Flux and Lux. B…

---

## [Julia via juliaup in GUIX](https://discourse.julialang.org/t/julia-via-juliaup-in-guix/130586)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 1\
**Last updated:** [April 22, 2026, 2:03pm UTC](https://discourse.julialang.org/t/julia-via-juliaup-in-guix/130586 "2026-04-22T14:03:54Z")

</div>

Hey all, recently posted about using juliaup in NixOS. Now I’m investigating it in GUIX which is a similar OS but using guile scheme as the configuration language. In GUIX you can run foreign compiled binaries in a cont…

---

## [Letting AI agents use the VSCode Julia REPL](https://discourse.julialang.org/t/letting-ai-agents-use-the-vscode-julia-repl/136805)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 7\
**Last updated:** [April 21, 2026, 9:31pm UTC](https://discourse.julialang.org/t/letting-ai-agents-use-the-vscode-julia-repl/136805 "2026-04-21T21:31:54Z")

</div>

Hi all, recently the julia-vscode devs added the ability for VSCode Copilot to run code in the integrated Julia REPL. I made a small addon extension which also lets all the other agentic tools like the native Claude/Code…

---

## [Question about \`exp\` with imaginary argument](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773)

<div class="topic-metadata">

**Author:** [@aitzkora](https://discourse.julialang.org/u/aitzkora)\
**Replies:** 8\
**Last updated:** [April 21, 2026, 7:36am UTC](https://discourse.julialang.org/t/question-about-exp-with-imaginary-argument/136773 "2026-04-21T07:36:08Z")

</div>

I do not understand the result in the second case julia\> exp(2π/3 \* 1im) -0.4999999999999998 + 0.8660254037844387im julia\> exp(2π/3im) -0.4999999999999998 - 0.8660254037844387im julia\> cis(2π/3) -0.4999999999999998 + 0.…

---

## [Fast fixed point log](https://discourse.julialang.org/t/fast-fixed-point-log/136210)

<div class="topic-metadata">

**Author:** [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Replies:** 5\
**Last updated:** [April 21, 2026, 4:55am UTC](https://discourse.julialang.org/t/fast-fixed-point-log/136210 "2026-04-21T04:55:49Z")

</div>

I’m trying to compute Float32 log(x) where x = (u + 0.5) / 2³² and u is a integer from 0 to 2³² - 1 I started with: @inline function fastlog1(u::UInt32)::Float32 if u \< UInt32(2)^31 x = fma(Float32(u), Floa…

---

## [Unexpected Boolean flag behavior in Julia 1.12 vs 1.10](https://discourse.julialang.org/t/unexpected-boolean-flag-behavior-in-julia-1-12-vs-1-10/135539)

<div class="topic-metadata">

**Author:** [@Mirsad\_Cosovic](https://discourse.julialang.org/u/Mirsad_Cosovic)\
**Replies:** 7\
**Last updated:** [April 20, 2026, 3:58pm UTC](https://discourse.julialang.org/t/unexpected-boolean-flag-behavior-in-julia-1-12-vs-1-10/135539 "2026-04-20T15:58:35Z")

</div>

I have encountered a strange issue while migrating code from Julia 1.10 to Julia 1.12.3. It seems like a variable assignment within a function is not being reflected correctly in the caller’s scope, or I am fundamentally…

---

## [Poor Impression on Agentic Development in Julia with Codex. Skill issue?](https://discourse.julialang.org/t/poor-impression-on-agentic-development-in-julia-with-codex-skill-issue/136524)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 18\
**Last updated:** [April 20, 2026, 3:13pm UTC](https://discourse.julialang.org/t/poor-impression-on-agentic-development-in-julia-with-codex-skill-issue/136524 "2026-04-20T15:13:41Z")

</div>

I want to share my recent experience using advanced AI models for software development, and I would be very interested to hear from others in the Julia community to see whether I can improve my workflow. My experience s…

---

## [Passing whole sequence to next layer from RNNCell in Lux](https://discourse.julialang.org/t/passing-whole-sequence-to-next-layer-from-rnncell-in-lux/136779)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 0\
**Last updated:** [April 19, 2026, 4:42pm UTC](https://discourse.julialang.org/t/passing-whole-sequence-to-next-layer-from-rnncell-in-lux/136779 "2026-04-19T16:42:39Z")

</div>

Hello, I am trying to reproduce some basic code for training recurrent spiking networks. Here you can find an old porting for Flux from spytorch. I already adapted to the current Flux version, but I would really like t…

---

## [Another case of poor vectorization](https://discourse.julialang.org/t/another-case-of-poor-vectorization/136778)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 1\
**Last updated:** [April 19, 2026, 2:08pm UTC](https://discourse.julialang.org/t/another-case-of-poor-vectorization/136778 "2026-04-19T14:08:54Z")

</div>

I see poor vectorization when creating ranges as tuples. The flavor is similar to this issue, but the details are different. This time there are no comparisons involved (which were the culprit in the linked post). funct…

---

## [Serving WGLMakie Plots with Observables via Oxygen Server Having Websocket Connection to Bonito](https://discourse.julialang.org/t/serving-wglmakie-plots-with-observables-via-oxygen-server-having-websocket-connection-to-bonito/136764)

<div class="topic-metadata">

**Author:** [@Sumfun](https://discourse.julialang.org/u/Sumfun)\
**Replies:** 3\
**Last updated:** [April 18, 2026, 11:48pm UTC](https://discourse.julialang.org/t/serving-wglmakie-plots-with-observables-via-oxygen-server-having-websocket-connection-to-bonito/136764 "2026-04-18T23:48:18Z")

</div>

Challenge - Serving WGLMakie plots with observables via Oxygen using a websocket connection to Bonito. The issue is that Oxygen serves a static image without observables. It appears that the initial Session ID from Bonit…

---

## [Compilation behavior in the multi-threading context](https://discourse.julialang.org/t/compilation-behavior-in-the-multi-threading-context/136632)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 3\
**Last updated:** [April 18, 2026, 3:09pm UTC](https://discourse.julialang.org/t/compilation-behavior-in-the-multi-threading-context/136632 "2026-04-18T15:09:18Z")

</div>

Oftentimes compilation takes some time before running the main code. Given the following code function fn(x, y, z) # some heavy work that needs to be compiled end spawn\_fn(a...) = Threads.@spawn(fn(a...)) function …

---

## [GC error (probable corruption)](https://discourse.julialang.org/t/gc-error-probable-corruption/13612)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 14\
**Last updated:** [April 18, 2026, 1:18pm UTC](https://discourse.julialang.org/t/gc-error-probable-corruption/13612 "2026-04-18T13:18:26Z")

</div>

I’m stuggling to reproduce a gc related error on Julia v0.7 and v1.0, Windows x86. (But notably, not Julia v0.6.) The tests for GLPK.jl fail with the following error. (Here is the Appveyor log.) Allocations: 2388187 (P…

---

## [Where is the lowering of end within \[ \] documented](https://discourse.julialang.org/t/where-is-the-lowering-of-end-within-documented/136736)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [April 18, 2026, 9:23am UTC](https://discourse.julialang.org/t/where-is-the-lowering-of-end-within-documented/136736 "2026-04-18T09:23:33Z")

</div>

Where is the lowering of end within \[\] documented? Ie the fact that it is assigned a value from lastindex, as in julia\> Meta.@lower (1:4)\[min(end, 5)\] :($(Expr(:thunk, CodeInfo( 1 ─ %1 = Main.:(:) │ %2 = dynamic (%1…

---

## [Replacing MATLAB/Octave with Julia](https://discourse.julialang.org/t/replacing-matlab-octave-with-julia/136558)

<div class="topic-metadata">

**Author:** [@AntonioBigazzi](https://discourse.julialang.org/u/AntonioBigazzi)\
**Replies:** 4\
**Last updated:** [April 17, 2026, 7:24pm UTC](https://discourse.julialang.org/t/replacing-matlab-octave-with-julia/136558 "2026-04-17T19:24:24Z")

</div>

I’d love to move to Julia, but MATLAB/Octave has a feature that is indispensable to me: the echo of each instruction ( unless terminated with a ; ) ax = -0.8 ay = 0.6 bx = 0.7241 etc. Is there an eq…

---

## [Time to build system and problem is slower in Julia 1.12 with MTKv11](https://discourse.julialang.org/t/time-to-build-system-and-problem-is-slower-in-julia-1-12-with-mtkv11/135536)

<div class="topic-metadata">

**Author:** [@Wen-Wei\_Tseng](https://discourse.julialang.org/u/Wen-Wei_Tseng)\
**Replies:** 12\
**Last updated:** [April 17, 2026, 3:23pm UTC](https://discourse.julialang.org/t/time-to-build-system-and-problem-is-slower-in-julia-1-12-with-mtkv11/135536 "2026-04-17T15:23:38Z")

</div>

Hi, while I was trying the new version (v11) of ModelingToolkit.jl , I noticed it took longer to build the ODE system and problem under Julia 1.12. Here is the GitHub actions workflow running the script using ModelingT…

---

## [This used to work (Tk, Image, ImageView)](https://discourse.julialang.org/t/this-used-to-work-tk-image-imageview/136745)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [April 17, 2026, 2:04pm UTC](https://discourse.julialang.org/t/this-used-to-work-tk-image-imageview/136745 "2026-04-17T14:04:56Z")

</div>

using NIfTI, Tk, Images, ImageView function mriview(ni::NIVolume, xy=\["x", "z"\], zoom::Int=5) img = Image(ni.raw, \["spatialorder" =\> \["x", "y", "z"\], "timedim" =\> 4, "colorspace" =\> "Gray", …

---

## ["isomorphic" datastructures](https://discourse.julialang.org/t/isomorphic-datastructures/136733)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 5\
**Last updated:** [April 17, 2026, 5:17am UTC](https://discourse.julialang.org/t/isomorphic-datastructures/136733 "2026-04-17T05:17:35Z")

</div>

Hi, Here is a X/Y problem Problem X: I handle data structures which are a nesting of Tuples, NamedTuples and SVector, of various Reals. I want to create a function isomorph(a,b) that is equivalent to typeof(a)==typeo…

---

## [Replicating predictive margins for a categorical variable](https://discourse.julialang.org/t/replicating-predictive-margins-for-a-categorical-variable/136741)

<div class="topic-metadata">

**Author:** [@Rodrigo](https://discourse.julialang.org/u/Rodrigo)\
**Replies:** 0\
**Last updated:** [April 16, 2026, 2:59pm UTC](https://discourse.julialang.org/t/replicating-predictive-margins-for-a-categorical-variable/136741 "2026-04-16T14:59:10Z")

</div>

I am new with Julia, my background is Stata. I am looking a way for get marginal mean for a categorical variable (Stata: margins i.group). I am using categorical variable for variable group, then my goal its get probab…

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

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