# General Usage

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

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

**Page:** 214

---

## [Fieldnames for user-defined structs](https://discourse.julialang.org/t/fieldnames-for-user-defined-structs/108508)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 4\
**Last updated:** [January 8, 2024, 11:51am UTC](https://discourse.julialang.org/t/fieldnames-for-user-defined-structs/108508 "2024-01-08T11:51:35Z")

</div>

julia\> struct Foo bar baz::Int qux::Float64 end julia\> foo = Foo(1,2,3) Foo(1, 2, 3.0) julia\> fieldnames(foo) ERROR: MethodError: no method matching fieldnam…

---

## [How to create task firstly and start it not on the main thread?](https://discourse.julialang.org/t/how-to-create-task-firstly-and-start-it-not-on-the-main-thread/108502)

<div class="topic-metadata">

**Author:** [@SunnyUser](https://discourse.julialang.org/u/SunnyUser)\
**Replies:** 2\
**Last updated:** [January 8, 2024, 9:34am UTC](https://discourse.julialang.org/t/how-to-create-task-firstly-and-start-it-not-on-the-main-thread/108502 "2024-01-08T09:34:34Z")

</div>

Hi all :slight\_smile: I want to seperate task creation and task start, but I want to use all available threads. Thanks

---

## [Step!() remains strangely unfound if buried inside another method](https://discourse.julialang.org/t/step-remains-strangely-unfound-if-buried-inside-another-method/108316)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 5\
**Last updated:** [January 8, 2024, 9:16am UTC](https://discourse.julialang.org/t/step-remains-strangely-unfound-if-buried-inside-another-method/108316 "2024-01-08T09:16:42Z")

</div>

Hi. Can anyone please tell me why the call to step!(irg.odes) in the following code generates the error: MethodError: no method matching step!(::DynamicalSystemsBase.CoupledODEs{true, ...? Note that the call to reinit!…

---

## [Iso\_codes tree hash mismatch](https://discourse.julialang.org/t/iso-codes-tree-hash-mismatch/108240)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [January 8, 2024, 8:40am UTC](https://discourse.julialang.org/t/iso-codes-tree-hash-mismatch/108240 "2024-01-08T08:40:31Z")

</div>

Anyone else has the problem? Is there a solution?

---

## [Status of WebIO](https://discourse.julialang.org/t/status-of-webio/108478)

<div class="topic-metadata">

**Author:** [@Benoit9](https://discourse.julialang.org/u/Benoit9)\
**Replies:** 2\
**Last updated:** [January 8, 2024, 7:33am UTC](https://discourse.julialang.org/t/status-of-webio/108478 "2024-01-08T07:33:30Z")

</div>

Hello, I was trying to use Interact.jl in the browser, and I ran into an issue with WebIO being incompatible with the latest WebSockets. Now, WebSockets itself does not seem to have been updated for over a year, and I u…

---

## [Parametric methods](https://discourse.julialang.org/t/parametric-methods/108496)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [January 8, 2024, 4:03am UTC](https://discourse.julialang.org/t/parametric-methods/108496 "2024-01-08T04:03:51Z")

</div>

I have just read the “parametric methods” part of the julia docs: https://docs.julialang.org/en/v1/manual/methods/#Parametric-Methods Is it possible to parametrize the value (but not the type) of arguments of a functio…

---

## [Is it possible to use autodiff on an external program?](https://discourse.julialang.org/t/is-it-possible-to-use-autodiff-on-an-external-program/108475)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 2\
**Last updated:** [January 8, 2024, 2:50am UTC](https://discourse.julialang.org/t/is-it-possible-to-use-autodiff-on-an-external-program/108475 "2024-01-08T02:50:24Z")

</div>

I have a c++ program I am running from julia that acts as the inner loop of a simulation (actually its a game engine). I’ve been playing with lots of derivative free optimizations, and tried the FiniteDiff package which …

---

## [Adding two integers vs. adding two floating-point numbers](https://discourse.julialang.org/t/adding-two-integers-vs-adding-two-floating-point-numbers/108494)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 1\
**Last updated:** [January 8, 2024, 2:45am UTC](https://discourse.julialang.org/t/adding-two-integers-vs-adding-two-floating-point-numbers/108494 "2024-01-08T02:45:39Z")

</div>

According to the julia documents, adding two integers is very different from adding two floating-point numbers, both of which are distinct from adding an integer to a floating-point number. Is adding two integers faste…

---

## [VScode IntelliSense very frustrating](https://discourse.julialang.org/t/vscode-intellisense-very-frustrating/72007)

<div class="topic-metadata">

**Author:** [@Dustin\_Hess](https://discourse.julialang.org/u/Dustin_Hess)\
**Replies:** 13\
**Last updated:** [January 8, 2024, 12:42am UTC](https://discourse.julialang.org/t/vscode-intellisense-very-frustrating/72007 "2024-01-08T00:42:17Z")

</div>

I am long time Juno user. I keep coming back to VScode as that is supposedly where things are going. Everytime I come back the intellisense never works. Half the time when you import namspaces with the using statement th…

---

## [Is it safe to pop! a Dict in a loop like this?](https://discourse.julialang.org/t/is-it-safe-to-pop-a-dict-in-a-loop-like-this/108441)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 15\
**Last updated:** [January 7, 2024, 9:47pm UTC](https://discourse.julialang.org/t/is-it-safe-to-pop-a-dict-in-a-loop-like-this/108441 "2024-01-07T21:47:43Z")

</div>

At the moment, the following code gives the result that I want (i.e. the for loop goes through each key in the dict once): let mydict = Dict(\[i =\> rand() for i in 1:10\]) println(mydict) for k in keys(mydict) …

---

## [Decimal commas instead of points](https://discourse.julialang.org/t/decimal-commas-instead-of-points/67446)

<div class="topic-metadata">

**Author:** [@danilo-bc](https://discourse.julialang.org/u/danilo-bc)\
**Replies:** 7\
**Last updated:** [January 7, 2024, 9:05pm UTC](https://discourse.julialang.org/t/decimal-commas-instead-of-points/67446 "2024-01-07T21:05:33Z")

</div>

Does Julia provide a simple way to use decimal commas instead of the standard point? Some countries use that standard and working with local data is sometimes a hassle. For example, importing spreadsheets with percentag…

---

## [Searching files on disk running 28 times faster in Python than in Julia. What am I doing wrong?](https://discourse.julialang.org/t/searching-files-on-disk-running-28-times-faster-in-python-than-in-julia-what-am-i-doing-wrong/108462)

<div class="topic-metadata">

**Author:** [@Viditagarwal7479](https://discourse.julialang.org/u/Viditagarwal7479)\
**Replies:** 13\
**Last updated:** [January 7, 2024, 5:50pm UTC](https://discourse.julialang.org/t/searching-files-on-disk-running-28-times-faster-in-python-than-in-julia-what-am-i-doing-wrong/108462 "2024-01-07T17:50:58Z")

</div>

The following code goes through whole disk (~12000 files) to get all the files having certain extension. Running the below script takes around 5.034 secs whereas running the similar python code takes just 0.176 secs. us…

---

## [Plots not precompiling on macos apple silicon](https://discourse.julialang.org/t/plots-not-precompiling-on-macos-apple-silicon/108472)

<div class="topic-metadata">

**Author:** [@peteole](https://discourse.julialang.org/u/peteole)\
**Replies:** 2\
**Last updated:** [January 7, 2024, 5:31pm UTC](https://discourse.julialang.org/t/plots-not-precompiling-on-macos-apple-silicon/108472 "2024-01-07T17:31:24Z")

</div>

Hi, recently the plotting library broke down after an update of julia to 1.9.4 using homebrew on macos apple silicon. The precompilation fails: using Plots \[ Info: Precompiling Plots \[91a5bcdd-55d7-5caf-9e0b-520d859cae8…

---

## [I cannot use my gpu despite trying everything](https://discourse.julialang.org/t/i-cannot-use-my-gpu-despite-trying-everything/108365)

<div class="topic-metadata">

**Author:** [@kocak](https://discourse.julialang.org/u/kocak)\
**Replies:** 28\
**Last updated:** [January 7, 2024, 4:55pm UTC](https://discourse.julialang.org/t/i-cannot-use-my-gpu-despite-trying-everything/108365 "2024-01-07T16:55:26Z")

</div>

I get this error (more detailed error on bottom) WARNING: Error while freeing DeviceBuffer(1024 bytes at 0x0000000205003000): CUDA.CuError(code=CUDA.cudaError\_enum(0x000002bc), details=CUDA.Optional{String}(data=nothing…

---

## [Tower hanoi in julia vs java - recursive function](https://discourse.julialang.org/t/tower-hanoi-in-julia-vs-java-recursive-function/108399)

<div class="topic-metadata">

**Author:** [@fab6](https://discourse.julialang.org/u/fab6)\
**Replies:** 14\
**Last updated:** [January 7, 2024, 3:58pm UTC](https://discourse.julialang.org/t/tower-hanoi-in-julia-vs-java-recursive-function/108399 "2024-01-07T15:58:33Z")

</div>

Hi, I am comparing a simple recursive function for the tower of hanoi in julia with java. This is the java code: class hanoi { static void towerOfHanoi(int n, char source, char target, char helper) { i…

---

## [Is LinearAlgebra a builtin module of julia?](https://discourse.julialang.org/t/is-linearalgebra-a-builtin-module-of-julia/108452)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 5\
**Last updated:** [January 7, 2024, 1:34pm UTC](https://discourse.julialang.org/t/is-linearalgebra-a-builtin-module-of-julia/108452 "2024-01-07T13:34:16Z")

</div>

(@v1.9) pkg\> status Status \`C:\\Users\\jmzhang\\.julia\\environments\\v1.9\\Project.toml\` \[7d9fca2a\] Arpack v0.5.4 \[6e4b80f9\] BenchmarkTools v1.4.0 \[a93c6f00\] DataFrames v1.6.1 ⌃ \[0c46a032\] DifferentialEquations v7.11.0 …

---

## [Compile efficiency and argument-type declearation](https://discourse.julialang.org/t/compile-efficiency-and-argument-type-declearation/108464)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 1\
**Last updated:** [January 7, 2024, 1:10pm UTC](https://discourse.julialang.org/t/compile-efficiency-and-argument-type-declearation/108464 "2024-01-07T13:10:16Z")

</div>

Suppose I have a function defined as function f(x,y) return x + y end Here I have no argument-type declearation. Does this mean julia has to generate as many methods as possible for this function in compiling? I…

---

## [What is the idea of having a builtin function like 'axpy!'?](https://discourse.julialang.org/t/what-is-the-idea-of-having-a-builtin-function-like-axpy/108453)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [January 7, 2024, 8:43am UTC](https://discourse.julialang.org/t/what-is-the-idea-of-having-a-builtin-function-like-axpy/108453 "2024-01-07T08:43:18Z")

</div>

I am from matlab. I find that there are actually much more builtin functions in julia than in matlab. In julia, we even have a function like ‘axpy!’ It is of course handy to have such a builtin function, although it is …

---

## [Saving control inputs in RigidBodyDynamics](https://discourse.julialang.org/t/saving-control-inputs-in-rigidbodydynamics/108446)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 0\
**Last updated:** [January 6, 2024, 10:30pm UTC](https://discourse.julialang.org/t/saving-control-inputs-in-rigidbodydynamics/108446 "2024-01-06T22:30:01Z")

</div>

Is there a generally accepted way to store the control inputs during a simulation in RigidBodyDynamics? ts, qs, vs = simulate(state, 15., control!; Δt = Δt); I’d like to capture what is calculated by control! at each t…

---

## [How to address an error?](https://discourse.julialang.org/t/how-to-address-an-error/93191)

<div class="topic-metadata">

**Author:** [@Kanishk](https://discourse.julialang.org/u/Kanishk)\
**Replies:** 4\
**Last updated:** [January 6, 2024, 8:05pm UTC](https://discourse.julialang.org/t/how-to-address-an-error/93191 "2024-01-06T20:05:21Z")

</div>

Hello, I am trying to find the steady state (or roots) of a system with 9 states using the Krawczyk method. For that I need to find a Jacobian, but I am getting the following error- " BoundsError: attempt to access 0-e…

---

## [Trying to write a convert() for a complicated type](https://discourse.julialang.org/t/trying-to-write-a-convert-for-a-complicated-type/108419)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 11\
**Last updated:** [January 6, 2024, 7:59pm UTC](https://discourse.julialang.org/t/trying-to-write-a-convert-for-a-complicated-type/108419 "2024-01-06T19:59:38Z")

</div>

Stepping back into Julia after a year’s absence. I’m using RigibBodyDynamics to model a double pendulum. Simulating the system should return an array of system states, ideally an Array{Float64} or similar. The type that…

---

## [Keyword arguments not assigned](https://discourse.julialang.org/t/keyword-arguments-not-assigned/108420)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 3\
**Last updated:** [January 6, 2024, 4:15pm UTC](https://discourse.julialang.org/t/keyword-arguments-not-assigned/108420 "2024-01-06T16:15:26Z")

</div>

I see functions invoked as a, b = fun(x; year=1000, rate) The keyward argument ‘rate’ is not assigned a value. So it will take its preassigned value, right?

---

## [New method for 'Base.sum'](https://discourse.julialang.org/t/new-method-for-base-sum/108427)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 5\
**Last updated:** [January 6, 2024, 4:28pm UTC](https://discourse.julialang.org/t/new-method-for-base-sum/108427 "2024-01-06T16:28:19Z")

</div>

function Base.sum(f, v::MyType) return sum(f, values(v)) end In the Github package I am reading, the author introduced a lot of new methods for julia builtin functions. Is this a common practice in programming, esp…

---

## [A keyword argument must have a default value?](https://discourse.julialang.org/t/a-keyword-argument-must-have-a-default-value/108421)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 7\
**Last updated:** [January 6, 2024, 2:55pm UTC](https://discourse.julialang.org/t/a-keyword-argument-must-have-a-default-value/108421 "2024-01-06T14:55:30Z")

</div>

This seems a common practice in the codes I saw. Is it required or not?

---

## [Billion-row benchmark?](https://discourse.julialang.org/t/billion-row-benchmark/108417)

<div class="topic-metadata">

**Author:** [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Replies:** 1\
**Last updated:** [January 5, 2024, 10:45pm UTC](https://discourse.julialang.org/t/billion-row-benchmark/108417 "2024-01-05T22:45:03Z")

</div>

You’re correct - I had no intention to compare with Python or start a debate - the extract was to highlight that he either didnt know of Julia or didnt consider it (despite aggrievances with Python). In so far as the be…

---

## [Obtaining coefficients of polynomial with SymEngine.jl](https://discourse.julialang.org/t/obtaining-coefficients-of-polynomial-with-symengine-jl/108371)

<div class="topic-metadata">

**Author:** [@MAB](https://discourse.julialang.org/u/MAB)\
**Replies:** 5\
**Last updated:** [January 5, 2024, 11:11pm UTC](https://discourse.julialang.org/t/obtaining-coefficients-of-polynomial-with-symengine-jl/108371 "2024-01-05T23:11:56Z")

</div>

I am trying to obtain a dictionary that contains monomials (keys) and coefficients (values) for a multi-variate polynomial in SymEngine. This function exists in Symbolics.jl Symbolics.polynomial\_coeffs but I would rath…

---

## [Group profiling flame graph tiles](https://discourse.julialang.org/t/group-profiling-flame-graph-tiles/108384)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 4\
**Last updated:** [January 5, 2024, 9:17pm UTC](https://discourse.julialang.org/t/group-profiling-flame-graph-tiles/108384 "2024-01-05T21:17:01Z")

</div>

An integration + optimization code I’m working on generates flame graphs like this one, which are very hard to parse. Indeed, the same underlying function is called by several different lines of the code, so even if I sp…

---

## [Customizing Julia Installation Directory on Linux](https://discourse.julialang.org/t/customizing-julia-installation-directory-on-linux/108362)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 5\
**Last updated:** [January 5, 2024, 8:31pm UTC](https://discourse.julialang.org/t/customizing-julia-installation-directory-on-linux/108362 "2024-01-05T20:31:42Z")

</div>

Hello everyone! I’m currently working on installing Julia on my Linux system using the standard installation script (curl -fsSL https://install.julialang.org | sh ). I’m looking to customize the installation directory, b…

---

## [Precompilation takes ages](https://discourse.julialang.org/t/precompilation-takes-ages/108377)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 14\
**Last updated:** [January 5, 2024, 7:04pm UTC](https://discourse.julialang.org/t/precompilation-takes-ages/108377 "2024-01-05T19:04:55Z")

</div>

Hey, I am having some kind of an issue that does not match what I see here and what others reports. I have an environment with the following Project.toml: \[deps\] BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"…

---

## [Capturing SIGHUP or SIGUSR1/2](https://discourse.julialang.org/t/capturing-sighup-or-sigusr1-2/69771)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 1\
**Last updated:** [January 5, 2024, 6:59pm UTC](https://discourse.julialang.org/t/capturing-sighup-or-sigusr1-2/69771 "2024-01-05T18:59:28Z")

</div>

I know how to capture SIGINT via an InterruptException and how to attach a signal handler using atexit, but neither of those solves my requirement. I need to capture either of SIGHUP, SIGUSR1, or SIGUSR2 so that I can r…

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

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