# General Usage

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

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

**Page:** 464

---

## [Postgresql Read from multi-processing](https://discourse.julialang.org/t/postgresql-read-from-multi-processing/79068)

<div class="topic-metadata">

**Author:** [@Jack](https://discourse.julialang.org/u/Jack)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 4:34pm UTC](https://discourse.julialang.org/t/postgresql-read-from-multi-processing/79068 "2022-04-06T16:34:49Z")

</div>

I use LibPQ as following to read postgresql in a docker with multiple cores ( using the Distributed package ), using LibPQ: Connection conn = Connection("""host = wrds-pgdata.wharton.upenn.edu port = port …

---

## [Unexpected Behaviour of the Rounding Function](https://discourse.julialang.org/t/unexpected-behaviour-of-the-rounding-function/79101)

<div class="topic-metadata">

**Author:** [@GrandlyHelping](https://discourse.julialang.org/u/GrandlyHelping)\
**Replies:** 7\
**Last updated:** [April 6, 2022, 4:02pm UTC](https://discourse.julialang.org/t/unexpected-behaviour-of-the-rounding-function/79101 "2022-04-06T16:02:29Z")

</div>

I am trying to round some Float64 values and don’t understand the behavior of the round() function for specific values. If I take: round(0.585, digits=2, RoundNearestTiesUp) I get 0.59, as expected, since I want value…

---

## [How to send binary data by socket with Genie?](https://discourse.julialang.org/t/how-to-send-binary-data-by-socket-with-genie/79098)

<div class="topic-metadata">

**Author:** [@D\_A](https://discourse.julialang.org/u/D_A)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 2:26pm UTC](https://discourse.julialang.org/t/how-to-send-binary-data-by-socket-with-genie/79098 "2022-04-06T14:26:22Z")

</div>

Hello, I am developing a small web application which consists of a simple page with a form, where the user has to check some boxes but mostly choose files to upload to the server so that the server runs a process and se…

---

## [Inverting a matrix of symbolic equations](https://discourse.julialang.org/t/inverting-a-matrix-of-symbolic-equations/79083)

<div class="topic-metadata">

**Author:** [@Isaiah\_Warnke](https://discourse.julialang.org/u/Isaiah_Warnke)\
**Replies:** 6\
**Last updated:** [April 6, 2022, 1:14pm UTC](https://discourse.julialang.org/t/inverting-a-matrix-of-symbolic-equations/79083 "2022-04-06T13:14:10Z")

</div>

I’d like to invert a 4x4 matrix of symbolic equations. I’m able to successfully invert a matrix of symbolic expressions like this: using Symbolics using LinearAlgebra @variables x y\[1:16\] z Symbolics.scalarize(y) eq11…

---

## [Define my own convolutional kernel/mask/filter in Flux.jl](https://discourse.julialang.org/t/define-my-own-convolutional-kernel-mask-filter-in-flux-jl/79090)

<div class="topic-metadata">

**Author:** [@Pijus](https://discourse.julialang.org/u/Pijus)\
**Replies:** 0\
**Last updated:** [April 6, 2022, 12:29pm UTC](https://discourse.julialang.org/t/define-my-own-convolutional-kernel-mask-filter-in-flux-jl/79090 "2022-04-06T12:29:17Z")

</div>

Hello all, I am trying to define my own convolutional kernels: For 1D case: \[1 -2 1\] For 2D case: | 0 1 0 | | 1 -4 1 | | 0 1 0 | Does anyone have any idea on how to do that in Flux.jl? You can only say…

---

## [History of the current (temporary) environment](https://discourse.julialang.org/t/history-of-the-current-temporary-environment/79067)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [April 6, 2022, 11:57am UTC](https://discourse.julialang.org/t/history-of-the-current-temporary-environment/79067 "2022-04-06T11:57:28Z")

</div>

Is it possible to fetch (or copy to a file) the history of the commands of specifically the current temporary environment? Such as something like: (@v1.7) pkg\> activate --temp Activating new project at \`/tmp/jl\_gaocNs…

---

## [StepRange and StepRangeLen have no common abstract class](https://discourse.julialang.org/t/steprange-and-steprangelen-have-no-common-abstract-class/79085)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 1\
**Last updated:** [April 6, 2022, 10:31am UTC](https://discourse.julialang.org/t/steprange-and-steprangelen-have-no-common-abstract-class/79085 "2022-04-06T10:31:59Z")

</div>

Hello, I would like to have a function like this (where I want to do something more interesting than printing): x = (myrange::Range) -\> print(length(range)) But I cannot find an abstract type that has both StepRange 1…

---

## [How do I define a dictionary type for tuples with functions as elements?](https://discourse.julialang.org/t/how-do-i-define-a-dictionary-type-for-tuples-with-functions-as-elements/79038)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 2\
**Last updated:** [April 6, 2022, 12:00am UTC](https://discourse.julialang.org/t/how-do-i-define-a-dictionary-type-for-tuples-with-functions-as-elements/79038 "2022-04-06T00:00:46Z")

</div>

I want to create a dictionary whose entries are 2-tuples where the second element is a function. One such dictionary would be: di1 = Dict(:C =\> (\[:AA\], identity)) However, its type does not match what I want: typeof(…

---

## [Using Intel LLVM compiler with Julia](https://discourse.julialang.org/t/using-intel-llvm-compiler-with-julia/79065)

<div class="topic-metadata">

**Author:** [@duan](https://discourse.julialang.org/u/duan)\
**Replies:** 6\
**Last updated:** [April 5, 2022, 6:51pm UTC](https://discourse.julialang.org/t/using-intel-llvm-compiler-with-julia/79065 "2022-04-05T18:51:56Z")

</div>

Since Intel C/C++ compiler has adopted LLVM, is there a way to tell Julia to use Intel compiler?

---

## [Why is the profile view so scrunched up to the right?](https://discourse.julialang.org/t/why-is-the-profile-view-so-scrunched-up-to-the-right/79063)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 7\
**Last updated:** [April 5, 2022, 6:25pm UTC](https://discourse.julialang.org/t/why-is-the-profile-view-so-scrunched-up-to-the-right/79063 "2022-04-05T18:25:21Z")

</div>

What can be done?

---

## [Precision error in Nbody simulation](https://discourse.julialang.org/t/precision-error-in-nbody-simulation/79061)

<div class="topic-metadata">

**Author:** [@staufenbach](https://discourse.julialang.org/u/staufenbach)\
**Replies:** 11\
**Last updated:** [April 5, 2022, 6:13pm UTC](https://discourse.julialang.org/t/precision-error-in-nbody-simulation/79061 "2022-04-05T18:13:02Z")

</div>

Hi, I’m currently writing a Nbody simulation using the Barnes-Hut algorithm. In order to validate what i wrote, i want to compare it to the brute force calculation. (setting the theta parameter in BH makes it degenerate…

---

## [Julia references at LLVM IR level](https://discourse.julialang.org/t/julia-references-at-llvm-ir-level/78870)

<div class="topic-metadata">

**Author:** [@knlv.ok](https://discourse.julialang.org/u/knlv.ok)\
**Replies:** 1\
**Last updated:** [April 5, 2022, 12:05pm UTC](https://discourse.julialang.org/t/julia-references-at-llvm-ir-level/78870 "2022-04-05T12:05:31Z")

</div>

Hello I’m coming to ask for your help today, because I have the following problem: As a toy example, I have implemented a multiplication function below: function mult!(res::Ref{Int16},a::Int16,b::Int16) res\[\]=a\*b …

---

## [Ntlm authentication for HTTP requests](https://discourse.julialang.org/t/ntlm-authentication-for-http-requests/26488)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 2\
**Last updated:** [April 5, 2022, 9:47am UTC](https://discourse.julialang.org/t/ntlm-authentication-for-http-requests/26488 "2022-04-05T09:47:03Z")

</div>

Hello I need to push some files into Sharepoint which requires NTLM authentication apparently. Does HTTP.jl support that type of authentication? I can’t find anything in the documentation about it one way or the other…

---

## [Custom pretty printing post-processing](https://discourse.julialang.org/t/custom-pretty-printing-post-processing/78844)

<div class="topic-metadata">

**Author:** [@jedforrest](https://discourse.julialang.org/u/jedforrest)\
**Replies:** 3\
**Last updated:** [April 5, 2022, 8:06am UTC](https://discourse.julialang.org/t/custom-pretty-printing-post-processing/78844 "2022-04-05T08:06:01Z")

</div>

I want to modify a custom pretty printing function for a type defined by another package. However, I don’t want to override their printing function, I just want to post-process the string before it is printed. In partic…

---

## [Parallel HDF5 settings](https://discourse.julialang.org/t/parallel-hdf5-settings/79028)

<div class="topic-metadata">

**Author:** [@sjhong6230](https://discourse.julialang.org/u/sjhong6230)\
**Replies:** 2\
**Last updated:** [April 5, 2022, 6:55am UTC](https://discourse.julialang.org/t/parallel-hdf5-settings/79028 "2022-04-05T06:55:59Z")

</div>

https://juliaio.github.io/HDF5.jl/stable/#Using-custom-or-system-provided-HDF5-binaries I am trying to use parallel HDF5 for my MPI I/O jobs. However, the test from the “https://github.com/JuliaIO/HDF5.jl/blob/master/te…

---

## [Can Julia always return the path to a directory with \`/\` at the end?](https://discourse.julialang.org/t/can-julia-always-return-the-path-to-a-directory-with-at-the-end/78974)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 13\
**Last updated:** [April 5, 2022, 6:14am UTC](https://discourse.julialang.org/t/can-julia-always-return-the-path-to-a-directory-with-at-the-end/78974 "2022-04-05T06:14:45Z")

</div>

In Julia, sometimes a path to a directory is returned with / at the end, but sometimes not. For example, julia\> homedir() "/users/xxxxx" julia\> joinpath(homedir(), "documents/") "/users/xxxxx/documents/" Here /users/x…

---

## [@spawn at fails when called inside a function in a module](https://discourse.julialang.org/t/spawn-at-fails-when-called-inside-a-function-in-a-module/79001)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 4\
**Last updated:** [April 5, 2022, 12:10am UTC](https://discourse.julialang.org/t/spawn-at-fails-when-called-inside-a-function-in-a-module/79001 "2022-04-05T00:10:39Z")

</div>

I have @spawnat expression run inside a function in a module and get the following error: module Test using Distributed function test() t = @spawnat :2 1==1 @show fetch(t) end end julia\> Test.test() ERROR: On…

---

## [Multiple dispatch unexpected function call](https://discourse.julialang.org/t/multiple-dispatch-unexpected-function-call/78736)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 21\
**Last updated:** [April 4, 2022, 9:21pm UTC](https://discourse.julialang.org/t/multiple-dispatch-unexpected-function-call/78736 "2022-04-04T21:21:42Z")

</div>

I just encountered weird behavior with multiple dispatch which I didn’t expect. julia\> abstract type AbstractType end julia\> struct ExampleType\<:AbstractType end julia\> struct Concrete{AT\<:AbstractType} end julia\> is…

---

## [Shared environments?](https://discourse.julialang.org/t/shared-environments/79002)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 35\
**Last updated:** [April 4, 2022, 7:25pm UTC](https://discourse.julialang.org/t/shared-environments/79002 "2022-04-04T19:25:39Z")

</div>

I just happen to find out about the existence of the shared environments. However, I could not find what are they useful for, and the doc string does not tell me much. What are they useful for? In what they differ from o…

---

## [How to generate two sets from distinct points on a sphere, and plot them?](https://discourse.julialang.org/t/how-to-generate-two-sets-from-distinct-points-on-a-sphere-and-plot-them/79010)

<div class="topic-metadata">

**Author:** [@OliveiraIgor](https://discourse.julialang.org/u/OliveiraIgor)\
**Replies:** 0\
**Last updated:** [April 4, 2022, 3:36pm UTC](https://discourse.julialang.org/t/how-to-generate-two-sets-from-distinct-points-on-a-sphere-and-plot-them/79010 "2022-04-04T15:36:21Z")

</div>

I need to apply the PCA at different points of a spherical cap, but I don’t know how to build these sets of different points, I need at least 2 sets. Here is a picture with the idea of what I need.

---

## [How to use labels instead of numbers in xtick and ytick](https://discourse.julialang.org/t/how-to-use-labels-instead-of-numbers-in-xtick-and-ytick/79006)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [April 4, 2022, 1:57pm UTC](https://discourse.julialang.org/t/how-to-use-labels-instead-of-numbers-in-xtick-and-ytick/79006 "2022-04-04T13:57:51Z")

</div>

Hi all, I would like to use labels “low” and “high” on the x and y axis rather than numbers. For example, on the y-axis, “low” would be on the bottom and “high” would be on the top. I could potentially use annotate for…

---

## [What are the limitations of completion in the REPL?](https://discourse.julialang.org/t/what-are-the-limitations-of-completion-in-the-repl/78944)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 11\
**Last updated:** [April 4, 2022, 1:31pm UTC](https://discourse.julialang.org/t/what-are-the-limitations-of-completion-in-the-repl/78944 "2022-04-04T13:31:31Z")

</div>

The manual states “Tab completion can also help completing fields:”, using the example of UUIDs. However, I recently found that some symbols are not completed (Where is sparse ldlt? - #2 by skleinbo). So, does anyone k…

---

## [Pre-filled input for readline()](https://discourse.julialang.org/t/pre-filled-input-for-readline/78969)

<div class="topic-metadata">

**Author:** [@jarbus](https://discourse.julialang.org/u/jarbus)\
**Replies:** 1\
**Last updated:** [April 4, 2022, 12:59pm UTC](https://discourse.julialang.org/t/pre-filled-input-for-readline/78969 "2022-04-04T12:59:31Z")

</div>

Is there a way to pre-fill the buffer for readline()? Say for instance I want to have the following Enter a name for this run: 20XX-MM-DD | where the date is already filled in and a user’s cursor is at the |, that way …

---

## [How to pass args to FFMPEG.jl](https://discourse.julialang.org/t/how-to-pass-args-to-ffmpeg-jl/78998)

<div class="topic-metadata">

**Author:** [@quietlight](https://discourse.julialang.org/u/quietlight)\
**Replies:** 0\
**Last updated:** [April 4, 2022, 10:04am UTC](https://discourse.julialang.org/t/how-to-pass-args-to-ffmpeg-jl/78998 "2022-04-04T10:04:26Z")

</div>

I am unable to pass this argument to ffmpeg.jl, ignorance yes, but we all start somewhere. ffmpeg -ss 20 -to 30 -i C05\_20211201\_040000.wav output.wav Tried lots of options but it’s not happening. Read the docs but ther…

---

## [Square plots in GR](https://discourse.julialang.org/t/square-plots-in-gr/78988)

<div class="topic-metadata">

**Author:** [@jackwoodside](https://discourse.julialang.org/u/jackwoodside)\
**Replies:** 3\
**Last updated:** [April 4, 2022, 8:14am UTC](https://discourse.julialang.org/t/square-plots-in-gr/78988 "2022-04-04T08:14:07Z")

</div>

I am currently trying to make a contour plot of a a 100x100 matrix using Plots with the GR backend. Since it is a square matrix I would like the contour plot to be square also. Someone suggested to me using aspect\_ratio=…

---

## [@spawnat with SlurmClusterManager](https://discourse.julialang.org/t/spawnat-with-slurmclustermanager/78930)

<div class="topic-metadata">

**Author:** [@andrew-saydjari](https://discourse.julialang.org/u/andrew-saydjari)\
**Replies:** 3\
**Last updated:** [April 4, 2022, 6:10am UTC](https://discourse.julialang.org/t/spawnat-with-slurmclustermanager/78930 "2022-04-04T06:10:00Z")

</div>

My basic problem is that I have a large matrix I would like all of my workers to read from (no need for write), and I want all of those workers to be across many nodes (a multinode SLURM allocation). If there is a better…

---

## [Outer constructor method is failing](https://discourse.julialang.org/t/outer-constructor-method-is-failing/78979)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 3\
**Last updated:** [April 4, 2022, 4:51am UTC](https://discourse.julialang.org/t/outer-constructor-method-is-failing/78979 "2022-04-04T04:51:19Z")

</div>

I don’t really understand why in the following code Payload(;a, b) = Payload(a=a, b=b, c=Float64\[\]) fails. It looks a legitimate expression to me. module Test Base.@kwdef mutable struct Payload a::Int b::String…

---

## [Confused about package loading](https://discourse.julialang.org/t/confused-about-package-loading/78860)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 6\
**Last updated:** [April 4, 2022, 3:36am UTC](https://discourse.julialang.org/t/confused-about-package-loading/78860 "2022-04-04T03:36:26Z")

</div>

My understanding is that Julia visits each of the locations defined in LOAD\_PATH to load package X until it finds one by the name. So if the default LOAD\_PATH is julia\> LOAD\_PATH 3-element Vector{String}: "@" "@v#.#" …

---

## [How does \`kwargs...\` pass into another function?](https://discourse.julialang.org/t/how-does-kwargs-pass-into-another-function/78976)

<div class="topic-metadata">

**Author:** [@zengfung](https://discourse.julialang.org/u/zengfung)\
**Replies:** 1\
**Last updated:** [April 4, 2022, 3:30am UTC](https://discourse.julialang.org/t/how-does-kwargs-pass-into-another-function/78976 "2022-04-04T03:30:08Z")

</div>

Hi all, I’m trying to understand the parsing of keyword arguments in Julia functions. In the following code snippet, I created foo1() which takes in 2 keyword arguments, and bar1() which takes in keyword arguments to pa…

---

## [Extrapolation of a NeuralODE using \`DiffEqFlux\`](https://discourse.julialang.org/t/extrapolation-of-a-neuralode-using-diffeqflux/78964)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 2\
**Last updated:** [April 4, 2022, 1:33am UTC](https://discourse.julialang.org/t/extrapolation-of-a-neuralode-using-diffeqflux/78964 "2022-04-04T01:33:45Z")

</div>

Hey folks. So I have trained a NeuralODE using DiffEqFlux, meaning that I have optimized the parameters of a neural network to solve this ODE. I have a dataset that spans 31 years with yearly measurements, and I trained …

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

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