# General Usage

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

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

**Page:** 253

---

## [\[DiffEqParamEstim.jl\] Add a findfit function](https://discourse.julialang.org/t/diffeqparamestim-jl-add-a-findfit-function/103384)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 1\
**Last updated:** [August 31, 2023, 11:34am UTC](https://discourse.julialang.org/t/diffeqparamestim-jl-add-a-findfit-function/103384 "2023-08-31T11:34:14Z")

</div>

Hy ! I had written a Git issue a few months ago ( Add a findfit function · Issue #220 · SciML/DiffEqParamEstim.jl (github.com)) on this subject but having had no response I take the liberty of making a post here. Since…

---

## [Can't format plot ticks when Dates or strings are used as input](https://discourse.julialang.org/t/cant-format-plot-ticks-when-dates-or-strings-are-used-as-input/103185)

<div class="topic-metadata">

**Author:** [@ultrapoci](https://discourse.julialang.org/u/ultrapoci)\
**Replies:** 3\
**Last updated:** [August 31, 2023, 9:07am UTC](https://discourse.julialang.org/t/cant-format-plot-ticks-when-dates-or-strings-are-used-as-input/103185 "2023-08-31T09:07:21Z")

</div>

Consider this piece of code: using Plots plot(1:10, rand(10), xformatter = x -\> "asd") This correctly produces a plot where the ticks on the X axis are all the string “asd”. If we instead do this: using Plots plot(st…

---

## [How can I differentiate a subset of the outputs of a neural network in Flux or Lux?](https://discourse.julialang.org/t/how-can-i-differentiate-a-subset-of-the-outputs-of-a-neural-network-in-flux-or-lux/103354)

<div class="topic-metadata">

**Author:** [@DoktorMike](https://discourse.julialang.org/u/DoktorMike)\
**Replies:** 10\
**Last updated:** [August 31, 2023, 7:20am UTC](https://discourse.julialang.org/t/how-can-i-differentiate-a-subset-of-the-outputs-of-a-neural-network-in-flux-or-lux/103354 "2023-08-31T07:20:48Z")

</div>

Is there a way in Flux or Lux to differentiate a subset of the outputs of a Neural Network model? The reason why I am asking is that I have a target matrix with 6 outputs and 3000 observations (very little data) but the …

---

## [Juliaup does not launch correct binary](https://discourse.julialang.org/t/juliaup-does-not-launch-correct-binary/103311)

<div class="topic-metadata">

**Author:** [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Replies:** 13\
**Last updated:** [August 30, 2023, 11:14pm UTC](https://discourse.julialang.org/t/juliaup-does-not-launch-correct-binary/103311 "2023-08-30T23:14:58Z")

</div>

I expect the first command below to launch 1.10.0-beta, but it doesn’t. Can anyone tell me what I am doing wrong? \> julia +1.10 -v julia version 1.9.3 \> which julia /usr/local/bin/julia \> ls -l /usr/local/bin/julia lrwx…

---

## [Creating Sparse NTuple](https://discourse.julialang.org/t/creating-sparse-ntuple/103350)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 4\
**Last updated:** [August 30, 2023, 10:06pm UTC](https://discourse.julialang.org/t/creating-sparse-ntuple/103350 "2023-08-30T22:06:51Z")

</div>

I have a problem where I want to make an NTuple of length N where I’m given indices and values for the non-zero components. The equivalent function for creating a Vector would look something like function foo(N, nzindi…

---

## [Overriding Rand.rand for vectorization](https://discourse.julialang.org/t/overriding-rand-rand-for-vectorization/103375)

<div class="topic-metadata">

**Author:** [@Ian\_L](https://discourse.julialang.org/u/Ian_L)\
**Replies:** 5\
**Last updated:** [August 30, 2023, 6:02pm UTC](https://discourse.julialang.org/t/overriding-rand-rand-for-vectorization/103375 "2023-08-30T18:02:58Z")

</div>

Hello. I have followed the advice from Random Numbers · The Julia Language to create a custom sampler for my struct. This is good first step, but I would like to modify the sampler a bit. Currently the sampler takes tree…

---

## [VS-Code Lint error in DataFrame column access](https://discourse.julialang.org/t/vs-code-lint-error-in-dataframe-column-access/103366)

<div class="topic-metadata">

**Author:** [@ArchieCall](https://discourse.julialang.org/u/ArchieCall)\
**Replies:** 4\
**Last updated:** [August 30, 2023, 2:32pm UTC](https://discourse.julialang.org/t/vs-code-lint-error-in-dataframe-column-access/103366 "2023-08-30T14:32:33Z")

</div>

The following code show a lint error in VS-Code: using DataFrames function Mainline() df = DataFrame(col\_name = 1:3) # this line runs but a linter error is displayed for col\_name var1 = minimum(df.col\_name)…

---

## [Calculation of remainder, floating point issues](https://discourse.julialang.org/t/calculation-of-remainder-floating-point-issues/103338)

<div class="topic-metadata">

**Author:** [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Replies:** 7\
**Last updated:** [August 29, 2023, 8:13pm UTC](https://discourse.julialang.org/t/calculation-of-remainder-floating-point-issues/103338 "2023-08-29T20:13:16Z")

</div>

The following remainder calculations are a bit surprising to me, as I’d expect to get a remainder of 0 (or something like ~1e-18) in each case. I guess there is some floating point issue: julia\> rem(500,0.625) 0.0 ju…

---

## [No coverage files generated outside project on Julia 1.9](https://discourse.julialang.org/t/no-coverage-files-generated-outside-project-on-julia-1-9/103359)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [August 30, 2023, 11:25am UTC](https://discourse.julialang.org/t/no-coverage-files-generated-outside-project-on-julia-1-9/103359 "2023-08-30T11:25:41Z")

</div>

I am working with two packages, where a downstream package depends on a base package. The directory structure is of the form A - Project.toml - Manifest.toml - src - \[...\] - test - \[...\] - B - Proj…

---

## [Automatically install packages used in script](https://discourse.julialang.org/t/automatically-install-packages-used-in-script/102279)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 5\
**Last updated:** [August 30, 2023, 8:27am UTC](https://discourse.julialang.org/t/automatically-install-packages-used-in-script/102279 "2023-08-30T08:27:22Z")

</div>

For some time now we can do using Package and julia will prompt the installation of the package. Wouldn’t it be nice to have a command-line option that does that, like: julia --project -pkginstall=\[no(default)/yes/prom…

---

## [How Would You Compare Metaprogramming in Julia and Tcl?](https://discourse.julialang.org/t/how-would-you-compare-metaprogramming-in-julia-and-tcl/103342)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 7\
**Last updated:** [August 30, 2023, 12:29am UTC](https://discourse.julialang.org/t/how-would-you-compare-metaprogramming-in-julia-and-tcl/103342 "2023-08-30T00:29:11Z")

</div>

Hi folks! :wave: I had a very interesting discussion today with an actual Tcl programmer (never met one before!). He and I were discussing a domain specific language (DSL) he had created in Tcl that had syntax that look…

---

## [Docker Image layer with package dependency](https://discourse.julialang.org/t/docker-image-layer-with-package-dependency/103348)

<div class="topic-metadata">

**Author:** [@A\_M](https://discourse.julialang.org/u/A_M)\
**Replies:** 0\
**Last updated:** [August 30, 2023, 12:15am UTC](https://discourse.julialang.org/t/docker-image-layer-with-package-dependency/103348 "2023-08-30T00:15:42Z")

</div>

I plan to create a docker base image with Julia and all packages for my projects. I will not copy my projects into the docker at this phase, but I have all Project. toml files. What is the proper way to get all packages …

---

## [Activate conda environment and run the conda program within Julia script](https://discourse.julialang.org/t/activate-conda-environment-and-run-the-conda-program-within-julia-script/55604)

<div class="topic-metadata">

**Author:** [@biofuture](https://discourse.julialang.org/u/biofuture)\
**Replies:** 2\
**Last updated:** [August 29, 2023, 10:46pm UTC](https://discourse.julialang.org/t/activate-conda-environment-and-run-the-conda-program-within-julia-script/55604 "2023-08-29T22:46:29Z")

</div>

Hi, developers I would like to invoke a conda environment within the Julia script and then run the program in the conda environment in Julia using run(pipeline()) to invoke them. It seems that it does not work. Does a…

---

## [Issue updating package](https://discourse.julialang.org/t/issue-updating-package/103341)

<div class="topic-metadata">

**Author:** [@polar\_rainbows](https://discourse.julialang.org/u/polar_rainbows)\
**Replies:** 1\
**Last updated:** [August 29, 2023, 7:15pm UTC](https://discourse.julialang.org/t/issue-updating-package/103341 "2023-08-29T19:15:22Z")

</div>

I tried to go to the url given on the help pages for JuliaHub (Contribute Â· JuliaHub which points to the registrator page: JuliaHub) to update a package that I have had on the repository for several months now. I got a …

---

## [TLS host certificate problem with private registry](https://discourse.julialang.org/t/tls-host-certificate-problem-with-private-registry/103312)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 12\
**Last updated:** [August 29, 2023, 7:00pm UTC](https://discourse.julialang.org/t/tls-host-certificate-problem-with-private-registry/103312 "2023-08-29T19:00:48Z")

</div>

Hello, My colleague and I are using a private registry via LocalRegistry.jl. We are using ecdsa key to ssh. Everything works on my end. However, it does not work for my colleague . Although my colleague can clone from t…

---

## [Using argument vectors along specific dimensions during broadcast()](https://discourse.julialang.org/t/using-argument-vectors-along-specific-dimensions-during-broadcast/103337)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 4\
**Last updated:** [August 29, 2023, 6:29pm UTC](https://discourse.julialang.org/t/using-argument-vectors-along-specific-dimensions-during-broadcast/103337 "2023-08-29T18:29:11Z")

</div>

I’m wondering if there is a way to use vector arguments along specific dimensions during broadcast(). For example, consider a function f(x,y,z) takeing three arguments corresponding to the 3D Cartesian coordinates. I h…

---

## [How to best carry around "state" in my program?](https://discourse.julialang.org/t/how-to-best-carry-around-state-in-my-program/103335)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 9\
**Last updated:** [August 29, 2023, 5:14pm UTC](https://discourse.julialang.org/t/how-to-best-carry-around-state-in-my-program/103335 "2023-08-29T17:14:58Z")

</div>

I have to parse a configuration file and run a simulation based on the settings in that file. In some language like Python, I’d probably make a class, say ConfigParser and it would both parse and store my configuration. …

---

## [Deploy Literate non-html files with Documenter](https://discourse.julialang.org/t/deploy-literate-non-html-files-with-documenter/66031)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 3\
**Last updated:** [August 29, 2023, 2:04pm UTC](https://discourse.julialang.org/t/deploy-literate-non-html-files-with-documenter/66031 "2023-08-29T14:04:32Z")

</div>

I’m using Literate.jl to convert example scripts to markdown (md) and Jupyter Notebook (ipynb) for the documentation. The scripts are in examples, and I have a script in docs/generate.jl that gets run as part of docs/mak…

---

## [Iterating through the fieldnames of tuples](https://discourse.julialang.org/t/iterating-through-the-fieldnames-of-tuples/103288)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 6\
**Last updated:** [August 29, 2023, 1:19pm UTC](https://discourse.julialang.org/t/iterating-through-the-fieldnames-of-tuples/103288 "2023-08-29T13:19:12Z")

</div>

Hello, I have a problem where I use several named tuples with common structure and field names, e.g.: a = (x=ones(N), y=ones(N), z=ones(N)) b = (x=ones(N), y=ones(N), z=ones(N)) I would like to loop through the fields…

---

## [The challenges of documenting generic functions](https://discourse.julialang.org/t/the-challenges-of-documenting-generic-functions/103198)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 24\
**Last updated:** [August 29, 2023, 8:28am UTC](https://discourse.julialang.org/t/the-challenges-of-documenting-generic-functions/103198 "2023-08-29T08:28:22Z")

</div>

First of all, I must apologize, in advance, for the blunt language below. I’m not going to accuse anybody. I’ll just try to describe the problems I’ve encountered. I have been using Julia for 1.5 years (and I’m sorry to…

---

## [Best practice to set limits for Julia version](https://discourse.julialang.org/t/best-practice-to-set-limits-for-julia-version/103254)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 15\
**Last updated:** [August 29, 2023, 6:42am UTC](https://discourse.julialang.org/t/best-practice-to-set-limits-for-julia-version/103254 "2023-08-29T06:42:42Z")

</div>

What is the best practice to set the limits for the Julia version of a package? To my experience packages like QML.jl that rely on C++ code break with new Julia versions. I could add for example: \[compat\] julia = "1.6…

---

## [Package compatibility constraints](https://discourse.julialang.org/t/package-compatibility-constraints/103217)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 8\
**Last updated:** [August 29, 2023, 6:00am UTC](https://discourse.julialang.org/t/package-compatibility-constraints/103217 "2023-08-29T06:00:41Z")

</div>

I put the following line into a Project.toml for a package and am trying to figure out what consequences it has: \[compat\] julia = "1.0 - 1.7" When I try to add this package in another package from Julia 1.9.3 it is acc…

---

## [Memory allocation when solving ODE with Vern7 and ContinuousCallback](https://discourse.julialang.org/t/memory-allocation-when-solving-ode-with-vern7-and-continuouscallback/101087)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 2\
**Last updated:** [August 29, 2023, 5:27am UTC](https://discourse.julialang.org/t/memory-allocation-when-solving-ode-with-vern7-and-continuouscallback/101087 "2023-08-29T05:27:39Z")

</div>

Hello, I went through a memory allocation problem in a ODE system, when using Vern7() algorithm and ContinuousCallback. The minimal working example is the following: using LinearAlgebra using SparseArrays using Ordinar…

---

## [Difference between two dates in Julia](https://discourse.julialang.org/t/difference-between-two-dates-in-julia/103048)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 8\
**Last updated:** [August 28, 2023, 11:12pm UTC](https://discourse.julialang.org/t/difference-between-two-dates-in-julia/103048 "2023-08-28T23:12:47Z")

</div>

I am trying to get difference between two dates in number of “days”. I am able to substract the two date fields but results is being produced as “n days”. As we can see below DATE\_DIFF is produced after executing below…

---

## [How Can I Display Meta-Data with PrettyTables in Julia?](https://discourse.julialang.org/t/how-can-i-display-meta-data-with-prettytables-in-julia/103310)

<div class="topic-metadata">

**Author:** [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Replies:** 2\
**Last updated:** [August 28, 2023, 8:53pm UTC](https://discourse.julialang.org/t/how-can-i-display-meta-data-with-prettytables-in-julia/103310 "2023-08-28T20:53:51Z")

</div>

When using PrettyTables to display a DataFrame, eg with an HTML back-end, the size of the DataFrame is typically displayed at the top, as shown in the figure below. Is there a way to customize this to display some basic …

---

## [Passing a struct to a function allocates whereas passing an array does not](https://discourse.julialang.org/t/passing-a-struct-to-a-function-allocates-whereas-passing-an-array-does-not/103303)

<div class="topic-metadata">

**Author:** [@simon79](https://discourse.julialang.org/u/simon79)\
**Replies:** 2\
**Last updated:** [August 28, 2023, 6:08pm UTC](https://discourse.julialang.org/t/passing-a-struct-to-a-function-allocates-whereas-passing-an-array-does-not/103303 "2023-08-28T18:08:01Z")

</div>

Hi, I noticed that the simple code example\_1! below allocates memory (lots of it when this is embedded in a large loop) whereas example\_2! does not. example\_1! takes the 3-dimenional array conn\[iel, :, :\] and, with…

---

## [How to check whether a variable is reassignable or not? (e.g. whether it is a function definition)](https://discourse.julialang.org/t/how-to-check-whether-a-variable-is-reassignable-or-not-e-g-whether-it-is-a-function-definition/103276)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 5\
**Last updated:** [August 28, 2023, 5:21pm UTC](https://discourse.julialang.org/t/how-to-check-whether-a-variable-is-reassignable-or-not-e-g-whether-it-is-a-function-definition/103276 "2023-08-28T17:21:22Z")

</div>

I have a module A and want to copy things from it to module B such that everything can be changed like before (this is needed inside Pluto). For this goal, I need to know which variable is actually a variable, because i…

---

## [SQLite.jl and LibPQ.jl packages don't work when wrapped in a package](https://discourse.julialang.org/t/sqlite-jl-and-libpq-jl-packages-dont-work-when-wrapped-in-a-package/103297)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 2\
**Last updated:** [August 28, 2023, 4:14pm UTC](https://discourse.julialang.org/t/sqlite-jl-and-libpq-jl-packages-dont-work-when-wrapped-in-a-package/103297 "2023-08-28T16:14:11Z")

</div>

Hello! I found that the SQLite.jl and LibPQ.jl packages don’t work when wrapped in a package (not a module but a package with manifest and project.toml). has anyone experienced this? module N import LibPQ import Tabl…

---

## [Convert floating point to integer type?](https://discourse.julialang.org/t/convert-floating-point-to-integer-type/103273)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 6\
**Last updated:** [August 28, 2023, 12:34pm UTC](https://discourse.julialang.org/t/convert-floating-point-to-integer-type/103273 "2023-08-28T12:34:06Z")

</div>

Currently, the float function allows one to go from an Integer type to a floating-point type. julia\> float(BigInt) BigFloat Is there a function to go the other way, that is given BigFloat as an argument, it returns Big…

---

## [Problems with BSON](https://discourse.julialang.org/t/problems-with-bson/103150)

<div class="topic-metadata">

**Author:** [@Euhan](https://discourse.julialang.org/u/Euhan)\
**Replies:** 1\
**Last updated:** [August 28, 2023, 12:06pm UTC](https://discourse.julialang.org/t/problems-with-bson/103150 "2023-08-28T12:06:42Z")

</div>

This has been discussed before, but I can’t say that I have fully understood all intricacies of the problem. I try to load an object (flux model) with BSON.@load "/pathy/path" model. I have also tried to load it with bs…

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

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