# General Usage

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

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

**Page:** 221

---

## [Ferrite 2D problem unphysical results](https://discourse.julialang.org/t/ferrite-2d-problem-unphysical-results/107037)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 2\
**Last updated:** [December 13, 2023, 2:21pm UTC](https://discourse.julialang.org/t/ferrite-2d-problem-unphysical-results/107037 "2023-12-13T14:21:47Z")

</div>

Hello, I am using the latest version of Ferrite (Ferrite v0.3.14). I’ve simplified my problem to a small 2D rectangular structure (height = 1; width = 2). The left side is clamped, and on the right-hand side, there is s…

---

## [Where is 'findprev' located?](https://discourse.julialang.org/t/where-is-findprev-located/107407)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 7\
**Last updated:** [December 13, 2023, 2:01pm UTC](https://discourse.julialang.org/t/where-is-findprev-located/107407 "2023-12-13T14:01:49Z")

</div>

I guess it is from the Base module. How to find it out?

---

## [Configurations.jl Read Vector of Multiple Possible Types from TOML File](https://discourse.julialang.org/t/configurations-jl-read-vector-of-multiple-possible-types-from-toml-file/107541)

<div class="topic-metadata">

**Author:** [@matthew3245](https://discourse.julialang.org/u/matthew3245)\
**Replies:** 2\
**Last updated:** [December 13, 2023, 1:24am UTC](https://discourse.julialang.org/t/configurations-jl-read-vector-of-multiple-possible-types-from-toml-file/107541 "2023-12-13T01:24:24Z")

</div>

Say that I have two custom option types, TypeA and TypeB defined below: using Configurations @option "type\_a" struct TypeA type::Reflect a::Int end @option "type\_b" struct TypeB type::Reflect b::Int en…

---

## [Even more interactive REPL](https://discourse.julialang.org/t/even-more-interactive-repl/107537)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 3\
**Last updated:** [December 13, 2023, 12:06am UTC](https://discourse.julialang.org/t/even-more-interactive-repl/107537 "2023-12-13T00:06:37Z")

</div>

Hi all :slight\_smile: Just stumbled over this. How difficult is it to implement such a repl mode?

---

## [Instantiating function from type?](https://discourse.julialang.org/t/instantiating-function-from-type/107532)

<div class="topic-metadata">

**Author:** [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Replies:** 4\
**Last updated:** [December 12, 2023, 11:56pm UTC](https://discourse.julialang.org/t/instantiating-function-from-type/107532 "2023-12-12T23:56:07Z")

</div>

Given the type F of a function, is there a good/documented way to instantiate the underlying function if possible? F() doesn’t work, but I feel like it should: julia\> F = typeof(sin) typeof(sin) (singleton type of func…

---

## [Product of permutations without allocation](https://discourse.julialang.org/t/product-of-permutations-without-allocation/107366)

<div class="topic-metadata">

**Author:** [@lance\_xwq](https://discourse.julialang.org/u/lance_xwq)\
**Replies:** 11\
**Last updated:** [December 12, 2023, 10:48pm UTC](https://discourse.julialang.org/t/product-of-permutations-without-allocation/107366 "2023-12-12T22:48:15Z")

</div>

Hello, I’m trying to write a piece of code involving calculating the product of permutations, as defined here, for each column of a matrix. Here are three MWEs: function apply\_perm1!(A::AbstractMatrix{\<:Integer}, B::Ab…

---

## [ReverseDiff.jl failing with the Base.tanh function?](https://discourse.julialang.org/t/reversediff-jl-failing-with-the-base-tanh-function/107474)

<div class="topic-metadata">

**Author:** [@Alejandro\_Quiaro\_San](https://discourse.julialang.org/u/Alejandro_Quiaro_San)\
**Replies:** 5\
**Last updated:** [December 12, 2023, 9:52pm UTC](https://discourse.julialang.org/t/reversediff-jl-failing-with-the-base-tanh-function/107474 "2023-12-12T21:52:45Z")

</div>

Hello Guys, I’m trying to build a probabilistic model in Turing.jl, and it is supposed that when you change the AD backend to :reversediff you get computational improvements. I have a forward operator inside my probabil…

---

## [Dataframe unstack() column order](https://discourse.julialang.org/t/dataframe-unstack-column-order/107481)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 5\
**Last updated:** [December 12, 2023, 4:50pm UTC](https://discourse.julialang.org/t/dataframe-unstack-column-order/107481 "2023-12-12T16:50:06Z")

</div>

Given this dataframe holding counts of a product (actually HPC compute partition) per week: julia\> describe(df\_agg) 3×7 DataFrame Row │ variable mean min median max nmissing eltype │ Symbol …

---

## [CxxWrap How to handle Array of Array](https://discourse.julialang.org/t/cxxwrap-how-to-handle-array-of-array/107498)

<div class="topic-metadata">

**Author:** [@kemu](https://discourse.julialang.org/u/kemu)\
**Replies:** 0\
**Last updated:** [December 12, 2023, 1:10pm UTC](https://discourse.julialang.org/t/cxxwrap-how-to-handle-array-of-array/107498 "2023-12-12T13:10:07Z")

</div>

I am using CxxWrap to create a simple wrapper for OpenCV. cv::decomposeHomographyMat() takes std::vector\<cv::Mat\> as an argument, how can I wrap this? I tried jlcxx::ArrayRef\<jlcxx::ArrayRef\<double, 2\>, 1\> but I get st…

---

## [Julia equivalent to C's vsnprintf](https://discourse.julialang.org/t/julia-equivalent-to-cs-vsnprintf/107467)

<div class="topic-metadata">

**Author:** [@mpeters2](https://discourse.julialang.org/u/mpeters2)\
**Replies:** 6\
**Last updated:** [December 12, 2023, 12:29pm UTC](https://discourse.julialang.org/t/julia-equivalent-to-cs-vsnprintf/107467 "2023-12-12T12:29:11Z")

</div>

I’m try to translate some C code to Julia, but I’m a little stumped with how to tackle this. First, there is this macro as well as two global variables: // Shared buffer for variadic text static char\* fc\_buffer = NULL;…

---

## [How to copy the result of python to Julia without allocation memory using PyCall](https://discourse.julialang.org/t/how-to-copy-the-result-of-python-to-julia-without-allocation-memory-using-pycall/107480)

<div class="topic-metadata">

**Author:** [@wly](https://discourse.julialang.org/u/wly)\
**Replies:** 8\
**Last updated:** [December 12, 2023, 11:49am UTC](https://discourse.julialang.org/t/how-to-copy-the-result-of-python-to-julia-without-allocation-memory-using-pycall/107480 "2023-12-12T11:49:19Z")

</div>

I have a Python program whose results will be saved in a big numpy array. I want to use this result in my Julia program, but I find that accessing the data will cause memory allocation in Julia. A demo is as follows: us…

---

## [Tracking other packages with DrWatson's tagsave](https://discourse.julialang.org/t/tracking-other-packages-with-drwatsons-tagsave/107345)

<div class="topic-metadata">

**Author:** [@wave\_and\_matter](https://discourse.julialang.org/u/wave_and_matter)\
**Replies:** 3\
**Last updated:** [December 12, 2023, 9:10am UTC](https://discourse.julialang.org/t/tracking-other-packages-with-drwatsons-tagsave/107345 "2023-12-12T09:10:52Z")

</div>

I have recently become interested in DrWatson. One of the most important features seems to be “tagsave” which allows me to easily associate data with the julia/drwatson project where it was created, including the git ver…

---

## [Threads.@spawn weird ouput message](https://discourse.julialang.org/t/threads-spawn-weird-ouput-message/94548)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 6\
**Last updated:** [December 12, 2023, 1:57am UTC](https://discourse.julialang.org/t/threads-spawn-weird-ouput-message/94548 "2023-12-12T01:57:51Z")

</div>

Hi everyone, I am testing two parallel versions of my loop - one with @threads and one with @spawn. Weirdly, @spawn finishes in a fraction of the time @threads needs, makes much fewer allocations, and gives me this weir…

---

## [Allocations when iterating Combinatorics.Combinations](https://discourse.julialang.org/t/allocations-when-iterating-combinatorics-combinations/107389)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 8\
**Last updated:** [December 11, 2023, 11:54pm UTC](https://discourse.julialang.org/t/allocations-when-iterating-combinatorics-combinations/107389 "2023-12-11T23:54:07Z")

</div>

I can’t see why/where allocations are occurring when iterating a Combinatorics.Combinations object. Here’s the relevant code extract from the Combinatorics package: #The Combinations iterator struct Combinations n:…

---

## [Understanding performance of vectors](https://discourse.julialang.org/t/understanding-performance-of-vectors/107455)

<div class="topic-metadata">

**Author:** [@D-Se](https://discourse.julialang.org/u/D-Se)\
**Replies:** 6\
**Last updated:** [December 11, 2023, 11:10pm UTC](https://discourse.julialang.org/t/understanding-performance-of-vectors/107455 "2023-12-11T23:10:52Z")

</div>

I have created a toy package, TicTacToes.jl to try and write and package some performant Julia code. When trying to write an example on how to use make a (bad) agent play itself, I didn’t understand the performance of o…

---

## [Creating a plot containing subplots called from a function](https://discourse.julialang.org/t/creating-a-plot-containing-subplots-called-from-a-function/107405)

<div class="topic-metadata">

**Author:** [@evilrho](https://discourse.julialang.org/u/evilrho)\
**Replies:** 6\
**Last updated:** [December 11, 2023, 7:22pm UTC](https://discourse.julialang.org/t/creating-a-plot-containing-subplots-called-from-a-function/107405 "2023-12-11T19:22:10Z")

</div>

Question about plotting, plot handles, subplots, etc. I’m trying to make a plot function that accepts a vector of a custom data structure. For each entry in the vector, another plot function is called which plots an indi…

---

## [End of Month for Date](https://discourse.julialang.org/t/end-of-month-for-date/107462)

<div class="topic-metadata">

**Author:** [@gsinha](https://discourse.julialang.org/u/gsinha)\
**Replies:** 2\
**Last updated:** [December 11, 2023, 7:21pm UTC](https://discourse.julialang.org/t/end-of-month-for-date/107462 "2023-12-11T19:21:39Z")

</div>

Why does this not work for rolling the date to 2023-06-30? ceil(Date("2023-06-01"), Month) - Day(1) The following works for every other date in that month, e.g ceil(Date("2023-06-02"), Month) - Day(1)

---

## [Type for large "float like" integers?](https://discourse.julialang.org/t/type-for-large-float-like-integers/107454)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 8\
**Last updated:** [December 11, 2023, 5:32pm UTC](https://discourse.julialang.org/t/type-for-large-float-like-integers/107454 "2023-12-11T17:32:34Z")

</div>

Out of curiosity, is there a provided primitive type to represent a very large integer number with a fixed precision (e.g. 64), for example for an integer like 4.35e435 ? Obviously the information about this monster num…

---

## [Help on reported JET issue when using StaticArrays](https://discourse.julialang.org/t/help-on-reported-jet-issue-when-using-staticarrays/107444)

<div class="topic-metadata">

**Author:** [@mestinso](https://discourse.julialang.org/u/mestinso)\
**Replies:** 3\
**Last updated:** [December 11, 2023, 4:33pm UTC](https://discourse.julialang.org/t/help-on-reported-jet-issue-when-using-staticarrays/107444 "2023-12-11T16:33:18Z")

</div>

I am doing some analysis of some of my code using JET.jl. When I use StaticArrays in the following way (below is a MWE), report\_call from JET is unhappy: a=MVector(1,2,3,4,5) b=MVector(6,7,8,9,10) @report\_call b\[a.==2\]…

---

## [Double Pendulum Animation with Julia](https://discourse.julialang.org/t/double-pendulum-animation-with-julia/89142)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 10\
**Last updated:** [December 11, 2023, 4:02pm UTC](https://discourse.julialang.org/t/double-pendulum-animation-with-julia/89142 "2023-12-11T16:02:12Z")

</div>

Hi all, I saw this webpages: https://math24.net/double-pendulum.html https://www.myphysicslab.com/pendulum/double-pendulum-en.html and wonder how to create the double pendulum animation with its track in Julia? If p…

---

## [Broadcasting getproperty over an empty vector of structs does return Any\[\] instead of a concrete type](https://discourse.julialang.org/t/broadcasting-getproperty-over-an-empty-vector-of-structs-does-return-any-instead-of-a-concrete-type/107439)

<div class="topic-metadata">

**Author:** [@florian](https://discourse.julialang.org/u/florian)\
**Replies:** 2\
**Last updated:** [December 11, 2023, 3:58pm UTC](https://discourse.julialang.org/t/broadcasting-getproperty-over-an-empty-vector-of-structs-does-return-any-instead-of-a-concrete-type/107439 "2023-12-11T15:58:48Z")

</div>

I’m not sure if this is a bug, or if I am missing something: struct X a::String end struct Y a::String b::Vector{String} end x = X\[\] y = Y\[\] Broadcasting getproperty(..., :a) over x and y does return Stri…

---

## [REPL open editor mode](https://discourse.julialang.org/t/repl-open-editor-mode/107446)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 1\
**Last updated:** [December 11, 2023, 3:27pm UTC](https://discourse.julialang.org/t/repl-open-editor-mode/107446 "2023-12-11T15:27:37Z")

</div>

In the JuliaCon 2023 State of Julia talk the mode where the REPL can open your favourite $EDITOR was mentioned. I thought this was done using CTRL-E Did I misunderstand this?

---

## [Numerical differences depending on loading order](https://discourse.julialang.org/t/numerical-differences-depending-on-loading-order/107362)

<div class="topic-metadata">

**Author:** [@philbit](https://discourse.julialang.org/u/philbit)\
**Replies:** 16\
**Last updated:** [December 11, 2023, 1:11pm UTC](https://discourse.julialang.org/t/numerical-differences-depending-on-loading-order/107362 "2023-12-11T13:11:49Z")

</div>

We are doing large-scale numerical simulations and discovered a reproducibility issue with our numerical code, where the output was different depending on whether we were producing plots on the fly or not. After an “exci…

---

## [Memoizing a function using only a subset of arguments as an identifier](https://discourse.julialang.org/t/memoizing-a-function-using-only-a-subset-of-arguments-as-an-identifier/107426)

<div class="topic-metadata">

**Author:** [@Aleksandr\_Mikheev](https://discourse.julialang.org/u/Aleksandr_Mikheev)\
**Replies:** 3\
**Last updated:** [December 11, 2023, 12:16pm UTC](https://discourse.julialang.org/t/memoizing-a-function-using-only-a-subset-of-arguments-as-an-identifier/107426 "2023-12-11T12:16:20Z")

</div>

Suppose I have a function of two arguments. For instance, function foo(a::Float64,b::Float64) return a^2 - b end Is it possible to memoize it based on the first argument only? I understand how I can partially achiev…

---

## [Multi-threading + curve\_fit no acceleration but increase the memory consumption on my server](https://discourse.julialang.org/t/multi-threading-curve-fit-no-acceleration-but-increase-the-memory-consumption-on-my-server/107429)

<div class="topic-metadata">

**Author:** [@aTrotier](https://discourse.julialang.org/u/aTrotier)\
**Replies:** 0\
**Last updated:** [December 11, 2023, 11:40am UTC](https://discourse.julialang.org/t/multi-threading-curve-fit-no-acceleration-but-increase-the-memory-consumption-on-my-server/107429 "2023-12-11T11:40:11Z")

</div>

Hi, I am working with 3D + temporal dimension (12812896\*50) MRI datasets that I want to fit using curve\_fit with the following model. The memory consumption is particularly important using multi-threading and does not …

---

## [Troubleshooting an Unhandled error in Parallel Computation on a Slurm Cluster](https://discourse.julialang.org/t/troubleshooting-an-unhandled-error-in-parallel-computation-on-a-slurm-cluster/107427)

<div class="topic-metadata">

**Author:** [@shahmari](https://discourse.julialang.org/u/shahmari)\
**Replies:** 0\
**Last updated:** [December 11, 2023, 10:43am UTC](https://discourse.julialang.org/t/troubleshooting-an-unhandled-error-in-parallel-computation-on-a-slurm-cluster/107427 "2023-12-11T10:43:26Z")

</div>

Hello Julia community! I’m encountering an issue with distributing some computation across threads of multiple nodes in a Slurm cluster. I’m using Distributed.jl, SlurmClusterManager.jl, and SharedArrays.jl to paralleli…

---

## [CondaPkg - acitvate environment](https://discourse.julialang.org/t/condapkg-acitvate-environment/107341)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [December 11, 2023, 9:31am UTC](https://discourse.julialang.org/t/condapkg-acitvate-environment/107341 "2023-12-11T09:31:30Z")

</div>

I am using CondaPkg and installed two Python packages. After installation I get the message: To activate this environment, use: micromamba activate /home/ufechner/repos/Tethers.jl/.CondaPkg/env But that does not w…

---

## [Problem escaping 2nd dollar sign in plot title](https://discourse.julialang.org/t/problem-escaping-2nd-dollar-sign-in-plot-title/107388)

<div class="topic-metadata">

**Author:** [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Replies:** 4\
**Last updated:** [December 11, 2023, 6:23am UTC](https://discourse.julialang.org/t/problem-escaping-2nd-dollar-sign-in-plot-title/107388 "2023-12-11T06:23:25Z")

</div>

Suppose I want a plot with the title “if you give me $2 then i will give you $1” If i construct str = "if you give me \\$2 then i will give you \\$1" then println(str) returns if you give me $2 then i will give you $…

---

## [Error with setting TZ=UTC when running touch in Julia](https://discourse.julialang.org/t/error-with-setting-tz-utc-when-running-touch-in-julia/107315)

<div class="topic-metadata">

**Author:** [@KeepLearning](https://discourse.julialang.org/u/KeepLearning)\
**Replies:** 2\
**Last updated:** [December 11, 2023, 2:32am UTC](https://discourse.julialang.org/t/error-with-setting-tz-utc-when-running-touch-in-julia/107315 "2023-12-11T02:32:47Z")

</div>

Hi, I wanted to run the unix command in Julia as follows: run(\`TZ=UTC touch -t "YYMMDDhhmm" filename\`) but got an IOError, assuming that I am in a different time zone from UTC and wanted to set the timestamp of a file…

---

## [‘show’ function for user-defined struct](https://discourse.julialang.org/t/show-function-for-user-defined-struct/107391)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 1\
**Last updated:** [December 11, 2023, 12:14am UTC](https://discourse.julialang.org/t/show-function-for-user-defined-struct/107391 "2023-12-11T00:14:56Z")

</div>

julia\> struct my age :: Int weight :: Float64 end julia\> function Base.show(io::IO, h::my) print(io,"my struct") end Here I defined a struct and a new method for the function ‘show’. …

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

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