# General Usage

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

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

**Page:** 385

---

## [Allocation when sorting a view](https://discourse.julialang.org/t/allocation-when-sorting-a-view/86558)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 16\
**Last updated:** [October 13, 2022, 1:32pm UTC](https://discourse.julialang.org/t/allocation-when-sorting-a-view/86558 "2022-10-13T13:32:17Z")

</div>

Just reading through “In place sorting for views” and cannot wrap my head around the following allocations in my case: x = \[2,1,10,15,20\] @btime sort!(view($x, 2:4)) 53.308 ns (2 allocations: 96 bytes) To check I also…

---

## [Can you do fine adjustment on legend position in Makie?](https://discourse.julialang.org/t/can-you-do-fine-adjustment-on-legend-position-in-makie/88662)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 2\
**Last updated:** [October 13, 2022, 1:25pm UTC](https://discourse.julialang.org/t/can-you-do-fine-adjustment-on-legend-position-in-makie/88662 "2022-10-13T13:25:46Z")

</div>

I would like to do fine adjustment on the position of an axis so that it doesn’t interfere with plotted lines. Is there a way to do this? The documentation only shows the nine positions encoded by symbols like :lc in th…

---

## [Packages all Julians should know about?](https://discourse.julialang.org/t/packages-all-julians-should-know-about/88099)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 18\
**Last updated:** [October 12, 2022, 5:32pm UTC](https://discourse.julialang.org/t/packages-all-julians-should-know-about/88099 "2022-10-12T17:32:20Z")

</div>

What are packages all Julian users should know about regardless of their area of application because they make using Julia easier? Here is a list of a few I know of. Revise (makes your repl immediately aware of edits …

---

## [New versions of MATLAB causing immediate segfaults when calling the engine within Julia (library conflict?)](https://discourse.julialang.org/t/new-versions-of-matlab-causing-immediate-segfaults-when-calling-the-engine-within-julia-library-conflict/88298)

<div class="topic-metadata">

**Author:** [@musm](https://discourse.julialang.org/u/musm)\
**Replies:** 1\
**Last updated:** [October 12, 2022, 3:51pm UTC](https://discourse.julialang.org/t/new-versions-of-matlab-causing-immediate-segfaults-when-calling-the-engine-within-julia-library-conflict/88298 "2022-10-12T15:51:54Z")

</div>

I would appreciate any help trying to resolve the following issue: segfault with Matlab 2022a on Windows · Issue #200 · JuliaInterop/MATLAB.jl (github.com) NOTE: C:\\Program Files\\MATLAB\\R2022b\\bin\\win64 contains a l…

---

## [How get only numbers from a string](https://discourse.julialang.org/t/how-get-only-numbers-from-a-string/61524)

<div class="topic-metadata">

**Author:** [@Rafael\_Brus](https://discourse.julialang.org/u/Rafael_Brus)\
**Replies:** 8\
**Last updated:** [October 12, 2022, 2:44pm UTC](https://discourse.julialang.org/t/how-get-only-numbers-from-a-string/61524 "2022-10-12T14:44:36Z")

</div>

I need get only numbers caracters from string a = \["00023'4", "@00452a", "456ad52"\]

---

## [DNSError not recognized with HTTP Package installed](https://discourse.julialang.org/t/dnserror-not-recognized-with-http-package-installed/88557)

<div class="topic-metadata">

**Author:** [@Name1](https://discourse.julialang.org/u/Name1)\
**Replies:** 2\
**Last updated:** [October 12, 2022, 2:45pm UTC](https://discourse.julialang.org/t/dnserror-not-recognized-with-http-package-installed/88557 "2022-10-12T14:45:08Z")

</div>

Hello, try response = HTTP.request( "GET", "https://invalid-url.com.au", \["Content-Type" =\> "application/json"\]; require\_ssl\_verification=false, …

---

## [Outdated gitlab CI information](https://discourse.julialang.org/t/outdated-gitlab-ci-information/88621)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 0\
**Last updated:** [October 12, 2022, 1:04pm UTC](https://discourse.julialang.org/t/outdated-gitlab-ci-information/88621 "2022-10-12T13:04:19Z")

</div>

The first result I get for “julia gitlab CI” is : Which seems to be outdated (Julia v0.7 & Pkg.clone). If someone has time it would be good to update it. It’s probably best to use PkgTemplates.jl with the GitLabCI pl…

---

## [Using Plots fails (partially solved but mysterious)](https://discourse.julialang.org/t/using-plots-fails-partially-solved-but-mysterious/76120)

<div class="topic-metadata">

**Author:** [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Replies:** 2\
**Last updated:** [October 12, 2022, 1:07pm UTC](https://discourse.julialang.org/t/using-plots-fails-partially-solved-but-mysterious/76120 "2022-10-12T13:07:45Z")

</div>

With Julia 1.7 on ubuntu, and with the latest Plots release, running using Plots yields the error: ERROR: InitError: could not load library "/home/users/tarnon/.julia/artifacts/b069ad81d556658ea64a543367e128e535fab269/…

---

## [How to display UInt in decimal instead of hexadecimal](https://discourse.julialang.org/t/how-to-display-uint-in-decimal-instead-of-hexadecimal/25756)

<div class="topic-metadata">

**Author:** [@Robert\_Honig](https://discourse.julialang.org/u/Robert_Honig)\
**Replies:** 6\
**Last updated:** [October 12, 2022, 12:23pm UTC](https://discourse.julialang.org/t/how-to-display-uint-in-decimal-instead-of-hexadecimal/25756 "2022-10-12T12:23:36Z")

</div>

So far, whenever I had to work with UInt variables, I wanted to see their value in decimal. Unfortunately, the REPL displays UInt values in hexadecimal: julia\> a = rand(UInt16, 5) 5-element Array{UInt16,1}: 0x8128 0x0…

---

## [When converting multiple .csv files to a DataFrame, what is the most effective way to identify the data entries in the DataFrame with the .csv filename?](https://discourse.julialang.org/t/when-converting-multiple-csv-files-to-a-dataframe-what-is-the-most-effective-way-to-identify-the-data-entries-in-the-dataframe-with-the-csv-filename/88606)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 6\
**Last updated:** [October 12, 2022, 9:33am UTC](https://discourse.julialang.org/t/when-converting-multiple-csv-files-to-a-dataframe-what-is-the-most-effective-way-to-identify-the-data-entries-in-the-dataframe-with-the-csv-filename/88606 "2022-10-12T09:33:51Z")

</div>

Suppose there is a Folder with the following files all with a different number of data entries: File1 = Data1.csv File2 = Data2.csv : : Filen = Datan.csv where n \>\> 100. I am converting these files to a single Dat…

---

## [Possible to download 1.7.x official binaries (Linux)](https://discourse.julialang.org/t/possible-to-download-1-7-x-official-binaries-linux/88608)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 3\
**Last updated:** [October 12, 2022, 8:57am UTC](https://discourse.julialang.org/t/possible-to-download-1-7-x-official-binaries-linux/88608 "2022-10-12T08:57:51Z")

</div>

Is there still a way to download 1.7.x official binaries? I need to load and save Flux models using BSON, and there is an issue with 1.8.x. I can compile from source, if needed, but I have gotten used to the convenience…

---

## [Trouble with JSON3 Generated Types](https://discourse.julialang.org/t/trouble-with-json3-generated-types/88575)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 5\
**Last updated:** [October 11, 2022, 7:52pm UTC](https://discourse.julialang.org/t/trouble-with-json3-generated-types/88575 "2022-10-11T19:52:25Z")

</div>

I’m trying to generate types from an input JSON string using JSON3.jl. It generally works very well, but I’m hitting a weird snag that I can’t seem to debug. First, here is a MWE of my code: using JSON3 function parse…

---

## [How do I get lower and upper bounds for a confidence band using LsqFit.jl?](https://discourse.julialang.org/t/how-do-i-get-lower-and-upper-bounds-for-a-confidence-band-using-lsqfit-jl/88519)

<div class="topic-metadata">

**Author:** [@ultrapoci](https://discourse.julialang.org/u/ultrapoci)\
**Replies:** 8\
**Last updated:** [October 11, 2022, 5:00pm UTC](https://discourse.julialang.org/t/how-do-i-get-lower-and-upper-bounds-for-a-confidence-band-using-lsqfit-jl/88519 "2022-10-11T17:00:04Z")

</div>

I’m fitting a three parameters non-linear function using LsqFit.jl. I know I can get confidence intervals using confidence\_interval(fit), but how do I actually get lower and upper bound for the confidence band? I believe…

---

## [Speeding up repetitive calls to ODEProblem](https://discourse.julialang.org/t/speeding-up-repetitive-calls-to-odeproblem/87644)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 11\
**Last updated:** [October 11, 2022, 3:41pm UTC](https://discourse.julialang.org/t/speeding-up-repetitive-calls-to-odeproblem/87644 "2022-10-11T15:41:49Z")

</div>

Hey ODE people. Thanks for all the mind-bending great work on top-of-the-line packages. I have stupid code solving the same ODE with different boundary conditions thousands of times. Unfortunately for this use case, thi…

---

## [What is the fastest way to obtain an infinity of the correct type?](https://discourse.julialang.org/t/what-is-the-fastest-way-to-obtain-an-infinity-of-the-correct-type/88579)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [October 11, 2022, 3:03pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-to-obtain-an-infinity-of-the-correct-type/88579 "2022-10-11T15:03:06Z")

</div>

This is related to Analogue of zero(T) for infinitiy - #5 by rdeits, but the suggestion T(Inf) isn’t as fast as expected. In particular, julia\> @btime convert(Float16, $(Ref(Inf))\[\]); 9.205 ns (0 allocations: 0 byte…

---

## [Findmin/max and generators](https://discourse.julialang.org/t/findmin-max-and-generators/88473)

<div class="topic-metadata">

**Author:** [@goerch](https://discourse.julialang.org/u/goerch)\
**Replies:** 13\
**Last updated:** [October 11, 2022, 11:18am UTC](https://discourse.julialang.org/t/findmin-max-and-generators/88473 "2022-10-11T11:18:52Z")

</div>

I noticed the following oddity println(findmin(identity, x for x in \[3, 2, 1\])) println(findmin(identity, x for x in \[3, 2, 1\] if x != 1)) showing (1, 3) ERROR: MethodError: no method matching keys(::Base.Iterators.Fi…

---

## [Sketching Phase Portrait in Julia](https://discourse.julialang.org/t/sketching-phase-portrait-in-julia/88441)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 6\
**Last updated:** [October 11, 2022, 10:51am UTC](https://discourse.julialang.org/t/sketching-phase-portrait-in-julia/88441 "2022-10-11T10:51:30Z")

</div>

Dear All, I watch this on youtube tutorial and wonder can Julia plot phase portrait from a matrix? I also try the LinearAlgebra and why does the eigenvectors different from the tutorial? this is my cod…

---

## [Regex on an Expr](https://discourse.julialang.org/t/regex-on-an-expr/88560)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 3\
**Last updated:** [October 11, 2022, 10:50am UTC](https://discourse.julialang.org/t/regex-on-an-expr/88560 "2022-10-11T10:50:14Z")

</div>

Hi! Within the program I have coded, I arrived at a place where I have the following Expr: ex = :(Float64\[32\]) Is there any way to extract the number within brackets without doing ex\_str = String(Symbol(ex)) num = ma…

---

## [Large optimal control problems in Julia](https://discourse.julialang.org/t/large-optimal-control-problems-in-julia/88566)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 2\
**Last updated:** [October 11, 2022, 10:05am UTC](https://discourse.julialang.org/t/large-optimal-control-problems-in-julia/88566 "2022-10-11T10:05:34Z")

</div>

I am trying to set up and solve a large (10/20 control variables, and approx 20,000 state variables following ODE constraints) optimal control problem with non-linear constraints in Julia using the IPOPT solver. Is there…

---

## [Roots Package Resulting in Different Roots if adding another zeros to interval](https://discourse.julialang.org/t/roots-package-resulting-in-different-roots-if-adding-another-zeros-to-interval/88551)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [October 11, 2022, 9:43am UTC](https://discourse.julialang.org/t/roots-package-resulting-in-different-roots-if-adding-another-zeros-to-interval/88551 "2022-10-11T09:43:59Z")

</div>

Hi all, I am trying to find roots of this equation: 490x + 2450 e^{-x/50} - 2450 = 0 I use this code: using Roots f(x) = 490x + 2450\*(exp(-x/50)) - 2450 find\_zeros(f, -1000,1000000000) the results are 2-element Ve…

---

## [Help locating CI falure reason](https://discourse.julialang.org/t/help-locating-ci-falure-reason/88565)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 2\
**Last updated:** [October 11, 2022, 9:38am UTC](https://discourse.julialang.org/t/help-locating-ci-falure-reason/88565 "2022-10-11T09:38:35Z")

</div>

I have created a package called EasyFFTs.jl. This workflow shows the following error on line 119: ERROR: LoadError: ArgumentError: Package Base does not have EasyFFTs in its dependencies: - You may have a partially inst…

---

## [Howto resolve a module or a field by its full name](https://discourse.julialang.org/t/howto-resolve-a-module-or-a-field-by-its-full-name/88550)

<div class="topic-metadata">

**Author:** [@o314](https://discourse.julialang.org/u/o314)\
**Replies:** 0\
**Last updated:** [October 11, 2022, 4:24am UTC](https://discourse.julialang.org/t/howto-resolve-a-module-or-a-field-by-its-full-name/88550 "2022-10-11T04:24:24Z")

</div>

Hi, I am looking for a way to resolve a module or a field by its full name I have not found anything in Base (reflection.jl etc.) Is there anything recommended ? more than my own version there : field(qname::Tuple{Sy…

---

## [Expand symbolic expression](https://discourse.julialang.org/t/expand-symbolic-expression/88544)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [October 11, 2022, 3:40am UTC](https://discourse.julialang.org/t/expand-symbolic-expression/88544 "2022-10-11T03:40:52Z")

</div>

x₁\*(2x₁ + 6x₂) + x₂\*(6x₁ + 7x₂) How can I expand this into (2x₁^2 + 12x₁\*x₂ + 7x₂) ?

---

## [Generate line function data with noise](https://discourse.julialang.org/t/generate-line-function-data-with-noise/88548)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 1\
**Last updated:** [October 11, 2022, 3:20am UTC](https://discourse.julialang.org/t/generate-line-function-data-with-noise/88548 "2022-10-11T03:20:17Z")

</div>

I would like to assess one dimension reduction method on simulation data. Besides totally random data, I want to simulate a partial random dataset. Right now I can think of one method to generate such data rand2 = colle…

---

## [Work array for parallel loop](https://discourse.julialang.org/t/work-array-for-parallel-loop/88546)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 3\
**Last updated:** [October 11, 2022, 2:00am UTC](https://discourse.julialang.org/t/work-array-for-parallel-loop/88546 "2022-10-11T02:00:08Z")

</div>

I’m investigating parallelization of some loops in an older code of mine. The structure is like this: work\_vector = zeros(small\_size) for i = 1 : big\_size x = big\_vector1\[i\] # ... # compute y from x using w…

---

## [How to generate nonnegtive integer array with fixed row sums and column sums](https://discourse.julialang.org/t/how-to-generate-nonnegtive-integer-array-with-fixed-row-sums-and-column-sums/88082)

<div class="topic-metadata">

**Author:** [@ChingLinHuang](https://discourse.julialang.org/u/ChingLinHuang)\
**Replies:** 9\
**Last updated:** [October 10, 2022, 11:21pm UTC](https://discourse.julialang.org/t/how-to-generate-nonnegtive-integer-array-with-fixed-row-sums-and-column-sums/88082 "2022-10-10T23:21:37Z")

</div>

I am trying to randomly generate arrays with given row sums and column sums. The elements in the array should be nonnegative integers. Originally, I wanted to enumerate all the combinations and later filter out those tha…

---

## [Destructuring NamedTuples with Regular Expressions](https://discourse.julialang.org/t/destructuring-namedtuples-with-regular-expressions/88509)

<div class="topic-metadata">

**Author:** [@alfaromartino](https://discourse.julialang.org/u/alfaromartino)\
**Replies:** 6\
**Last updated:** [October 10, 2022, 8:41pm UTC](https://discourse.julialang.org/t/destructuring-namedtuples-with-regular-expressions/88509 "2022-10-10T20:41:28Z")

</div>

As of Julia 1.7, one can deconstruct NamedTuples. I wanted to know if it’s possible to use regular expressions to do this, rather than specifying the variables to be deconstructured. MWE: x = (; a11=1, a12=2, b1=3) #t…

---

## [Auto-evaluate function/expression in local scope](https://discourse.julialang.org/t/auto-evaluate-function-expression-in-local-scope/88515)

<div class="topic-metadata">

**Author:** [@capri](https://discourse.julialang.org/u/capri)\
**Replies:** 9\
**Last updated:** [October 10, 2022, 8:07pm UTC](https://discourse.julialang.org/t/auto-evaluate-function-expression-in-local-scope/88515 "2022-10-10T20:07:46Z")

</div>

Hi guys, I have a problem which I think should be fairly easy to solve (I guess) but I don’t know how. I’ll try to describe it as on-point as possible. I want to define an array of “formulas” that I want to evaluate a…

---

## [Moving from \`Float64\` to \`Float32\` not improving performance](https://discourse.julialang.org/t/moving-from-float64-to-float32-not-improving-performance/88516)

<div class="topic-metadata">

**Author:** [@JordiBolibar](https://discourse.julialang.org/u/JordiBolibar)\
**Replies:** 25\
**Last updated:** [October 10, 2022, 5:20pm UTC](https://discourse.julialang.org/t/moving-from-float64-to-float32-not-improving-performance/88516 "2022-10-10T17:20:35Z")

</div>

Hi, I’m trying to optimize a script. I first did the usual stuff to avoid memory allocation, but when moving all data structures from Float64 to Float32, which should result in a reduced memory usage, the code has become…

---

## [Want output of dijikstra\_algorithm like A star Algorithm in edges Field instead of int64... or How we can convert integer into edges between nodes?](https://discourse.julialang.org/t/want-output-of-dijikstra-algorithm-like-a-star-algorithm-in-edges-field-instead-of-int64-or-how-we-can-convert-integer-into-edges-between-nodes/88531)

<div class="topic-metadata">

**Author:** [@Kumail\_Haider](https://discourse.julialang.org/u/Kumail_Haider)\
**Replies:** 0\
**Last updated:** [October 10, 2022, 5:15pm UTC](https://discourse.julialang.org/t/want-output-of-dijikstra-algorithm-like-a-star-algorithm-in-edges-field-instead-of-int64-or-how-we-can-convert-integer-into-edges-between-nodes/88531 "2022-10-10T17:15:17Z")

</div>

julia\> using Graphs, GraphPlot julia\> using Symbolics, Statistics, LinearAlgebra julia\> using Plots, LaTeXStrings julia\> g = wheel\_graph(10) {10, 18} undirected simple Int64 graph julia\> ds = dijkstra\_shortest\_paths…

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

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