# General Usage

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

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

**Page:** 418

---

## [Constructing a list of options for a cmd](https://discourse.julialang.org/t/constructing-a-list-of-options-for-a-cmd/84910)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [July 28, 2022, 10:08am UTC](https://discourse.julialang.org/t/constructing-a-list-of-options-for-a-cmd/84910 "2022-07-28T10:08:25Z")

</div>

I have a list of options to pass to an executable. For the purposes of the MWE, a call could look like \`c\` \`c a=1\` \`c a=1 b=2\` Whether I need to append a and b are known at runtime, and are taken from a NamedTuple. N…

---

## [Improve this function for merging tuples so that the return type could be accurately inferred](https://discourse.julialang.org/t/improve-this-function-for-merging-tuples-so-that-the-return-type-could-be-accurately-inferred/84893)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [July 28, 2022, 6:57am UTC](https://discourse.julialang.org/t/improve-this-function-for-merging-tuples-so-that-the-return-type-could-be-accurately-inferred/84893 "2022-07-28T06:57:35Z")

</div>

I implemented the function merged\_tuples for merging tuples in given order while preserving intra-tuple order. It seems that Julia isn’t able to infer the return types accurately, however (using Test.@inferred): julia\> …

---

## [Better error messages: Invalid Comprehension syntax](https://discourse.julialang.org/t/better-error-messages-invalid-comprehension-syntax/84892)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 3\
**Last updated:** [July 27, 2022, 10:14pm UTC](https://discourse.julialang.org/t/better-error-messages-invalid-comprehension-syntax/84892 "2022-07-27T22:14:13Z")

</div>

Consider this syntax error: julia\> S1 = \[(.01 : .1 : 1.0);\]; julia\> S2 = \[(.01 : .1 : 1.0);\]; julia\> \[s1 +s2 for s1 in S1, s2 in S2\] ERROR: syntax: invalid comprehension syntax Stacktrace: \[1\] top-level scope @ no…

---

## [How to undef a vector element](https://discourse.julialang.org/t/how-to-undef-a-vector-element/83427)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 30\
**Last updated:** [July 27, 2022, 9:15pm UTC](https://discourse.julialang.org/t/how-to-undef-a-vector-element/83427 "2022-07-27T21:15:13Z")

</div>

Suppose that I create an uninitialized vector of objects of type Stuff and then assign some content to it. At some point in the future, I no longer need a particular element and want the garbage collector to free up the…

---

## [How to define Parameters locally in Sub julia files?](https://discourse.julialang.org/t/how-to-define-parameters-locally-in-sub-julia-files/84886)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 5\
**Last updated:** [July 27, 2022, 8:06pm UTC](https://discourse.julialang.org/t/how-to-define-parameters-locally-in-sub-julia-files/84886 "2022-07-27T20:06:30Z")

</div>

Below is just an MWE for the concept (I am using dummy equations). I have main code in mani.jl which includes another file subi.jl. The main code calls function ini(args) to calculate mat which is useful only in functio…

---

## [Symbolic function differentiation](https://discourse.julialang.org/t/symbolic-function-differentiation/84813)

<div class="topic-metadata">

**Author:** [@Starpower\_Power](https://discourse.julialang.org/u/Starpower_Power)\
**Replies:** 2\
**Last updated:** [July 27, 2022, 7:46pm UTC](https://discourse.julialang.org/t/symbolic-function-differentiation/84813 "2022-07-27T19:46:51Z")

</div>

in python sympy we define that x is function of t: x(t) and diff(x,t) is xdot x=sym.Function(‘x’)(t) how to do this thing in julia bcz i have to write Lagrangian equation

---

## [Concrete typeof](https://discourse.julialang.org/t/concrete-typeof/84881)

<div class="topic-metadata">

**Author:** [@nicolas](https://discourse.julialang.org/u/nicolas)\
**Replies:** 5\
**Last updated:** [July 27, 2022, 5:34pm UTC](https://discourse.julialang.org/t/concrete-typeof/84881 "2022-07-27T17:34:39Z")

</div>

Is there a function to get the concrete (numeric) type of some object of abstract type without much information about it? Consider these two bad methods: using LinearAlgebra x = \[\[1,2\],\[3,4\]\] typeof(dot(x,x)) eltype(elt…

---

## [In VSCode, "terminated with exit code: 139"](https://discourse.julialang.org/t/in-vscode-terminated-with-exit-code-139/84765)

<div class="topic-metadata">

**Author:** [@fsmith001](https://discourse.julialang.org/u/fsmith001)\
**Replies:** 17\
**Last updated:** [July 27, 2022, 5:33pm UTC](https://discourse.julialang.org/t/in-vscode-terminated-with-exit-code-139/84765 "2022-07-27T17:33:56Z")

</div>

Hello! I am trying out a function I have written to implement the power method. I am filling a CSRMatrix (a type created in the project I am working on) and then running my function with that matrix. I have no problems w…

---

## [How to update scalar and Boolean in-place?](https://discourse.julialang.org/t/how-to-update-scalar-and-boolean-in-place/84843)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 3\
**Last updated:** [July 27, 2022, 1:41pm UTC](https://discourse.julialang.org/t/how-to-update-scalar-and-boolean-in-place/84843 "2022-07-27T13:41:46Z")

</div>

I have function update2 which returns the values of status, nChange. However, I need to build function update1 which update status, nChange without returning their values (in-place mutation) but it seems not correct proc…

---

## [What does a ReadOnlyMemoryError mean?](https://discourse.julialang.org/t/what-does-a-readonlymemoryerror-mean/84809)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 1\
**Last updated:** [July 26, 2022, 11:36am UTC](https://discourse.julialang.org/t/what-does-a-readonlymemoryerror-mean/84809 "2022-07-26T11:36:57Z")

</div>

Hi all :slight\_smile: I use pycall to get data from Snowflake. But sometimes I get a ReadOnlyMemoryError error. What does that mean and how to prevent it? ReadOnlyMemoryError() Stacktrace: \[1\] macro expansion @ C…

---

## [Is it possible for "ccall" to call the shared library created by PackageCompiler.jl?](https://discourse.julialang.org/t/is-it-possible-for-ccall-to-call-the-shared-library-created-by-packagecompiler-jl/84298)

<div class="topic-metadata">

**Author:** [@lionisxn](https://discourse.julialang.org/u/lionisxn)\
**Replies:** 53\
**Last updated:** [July 27, 2022, 6:26am UTC](https://discourse.julialang.org/t/is-it-possible-for-ccall-to-call-the-shared-library-created-by-packagecompiler-jl/84298 "2022-07-27T06:26:03Z")

</div>

I am trying to create a .dll that can be called by other languages, e.g. MATLAB or C. I just test the example given in “PackageCompiler.jl”, and generate the following file bundles where “fist\_lib\_wy.dll” is the created …

---

## [Losing type stability after passing function output from Symbolics.jl build\_function() as parameter elsewhere](https://discourse.julialang.org/t/losing-type-stability-after-passing-function-output-from-symbolics-jl-build-function-as-parameter-elsewhere/84844)

<div class="topic-metadata">

**Author:** [@allicient](https://discourse.julialang.org/u/allicient)\
**Replies:** 3\
**Last updated:** [July 27, 2022, 2:49am UTC](https://discourse.julialang.org/t/losing-type-stability-after-passing-function-output-from-symbolics-jl-build-function-as-parameter-elsewhere/84844 "2022-07-27T02:49:55Z")

</div>

This is probably expected behaviour but I don’t understand quite why it’s happening, and suspect it’d be useful to know. As part of a small library, I’ve been using Symbolics.jl to take user-supplied expressions, compil…

---

## [How to use \`kwargs\` to avoid passing around keyword arguments?](https://discourse.julialang.org/t/how-to-use-kwargs-to-avoid-passing-around-keyword-arguments/84856)

<div class="topic-metadata">

**Author:** [@Cory\_Simon](https://discourse.julialang.org/u/Cory_Simon)\
**Replies:** 2\
**Last updated:** [July 27, 2022, 2:13am UTC](https://discourse.julialang.org/t/how-to-use-kwargs-to-avoid-passing-around-keyword-arguments/84856 "2022-07-27T02:13:32Z")

</div>

I found the documentation on kwargs to be a little terse… how can I exploit keyword arguments to avoid copying tons of different keyword arguments when passing them function to function? my example below. seems unnatura…

---

## [Type stability when having function as struct field](https://discourse.julialang.org/t/type-stability-when-having-function-as-struct-field/84838)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 6\
**Last updated:** [July 26, 2022, 10:18pm UTC](https://discourse.julialang.org/t/type-stability-when-having-function-as-struct-field/84838 "2022-07-26T22:18:45Z")

</div>

I have defined a struct called ParDemo1 to store some parameters (and do some basic calculations for default values not shown here). It is passed to the function dhdt\_demo!, which is the RHS of a system of ODE to be pass…

---

## [Can someone post a high level summary of the differences between versions 1.6, 1.7 and 1.8?](https://discourse.julialang.org/t/can-someone-post-a-high-level-summary-of-the-differences-between-versions-1-6-1-7-and-1-8/84828)

<div class="topic-metadata">

**Author:** [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Replies:** 2\
**Last updated:** [July 26, 2022, 8:50pm UTC](https://discourse.julialang.org/t/can-someone-post-a-high-level-summary-of-the-differences-between-versions-1-6-1-7-and-1-8/84828 "2022-07-26T20:50:52Z")

</div>

Or direct me to same? I understand the meaning and associated risk levels of LTS, current stable, and upcoming releases. But adoption should be driven by a consideration of risk vs. reward, and the reward part is assoc…

---

## ['MultiVector' not updating in a loop](https://discourse.julialang.org/t/multivector-not-updating-in-a-loop/84410)

<div class="topic-metadata">

**Author:** [@fsmith001](https://discourse.julialang.org/u/fsmith001)\
**Replies:** 14\
**Last updated:** [July 26, 2022, 8:19pm UTC](https://discourse.julialang.org/t/multivector-not-updating-in-a-loop/84410 "2022-07-26T20:19:39Z")

</div>

Hello, I am using a for loop to insert values into a DenseMultiVector, a type that was created in the project I am continuing work on. I start by initializing an undef DenseMultiVector of the correct size, and then loop …

---

## [ArgumentError: invalid BigInt: "0E-24" in LibPQ / Decimals](https://discourse.julialang.org/t/argumenterror-invalid-bigint-0e-24-in-libpq-decimals/84790)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 2\
**Last updated:** [July 26, 2022, 5:19pm UTC](https://discourse.julialang.org/t/argumenterror-invalid-bigint-0e-24-in-libpq-decimals/84790 "2022-07-26T17:19:39Z")

</div>

I’m running a simple SQL select from a table and getting the stacktrace below. I have been using this code for months and today is the first time I’ve seen it so it could be related to me running Pkg.update() recently. F…

---

## [Pluto package not included in Pluto Package Manager manifest](https://discourse.julialang.org/t/pluto-package-not-included-in-pluto-package-manager-manifest/84832)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 0\
**Last updated:** [July 26, 2022, 4:21pm UTC](https://discourse.julialang.org/t/pluto-package-not-included-in-pluto-package-manager-manifest/84832 "2022-07-26T16:21:27Z")

</div>

This README page has a link to Binder to view my Pluto notebook. That notebook uses some unregistered packages, so I used Pluto.activate\_notebook\_environment from a Julia REPL to set up its Pluto Package Manager Proje…

---

## [How do I do real-time rendering with CUDA.jl?](https://discourse.julialang.org/t/how-do-i-do-real-time-rendering-with-cuda-jl/84820)

<div class="topic-metadata">

**Author:** [@AeroSoap](https://discourse.julialang.org/u/AeroSoap)\
**Replies:** 5\
**Last updated:** [July 26, 2022, 4:04pm UTC](https://discourse.julialang.org/t/how-do-i-do-real-time-rendering-with-cuda-jl/84820 "2022-07-26T16:04:16Z")

</div>

I’ve spent a couple of hours looking around online and haven’t found a good solution, so I think I’ve put in the effort necessary to justify asking here. How would one easily go about taking something like a CuArray from…

---

## [How to scroll through a data set](https://discourse.julialang.org/t/how-to-scroll-through-a-data-set/84803)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [July 26, 2022, 3:12pm UTC](https://discourse.julialang.org/t/how-to-scroll-through-a-data-set/84803 "2022-07-26T15:12:13Z")

</div>

How can I view a dataframe in the text mode console and scroll through it? I tried PrettyTables.jl but could not find an option for this.

---

## [How to use ODBC.jl on windows](https://discourse.julialang.org/t/how-to-use-odbc-jl-on-windows/84824)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 0\
**Last updated:** [July 26, 2022, 1:43pm UTC](https://discourse.julialang.org/t/how-to-use-odbc-jl-on-windows/84824 "2022-07-26T13:43:36Z")

</div>

Hi all :slight\_smile: Im trying to connect to an SQLServer. I found the ODBC.jl pkg. Now I’m trying to understand how to use it on windows. Do I need to add drives via ODBC.adddriver? Do I need to add dsn (Data Source…

---

## [Why can't we resize a reinterpreted matrix?](https://discourse.julialang.org/t/why-cant-we-resize-a-reinterpreted-matrix/84780)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 3\
**Last updated:** [July 26, 2022, 10:22am UTC](https://discourse.julialang.org/t/why-cant-we-resize-a-reinterpreted-matrix/84780 "2022-07-26T10:22:06Z")

</div>

We can resize a vector of static arrays: julia\> v = \[ rand(SVector{3,Float64}) for \_ in 1:2 \]; julia\> resize!(v, 3) 3-element Vector{SVector{3, Float64}}: \[0.49021421932808495, 0.04375803657360211, 0.6957281082155673\]…

---

## [How to hcat a vector of vectors to produce a matrix with a specified eltype?](https://discourse.julialang.org/t/how-to-hcat-a-vector-of-vectors-to-produce-a-matrix-with-a-specified-eltype/84738)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 9\
**Last updated:** [July 26, 2022, 8:50am UTC](https://discourse.julialang.org/t/how-to-hcat-a-vector-of-vectors-to-produce-a-matrix-with-a-specified-eltype/84738 "2022-07-26T08:50:55Z")

</div>

What I want is basically an equivalent of julia\> A = \[1:4, 5:8\] 2-element Vector{UnitRange{Int64}}: 1:4 5:8 julia\> Base.typed\_hcat(Float64, A...) 4×2 Matrix{Float64}: 1.0 5.0 2.0 6.0 3.0 7.0 4.0 8.0 except w…

---

## [Julia download on MacBook Pro with M1 Pro](https://discourse.julialang.org/t/julia-download-on-macbook-pro-with-m1-pro/84787)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 8\
**Last updated:** [July 26, 2022, 7:33am UTC](https://discourse.julialang.org/t/julia-download-on-macbook-pro-with-m1-pro/84787 "2022-07-26T07:33:28Z")

</div>

What version of Julia listed here should I download? Are there any issues I should expect with version available for Intel processor? I see the following relevant options: current stable release v1.7.3 for macOS x86 …

---

## [LinearAlgebra Package / stdlib Question on rhs variables](https://discourse.julialang.org/t/linearalgebra-package-stdlib-question-on-rhs-variables/84792)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [July 26, 2022, 6:18am UTC](https://discourse.julialang.org/t/linearalgebra-package-stdlib-question-on-rhs-variables/84792 "2022-07-26T06:18:07Z")

</div>

Hi all, I want to know whether with Julia we can use the right hand side as variables (b1, b2, b3) and it can still be calculated as its variables multiplication after doing the elementary row operations on the matrix? …

---

## [Julia 1.6 other libcurl download issues](https://discourse.julialang.org/t/julia-1-6-other-libcurl-download-issues/59738)

<div class="topic-metadata">

**Author:** [@neophytedave](https://discourse.julialang.org/u/neophytedave)\
**Replies:** 23\
**Last updated:** [July 26, 2022, 2:20am UTC](https://discourse.julialang.org/t/julia-1-6-other-libcurl-download-issues/59738 "2022-07-26T02:20:28Z")

</div>

I long ago abandoned working with Julia (Windows 10). I have not been able to add any packages at all for the last several versions. I get the following messages. (@v1.6) pkg\> add Plots Updating registry at \`C:\\Us…

---

## [Time for JET.jl first run?](https://discourse.julialang.org/t/time-for-jet-jl-first-run/75827)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 3\
**Last updated:** [July 25, 2022, 7:03pm UTC](https://discourse.julialang.org/t/time-for-jet-jl-first-run/75827 "2022-07-25T19:03:12Z")

</div>

I just updated to Julia v1.7.1 and added Jet.jl to my project environment. I put together a file like this # contents of jet\_test.jl using MyPackage const problem\_size = 2^7 function main(problem\_size) tmp = MyFun…

---

## [Understanding Pkg - add a temporary development module](https://discourse.julialang.org/t/understanding-pkg-add-a-temporary-development-module/84762)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 2\
**Last updated:** [July 25, 2022, 6:43pm UTC](https://discourse.julialang.org/t/understanding-pkg-add-a-temporary-development-module/84762 "2022-07-25T18:43:59Z")

</div>

A recent workshop (on MLJ) began with the following instructions for adding a module for the workshop: ENV\["JULIA\_PKG\_PRECOMPILE\_AUTO"\]=0 using Pkg Pkg.activate(temp=true) Pkg.develop(url="https://github.com/ablaom/Hell…

---

## [Strange regex error (bug?)](https://discourse.julialang.org/t/strange-regex-error-bug/84759)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 3\
**Last updated:** [July 25, 2022, 6:00pm UTC](https://discourse.julialang.org/t/strange-regex-error-bug/84759 "2022-07-25T18:00:03Z")

</div>

julia\> r"^\\s\*text" r"^\\s\*text" julia\> Regex("^\\s\*text") ERROR: syntax: invalid escape sequence Julia 1.7.3 on Win10 And BTW what does the following error message mean? julia\> r"^\[:space:\]\*text" ERROR: LoadError: PCRE…

---

## [Convert Array{UInt8, 3} to Matrix{RGB{N0f8}}](https://discourse.julialang.org/t/convert-array-uint8-3-to-matrix-rgb-n0f8/84767)

<div class="topic-metadata">

**Author:** [@Alon\_Ben-Arieh](https://discourse.julialang.org/u/Alon_Ben-Arieh)\
**Replies:** 1\
**Last updated:** [July 25, 2022, 5:26pm UTC](https://discourse.julialang.org/t/convert-array-uint8-3-to-matrix-rgb-n0f8/84767 "2022-07-25T17:26:49Z")

</div>

Hi all I have a NumPy array, representing an image, I send from a python module to a Julia function. The NumPy array is received in the Julia function as Array{UInt8, 3}. I need to convert it to Matrix{RGB{N0f8}}. How…

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

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