# General Usage

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

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

**Page:** 105

---

## [Small seeds in Xoshiro?](https://discourse.julialang.org/t/small-seeds-in-xoshiro/123652)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [December 10, 2024, 11:15am UTC](https://discourse.julialang.org/t/small-seeds-in-xoshiro/123652 "2024-12-10T11:15:26Z")

</div>

There used to be a rule of thumb for Mersenne Twister that it’s good to pick a large number for rng seed. Is that still relevant for newer families like Xoshiro?

---

## [Listen on both IPv4 and IPv6](https://discourse.julialang.org/t/listen-on-both-ipv4-and-ipv6/123651)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 4\
**Last updated:** [December 10, 2024, 9:43am UTC](https://discourse.julialang.org/t/listen-on-both-ipv4-and-ipv6/123651 "2024-12-10T09:43:39Z")

</div>

I’m trying to listen on both IPv4 and IPv6. ear4=listen(IPv4(0),port) ear6=listen(IPv6(0),port) This resulted in IOError: listen: address already in use (EADDRINUSE) on the IPv6 line. I’m running Linux, and if I re…

---

## [Accelerate column-wise subtraction of a vector to a matrix](https://discourse.julialang.org/t/accelerate-column-wise-subtraction-of-a-vector-to-a-matrix/123619)

<div class="topic-metadata">

**Author:** [@matnbo](https://discourse.julialang.org/u/matnbo)\
**Replies:** 10\
**Last updated:** [December 10, 2024, 8:06am UTC](https://discourse.julialang.org/t/accelerate-column-wise-subtraction-of-a-vector-to-a-matrix/123619 "2024-12-10T08:06:27Z")

</div>

I try to accelerate the computation of the following operation: I have a matrix X (n, p) and a vector v (p). For each j {= 1,…,p}, I want to compute the differences X\[i, j\] - v\[j\] {i = 1,…,n}. and, this, on CPU (not G…

---

## [Default constructor not generated for struct created by \`eval\`](https://discourse.julialang.org/t/default-constructor-not-generated-for-struct-created-by-eval/123602)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 5\
**Last updated:** [December 10, 2024, 3:01am UTC](https://discourse.julialang.org/t/default-constructor-not-generated-for-struct-created-by-eval/123602 "2024-12-10T03:01:58Z")

</div>

I’m trying to write a function to “vectorize” a struct. A plain struct would be defined like: struct Bus{T} vm::T end And I want the output to be: struct BusVec{T} vm::Vector{T} end A function is implemented …

---

## [Concise way to apply one docstring to multiple items](https://discourse.julialang.org/t/concise-way-to-apply-one-docstring-to-multiple-items/123637)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 2\
**Last updated:** [December 9, 2024, 11:13pm UTC](https://discourse.julialang.org/t/concise-way-to-apply-one-docstring-to-multiple-items/123637 "2024-12-09T23:13:33Z")

</div>

Eg, I would like to put all of these in the same docstring: padintm5 = generate\_formatter( "%-5i") padstrm21 = generate\_formatter( "%-21s") padstr4 = generate\_formatter( "%4s") padint3 = generate\_formatter( "%3i") …

---

## [How to perform region decomposition on unstructured grids？](https://discourse.julialang.org/t/how-to-perform-region-decomposition-on-unstructured-grids/123621)

<div class="topic-metadata">

**Author:** [@lyubing](https://discourse.julialang.org/u/lyubing)\
**Replies:** 3\
**Last updated:** [December 9, 2024, 2:48pm UTC](https://discourse.julialang.org/t/how-to-perform-region-decomposition-on-unstructured-grids/123621 "2024-12-09T14:48:56Z")

</div>

How to achieve domain decomposition of finite element mesh in Julia by calling the METIS library? Or what recommended packages can achieve this function？

---

## [Chain rule not working as expected with Symbolic series](https://discourse.julialang.org/t/chain-rule-not-working-as-expected-with-symbolic-series/123598)

<div class="topic-metadata">

**Author:** [@willrae42](https://discourse.julialang.org/u/willrae42)\
**Replies:** 1\
**Last updated:** [December 9, 2024, 8:45am UTC](https://discourse.julialang.org/t/chain-rule-not-working-as-expected-with-symbolic-series/123598 "2024-12-09T08:45:32Z")

</div>

I’m playing around with using Julia for some perturbation problems and am wanting to be able to take derivatives of series expansions. However, I have been unable to get the chain rule to properly apply. I’m pretty new, …

---

## [Best way to share a Julia project with non-programmers](https://discourse.julialang.org/t/best-way-to-share-a-julia-project-with-non-programmers/123549)

<div class="topic-metadata">

**Author:** [@TheHedgehog2000](https://discourse.julialang.org/u/TheHedgehog2000)\
**Replies:** 6\
**Last updated:** [December 8, 2024, 9:33pm UTC](https://discourse.julialang.org/t/best-way-to-share-a-julia-project-with-non-programmers/123549 "2024-12-08T21:33:12Z")

</div>

Sorry if this is redundant with previous questions. I have written a project in Julia and would like people who interact minimally with computers to be able to use it without feeling intimidated. juliac would be great fo…

---

## [Error setting mixed type Cmd environment](https://discourse.julialang.org/t/error-setting-mixed-type-cmd-environment/123588)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 3\
**Last updated:** [December 8, 2024, 3:35pm UTC](https://discourse.julialang.org/t/error-setting-mixed-type-cmd-environment/123588 "2024-12-08T15:35:41Z")

</div>

The following command results in error because it has mixed strings and integers. Cmd(ampl PF.run,env=(“param1”=\>1,“param2”=\>“abc”)) ERROR: MethodError: no method matching byteenv(::Tuple{Pair{String, Int64}, Pair{St…

---

## [Listing all functions in /src that are directly called by a given function, and vice versa](https://discourse.julialang.org/t/listing-all-functions-in-src-that-are-directly-called-by-a-given-function-and-vice-versa/123521)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 5\
**Last updated:** [December 7, 2024, 11:36pm UTC](https://discourse.julialang.org/t/listing-all-functions-in-src-that-are-directly-called-by-a-given-function-and-vice-versa/123521 "2024-12-07T23:36:00Z")

</div>

I manually generated the See also section in the docstring below: """ update\_lgTble!(lg\_table, comms, idx1, idx2) Updates the lg\_table vector based on game results stored in Comms. # Arguments - \`lg\_table :: MVect…

---

## [Julia 1.11.1 gives different results from 1.10.5](https://discourse.julialang.org/t/julia-1-11-1-gives-different-results-from-1-10-5/123433)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 56\
**Last updated:** [December 7, 2024, 7:17pm UTC](https://discourse.julialang.org/t/julia-1-11-1-gives-different-results-from-1-10-5/123433 "2024-12-07T19:17:36Z")

</div>

I fear I have to start debugging. But: perhaps someone has had this experience already and there is a fix?

---

## [Mutable structs with all constant fields outperform immutable structs for equality comparison](https://discourse.julialang.org/t/mutable-structs-with-all-constant-fields-outperform-immutable-structs-for-equality-comparison/123430)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 1\
**Last updated:** [December 4, 2024, 12:13am UTC](https://discourse.julialang.org/t/mutable-structs-with-all-constant-fields-outperform-immutable-structs-for-equality-comparison/123430 "2024-12-04T00:13:04Z")

</div>

MWE: julia\> x1 = \[rand(Int) for \_=1:1000\]; julia\> x2 = \[rand(Int) for \_=1:1000\]; julia\> v1 = \[rand(3,3) for \_=1:1000\]; julia\> v2 = \[rand(3,3) for \_=1:1000\]; julia\> struct myT a::Int b::Any end …

---

## [How to obtain val.argument of KeySet of OrderCollection?](https://discourse.julialang.org/t/how-to-obtain-val-argument-of-keyset-of-ordercollection/123547)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 4\
**Last updated:** [December 7, 2024, 7:03am UTC](https://discourse.julialang.org/t/how-to-obtain-val-argument-of-keyset-of-ordercollection/123547 "2024-12-07T07:03:17Z")

</div>

Assume given flatten(a) = collect(Iterators.flatten(a)) Assume furthermore given julia\> diff\_eom.equations OrderedCollections.OrderedDict{Symbolics.Num, Symbolics.Equation} with 1 entry: x(t) =\> Differential(t)(Dif…

---

## [Suggestion for package docstrings](https://discourse.julialang.org/t/suggestion-for-package-docstrings/123548)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 3\
**Last updated:** [December 7, 2024, 6:29am UTC](https://discourse.julialang.org/t/suggestion-for-package-docstrings/123548 "2024-12-07T06:29:00Z")

</div>

""" Package MyPackage v$(pkgversion(MyPackage)) MyPackage does this and that, and this text can be the the same as the "About" on it's github page. Docs under https://mypackageauthor.github.io/MyPackage.jl/ $(isnot…

---

## [How to convert Milliseconds to Int64?](https://discourse.julialang.org/t/how-to-convert-milliseconds-to-int64/84218)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [December 7, 2024, 6:02am UTC](https://discourse.julialang.org/t/how-to-convert-milliseconds-to-int64/84218 "2024-12-07T06:02:52Z")

</div>

The following is not working: julia\> diff=Dates.Millisecond(55) 55 milliseconds julia\> convert(Int64, diff) ERROR: MethodError: Cannot \`convert\` an object of type Millisecond to an object of type Int64 Closest candidat…

---

## [Are there any helpers for searching a complex code base in VS Code?](https://discourse.julialang.org/t/are-there-any-helpers-for-searching-a-complex-code-base-in-vs-code/123522)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [December 6, 2024, 7:38pm UTC](https://discourse.julialang.org/t/are-there-any-helpers-for-searching-a-complex-code-base-in-vs-code/123522 "2024-12-06T19:38:27Z")

</div>

LSP is no help. What do people use? Is there an extension for that sort of thing?

---

## [Custom REPL keymap does not work](https://discourse.julialang.org/t/custom-repl-keymap-does-not-work/123546)

<div class="topic-metadata">

**Author:** [@Sixzero](https://discourse.julialang.org/u/Sixzero)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 4:25pm UTC](https://discourse.julialang.org/t/custom-repl-keymap-does-not-work/123546 "2024-12-06T16:25:42Z")

</div>

I’m trying to create a custom REPL mode with custom keybindings. Here’s an MVP that demonstrates this issue with prints: using REPL using ReplMaker using REPL.LineEdit: MIState # Simple parser that echoes input parser…

---

## [Is there a feature like C's #define in order to compile or not e.g. println](https://discourse.julialang.org/t/is-there-a-feature-like-cs-define-in-order-to-compile-or-not-e-g-println/123542)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 4\
**Last updated:** [December 6, 2024, 5:07pm UTC](https://discourse.julialang.org/t/is-there-a-feature-like-cs-define-in-order-to-compile-or-not-e-g-println/123542 "2024-12-06T17:07:47Z")

</div>

Hi, I would like to activate/deactivate integration of some println in my compiled code. I guess I could set a debug constant and fill the code with: const debug = 0 if debug == 1 println("value = " \* value) end …

---

## [Disable rounding when displaying Dataframe values](https://discourse.julialang.org/t/disable-rounding-when-displaying-dataframe-values/123541)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 3:07pm UTC](https://discourse.julialang.org/t/disable-rounding-when-displaying-dataframe-values/123541 "2024-12-06T15:07:58Z")

</div>

Hi, is it possible to disable rounding when displaying Dataframe values ? For instance, I spent a few minutes trying to figure out why I got the year 2001.0 (Float) in my dataframe where I should have read 2000.9999.

---

## [Where are saved git-commited packages?](https://discourse.julialang.org/t/where-are-saved-git-commited-packages/123527)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [December 6, 2024, 2:22pm UTC](https://discourse.julialang.org/t/where-are-saved-git-commited-packages/123527 "2024-12-06T14:22:02Z")

</div>

When I run: Pkg.add(url="git@github.com:sylvaticus/DICE.jl.git", rev="master") (without Pkg.dev) where the source code of the package is saved ?

---

## [Using PyPlot on MacOS](https://discourse.julialang.org/t/using-pyplot-on-macos/123512)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 5\
**Last updated:** [December 6, 2024, 1:08pm UTC](https://discourse.julialang.org/t/using-pyplot-on-macos/123512 "2024-12-06T13:08:18Z")

</div>

Apologies for being confused and not very constructive. This issue was discussed on this forum before. I thought I had this fixed after updating conda. It was working. But then inadvertly I broke it again. I am trying…

---

## [Problem installing prerequisites for building Julia](https://discourse.julialang.org/t/problem-installing-prerequisites-for-building-julia/105128)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 15\
**Last updated:** [December 6, 2024, 12:46pm UTC](https://discourse.julialang.org/t/problem-installing-prerequisites-for-building-julia/105128 "2024-12-06T12:46:39Z")

</div>

The README for the official julia repo links to this set of instructions for building julia. The latter link states that On Debian-based distributions (e.g. Ubuntu), you can easily install them with apt-get: sudo apt-…

---

## [Add type's method to Base](https://discourse.julialang.org/t/add-types-method-to-base/123529)

<div class="topic-metadata">

**Author:** [@nabla](https://discourse.julialang.org/u/nabla)\
**Replies:** 2\
**Last updated:** [December 6, 2024, 11:18am UTC](https://discourse.julialang.org/t/add-types-method-to-base/123529 "2024-12-06T11:18:08Z")

</div>

I want to add a method directly to Base (it’s a basic operation :(!)). I’m aware of set\_override\_module(jl\_base\_module) and unset\_override\_module(). However, I want to define a method for an object myclass, and the foll…

---

## [Unable to automatically install 'Libtiff' from](https://discourse.julialang.org/t/unable-to-automatically-install-libtiff-from/123434)

<div class="topic-metadata">

**Author:** [@jay\_Gao](https://discourse.julialang.org/u/jay_Gao)\
**Replies:** 4\
**Last updated:** [December 6, 2024, 10:57am UTC](https://discourse.julialang.org/t/unable-to-automatically-install-libtiff-from/123434 "2024-12-06T10:57:12Z")

</div>

when I am trying to install “ContactImplicitMPC” package in Julia 1.6.7 ,I get the error message: (examples) pkg\> add ContactImplicitMPC Resolving package versions... Downloaded artifact: Libtiff Downloaded ar…

---

## [WGLMakie plot size in Grid](https://discourse.julialang.org/t/wglmakie-plot-size-in-grid/123526)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 9:40am UTC](https://discourse.julialang.org/t/wglmakie-plot-size-in-grid/123526 "2024-12-06T09:40:23Z")

</div>

I’m using Bonito.Grid with Makie plots. I find that while Grid works generally as advertised, the Makie plots seem quite stubborn about their figure size, and do not generally “take the space available for them”, but rat…

---

## [How to rebuild toml files?](https://discourse.julialang.org/t/how-to-rebuild-toml-files/123523)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 5\
**Last updated:** [December 6, 2024, 9:26am UTC](https://discourse.julialang.org/t/how-to-rebuild-toml-files/123523 "2024-12-06T09:26:34Z")

</div>

My package under development has the file structure MyPackage/src and MyPackage/examples. My development process has been: julia\> using Revise pkg\> dev . pkg\> activate ./examples julia\> include("./examples/first\_exampl…

---

## [About registrator](https://discourse.julialang.org/t/about-registrator/123446)

<div class="topic-metadata">

**Author:** [@Andrea\_Vigliotti](https://discourse.julialang.org/u/Andrea_Vigliotti)\
**Replies:** 3\
**Last updated:** [December 6, 2024, 8:20am UTC](https://discourse.julialang.org/t/about-registrator/123446 "2024-12-06T08:20:25Z")

</div>

HI all, I made some small modification to a registered package, AD4SM.jl, I am the only contributor, and I called registrator from the web interface from here the new (0.0.5) version was accepted and is now visible her…

---

## [Too many bifurcation points marked](https://discourse.julialang.org/t/too-many-bifurcation-points-marked/123504)

<div class="topic-metadata">

**Author:** [@Caitlin\_Lienkaemper](https://discourse.julialang.org/u/Caitlin_Lienkaemper)\
**Replies:** 8\
**Last updated:** [December 6, 2024, 5:18am UTC](https://discourse.julialang.org/t/too-many-bifurcation-points-marked/123504 "2024-12-06T05:18:59Z")

</div>

I’m trying to use BifurcationKit.jl to continue a periodic orbit in a 2d dynamical system. Currently, I’m seeing “too many” bifurcation points marked, i.e. blue points marked “bp” appear where the system does not change …

---

## [Malt.jl: Running into world age problems](https://discourse.julialang.org/t/malt-jl-running-into-world-age-problems/123457)

<div class="topic-metadata">

**Author:** [@Parazetamol](https://discourse.julialang.org/u/Parazetamol)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 3:42am UTC](https://discourse.julialang.org/t/malt-jl-running-into-world-age-problems/123457 "2024-12-06T03:42:25Z")

</div>

Hi there, this naive usage of Malt.jl leads to “method too new to be called from this world contex”: module GreatNewModule f()="dummy" end In a separate project (after dev’ed GreatNewModule of course) using GreatNewM…

---

## [Julia incorrect with function argument](https://discourse.julialang.org/t/julia-incorrect-with-function-argument/123520)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 1\
**Last updated:** [December 6, 2024, 12:33am UTC](https://discourse.julialang.org/t/julia-incorrect-with-function-argument/123520 "2024-12-06T00:33:47Z")

</div>

Hi! Please help me to understand whats wrong with julia logic. The following code print out: println(typeof(section)) \>\> CxxWrap.CxxWrapCore.CxxPtr{Main.CppTypes.ISection} I wish to write function which take this (an…

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

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