# General Usage

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

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

**Page:** 533

---

## [Luxor linewidth scaling](https://discourse.julialang.org/t/luxor-linewidth-scaling/70022)

<div class="topic-metadata">

**Author:** [@jg-854](https://discourse.julialang.org/u/jg-854)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 10:47am UTC](https://discourse.julialang.org/t/luxor-linewidth-scaling/70022 "2021-10-19T10:47:38Z")

</div>

I am creating an application with a zoom feature. I thought to use Luxor.scale, which correctly scales my primitives (boxes, triangles etc.) but preserves the linewidth’s value. Is there any way to include the scaling of…

---

## [How can you add multiple hosts in JULIA\_NO\_VERIFY\_HOSTS?](https://discourse.julialang.org/t/how-can-you-add-multiple-hosts-in-julia-no-verify-hosts/70013)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 7:05am UTC](https://discourse.julialang.org/t/how-can-you-add-multiple-hosts-in-julia-no-verify-hosts/70013 "2021-10-19T07:05:06Z")

</div>

Apparently semi-colon is not a good separator:

---

## [Unexpected behaviour from Continuous Callback in DifferentialEquations.jl simulating Lotka-Volterra Dynamics](https://discourse.julialang.org/t/unexpected-behaviour-from-continuous-callback-in-differentialequations-jl-simulating-lotka-volterra-dynamics/69404)

<div class="topic-metadata">

**Author:** [@colebrookson](https://discourse.julialang.org/u/colebrookson)\
**Replies:** 6\
**Last updated:** [October 19, 2021, 3:32am UTC](https://discourse.julialang.org/t/unexpected-behaviour-from-continuous-callback-in-differentialequations-jl-simulating-lotka-volterra-dynamics/69404 "2021-10-19T03:32:04Z")

</div>

Hi there, So I’m using a ContinuousCallback method to simulate a simple Lotka-Volterra consumer-resource system of equations: \\frac{dC}{dt} = (\\alpha - \\beta R)C \\frac{dR}{dt} = (-\\gamma + \\delta C)R My goal is to …

---

## [Using recently updated packages with earlier versions of julia](https://discourse.julialang.org/t/using-recently-updated-packages-with-earlier-versions-of-julia/70009)

<div class="topic-metadata">

**Author:** [@Shane\_Kelly](https://discourse.julialang.org/u/Shane_Kelly)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 1:00am UTC](https://discourse.julialang.org/t/using-recently-updated-packages-with-earlier-versions-of-julia/70009 "2021-10-19T01:00:01Z")

</div>

Hello fellow julia users, I’m wondering if someone could help me with the following frustrating problem I have had while installing packages when having slightly outdated versions of Julia. One when trying to install P…

---

## [How to make division for SparceMatrices?](https://discourse.julialang.org/t/how-to-make-division-for-sparcematrices/70006)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 2\
**Last updated:** [October 18, 2021, 9:43pm UTC](https://discourse.julialang.org/t/how-to-make-division-for-sparcematrices/70006 "2021-10-18T21:43:03Z")

</div>

In my below MWE, I am trying to use \\ for two Sparce matrices, but I am having an error. Any way to solve it? using SparseArrays; using LinearAlgebra; using .Threads using BenchmarkTools using StaticArrays A = \[1 3 3; 6…

---

## [Potential solution to the overflow problem; 64-bit considered harmful, 32- or 21-bit better](https://discourse.julialang.org/t/potential-solution-to-the-overflow-problem-64-bit-considered-harmful-32-or-21-bit-better/69918)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 6\
**Last updated:** [October 18, 2021, 8:28pm UTC](https://discourse.julialang.org/t/potential-solution-to-the-overflow-problem-64-bit-considered-harmful-32-or-21-bit-better/69918 "2021-10-18T20:28:05Z")

</div>

We can implement FastIntegers.jl, faster than the current default Int64 and eliminate overflows from the language by leveraging Julia’s type system, and no hardware support is needed. As a package it of course doesn’t ch…

---

## [How to open a dll on multiple workers with Distributed.jl](https://discourse.julialang.org/t/how-to-open-a-dll-on-multiple-workers-with-distributed-jl/69997)

<div class="topic-metadata">

**Author:** [@guilhermebodin](https://discourse.julialang.org/u/guilhermebodin)\
**Replies:** 0\
**Last updated:** [October 18, 2021, 6:36pm UTC](https://discourse.julialang.org/t/how-to-open-a-dll-on-multiple-workers-with-distributed-jl/69997 "2021-10-18T18:36:03Z")

</div>

Hi, I am trying to open a dll on multiple workers with the following code using Distributed addprocs(1) nprocs() # 2 @everywhere using Libdl @everywhere p = Libdl.dlopen("libscsdir") @fetchfrom 1 p # Correct @fetchf…

---

## [R equivalent Turing model from Statistical Rethkinking (model 8.3)](https://discourse.julialang.org/t/r-equivalent-turing-model-from-statistical-rethkinking-model-8-3/69988)

<div class="topic-metadata">

**Author:** [@amit1](https://discourse.julialang.org/u/amit1)\
**Replies:** 3\
**Last updated:** [October 18, 2021, 6:23pm UTC](https://discourse.julialang.org/t/r-equivalent-turing-model-from-statistical-rethkinking-model-8-3/69988 "2021-10-18T18:23:22Z")

</div>

I am trying to convert the following example from the book Statistical Rethinking book to a Turing model: m8.3 \<- quap( alist( log\_gdp\_std ~ dnorm( mu , sigma ) , mu \<- a\[cid\] + b\[cid\]\*( rugged\_std -…

---

## [Vigenère cipher](https://discourse.julialang.org/t/vigenere-cipher/69692)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 20\
**Last updated:** [October 18, 2021, 5:39pm UTC](https://discourse.julialang.org/t/vigenere-cipher/69692 "2021-10-18T17:39:01Z")

</div>

My daughter is learning about the Vigenère cipher in school and I was helping out (after reading the wiki). They are doing it by hand in school, but it seemed like it might be a good example to start showing her code, si…

---

## [TypeError: in typeassert in Julia 1.6.3](https://discourse.julialang.org/t/typeerror-in-typeassert-in-julia-1-6-3/69946)

<div class="topic-metadata">

**Author:** [@daneshvar.amrollahi](https://discourse.julialang.org/u/daneshvar.amrollahi)\
**Replies:** 5\
**Last updated:** [October 18, 2021, 2:21pm UTC](https://discourse.julialang.org/t/typeerror-in-typeassert-in-julia-1-6-3/69946 "2021-10-18T14:21:58Z")

</div>

I am new to Julia. I am working on a Julia package which the writer is not available. This is the part of the code where I have a problem with: function find\_partition(model::Model, ms) ps = Dict{Z3Expr,Vector{Int}…

---

## [Restructuring code from modules to package](https://discourse.julialang.org/t/restructuring-code-from-modules-to-package/69819)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 14\
**Last updated:** [October 18, 2021, 1:17pm UTC](https://discourse.julialang.org/t/restructuring-code-from-modules-to-package/69819 "2021-10-18T13:17:51Z")

</div>

I have developed an application that makes use of 20-odd modules. Coming from Matlab, I have ensured that Julia finds my code by adding relevant folders to the LOAD\_PATH. The user uses my application by using relevant …

---

## [How to call a Julia variable in memory from the shell?](https://discourse.julialang.org/t/how-to-call-a-julia-variable-in-memory-from-the-shell/69969)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 5\
**Last updated:** [October 18, 2021, 1:00pm UTC](https://discourse.julialang.org/t/how-to-call-a-julia-variable-in-memory-from-the-shell/69969 "2021-10-18T13:00:56Z")

</div>

For example, if I have a Julia program test.jl, and I run it in a shell as below: julia test.jl When done, I did not save the variables in the hard disk, but all the variables should be in the memory, am I right? How d…

---

## [DiscreteCallbacks for ODEs generated from function closures behaving in a way I can't understand](https://discourse.julialang.org/t/discretecallbacks-for-odes-generated-from-function-closures-behaving-in-a-way-i-cant-understand/69962)

<div class="topic-metadata">

**Author:** [@Dhruva2](https://discourse.julialang.org/u/Dhruva2)\
**Replies:** 4\
**Last updated:** [October 18, 2021, 12:58pm UTC](https://discourse.julialang.org/t/discretecallbacks-for-odes-generated-from-function-closures-behaving-in-a-way-i-cant-understand/69962 "2021-10-18T12:58:15Z")

</div>

Either I’m fundamentally misunderstanding function closures, or DiscreteCallbacks is doing something strange. Either way, input appreciated! I’m using OrdinaryDiffEq and DiffEqCallbacks to simulate an ODE with (multiple…

---

## [Plots.jl: labels overlap if using LaTeXStrings](https://discourse.julialang.org/t/plots-jl-labels-overlap-if-using-latexstrings/69936)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 9\
**Last updated:** [October 18, 2021, 11:52am UTC](https://discourse.julialang.org/t/plots-jl-labels-overlap-if-using-latexstrings/69936 "2021-10-18T11:52:02Z")

</div>

Hi, There seems to exist an od behavior of Plots when we use LaTeXStrings to format labels: they overlap. This problem is new because I am revisiting some teaching material, and it did not happen before. I am on a Wind…

---

## [Recursion to iteration](https://discourse.julialang.org/t/recursion-to-iteration/69891)

<div class="topic-metadata">

**Author:** [@goerch](https://discourse.julialang.org/u/goerch)\
**Replies:** 12\
**Last updated:** [October 18, 2021, 10:36am UTC](https://discourse.julialang.org/t/recursion-to-iteration/69891 "2021-10-18T10:36:15Z")

</div>

Hi all, I’m trying to convert some code from recursion to iteration keeping an internal stack. My benchmark is showing no improvement. MWE using BenchmarkTools mutable struct Node{T} value::T left::Union{Nothi…

---

## [An error from stacking a new array with an initialization array (empty)](https://discourse.julialang.org/t/an-error-from-stacking-a-new-array-with-an-initialization-array-empty/69955)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 6\
**Last updated:** [October 18, 2021, 10:20am UTC](https://discourse.julialang.org/t/an-error-from-stacking-a-new-array-with-an-initialization-array-empty/69955 "2021-10-18T10:20:17Z")

</div>

Here is my code: A = \[\]; for ... A = vcat(A, b); end I’m getting the below error. Before A is assigned any values, it is an empty array, and the program is complaining that: number of columns of each array must match …

---

## [From VSCode: Error while parsing your current enviroment.jpg](https://discourse.julialang.org/t/from-vscode-error-while-parsing-your-current-enviroment-jpg/69958)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 3\
**Last updated:** [October 18, 2021, 9:27am UTC](https://discourse.julialang.org/t/from-vscode-error-while-parsing-your-current-enviroment-jpg/69958 "2021-10-18T09:27:47Z")

</div>

I am presenting the following problem; shown in the figure. How to solve it? It will be related to:Warning: could not download…?

---

## [How to remove specific rows of an array?](https://discourse.julialang.org/t/how-to-remove-specific-rows-of-an-array/69948)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 4\
**Last updated:** [October 18, 2021, 7:47am UTC](https://discourse.julialang.org/t/how-to-remove-specific-rows-of-an-array/69948 "2021-10-18T07:47:53Z")

</div>

As Matlab person, I thought the below would work, but it doesn’t. So what is the Julia way of doing this simple task? A = rand(1:10, 12,3); Ind = A\[:,1\].\<5; A\[Ind, :\] = \[\];

---

## [ThreadsX mapreduce performance](https://discourse.julialang.org/t/threadsx-mapreduce-performance/69879)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 12\
**Last updated:** [October 18, 2021, 4:58am UTC](https://discourse.julialang.org/t/threadsx-mapreduce-performance/69879 "2021-10-18T04:58:20Z")

</div>

Hi, I wonder why ThreadsX.mapreduce is slower than a straightforward @threads loop for a simple function like ThreadsX.mapreduce(abs,max,x) computing the maximal absolute value of an array x. julia\> main() Threads.nth…

---

## [DBInterface specify types?](https://discourse.julialang.org/t/dbinterface-specify-types/69956)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 0\
**Last updated:** [October 18, 2021, 2:21am UTC](https://discourse.julialang.org/t/dbinterface-specify-types/69956 "2021-10-18T02:21:36Z")

</div>

Is there an equivalent of CSV.read types= e.g. DBInterface.execute( "select statement", types = Dict( Col1 =\> Date, ... ) ) Querying SQL server, DateTime comes through ok, but Date becames a string

---

## [How to initialize an empty StaticArray?](https://discourse.julialang.org/t/how-to-initialize-an-empty-staticarray/69942)

<div class="topic-metadata">

**Author:** [@curious](https://discourse.julialang.org/u/curious)\
**Replies:** 15\
**Last updated:** [October 18, 2021, 1:09am UTC](https://discourse.julialang.org/t/how-to-initialize-an-empty-staticarray/69942 "2021-10-18T01:09:50Z")

</div>

For performance reasons, I want to replace usage of standard arrays with StaticArrays. However, I couldn’t find how to initialize an empty StaticArray of a given size, that I can populate as values become available. I am…

---

## [Can you avoid stating the arguments in an anonymous function?](https://discourse.julialang.org/t/can-you-avoid-stating-the-arguments-in-an-anonymous-function/69795)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 13\
**Last updated:** [October 18, 2021, 12:07am UTC](https://discourse.julialang.org/t/can-you-avoid-stating-the-arguments-in-an-anonymous-function/69795 "2021-10-18T00:07:21Z")

</div>

Is it possible to avoid stating the arguments in an anonymous function? x = (a=1,b=2) ( (a,b) -\> a+b )(x...) works fine, but could you do something like ( (\_...) -\> a+b )(x...) x would have to contain elements a and …

---

## [How to define local or global variables?](https://discourse.julialang.org/t/how-to-define-local-or-global-variables/69949)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 2\
**Last updated:** [October 17, 2021, 10:36pm UTC](https://discourse.julialang.org/t/how-to-define-local-or-global-variables/69949 "2021-10-17T22:36:18Z")

</div>

So far the most frustrating part of using Julia has been the below annoying error message: Assignment to \`IDOutput\` in soft scope is ambiguous because a global variable by the same name exists: \`IDOutput\` will be treate…

---

## [TypeError: in typeassert in Julia 1.6.3](https://discourse.julialang.org/t/typeerror-in-typeassert-in-julia-1-6-3/69945)

<div class="topic-metadata">

**Author:** [@daneshvar.amrollahi](https://discourse.julialang.org/u/daneshvar.amrollahi)\
**Replies:** 0\
**Last updated:** [October 17, 2021, 8:07pm UTC](https://discourse.julialang.org/t/typeerror-in-typeassert-in-julia-1-6-3/69945 "2021-10-17T20:07:58Z")

</div>

I am new to Julia. I am working on a Julia package which the writer is not available. This is the part of the code where I have a problem with: function find\_partition(model::Model, ms) ps = Dict{Z3Expr,Vector{…

---

## [TypeError: in typeassert in hashindex method](https://discourse.julialang.org/t/typeerror-in-typeassert-in-hashindex-method/69941)

<div class="topic-metadata">

**Author:** [@daneshvar.amrollahi](https://discourse.julialang.org/u/daneshvar.amrollahi)\
**Replies:** 0\
**Last updated:** [October 17, 2021, 7:38pm UTC](https://discourse.julialang.org/t/typeerror-in-typeassert-in-hashindex-method/69941 "2021-10-17T19:38:55Z")

</div>

Hi, I am new to Julia. I am working with a Julia package not written by myself which the writer is not available. I am facing this error: ERROR: TypeError: in typeassert, expected UInt64, got a value of type UInt32 Th…

---

## [The difference between PCHIPInterpolation and SimplePCHIP](https://discourse.julialang.org/t/the-difference-between-pchipinterpolation-and-simplepchip/69927)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 4\
**Last updated:** [October 17, 2021, 8:57pm UTC](https://discourse.julialang.org/t/the-difference-between-pchipinterpolation-and-simplepchip/69927 "2021-10-17T20:57:03Z")

</div>

Anyone knows their differences? I wonder which one I should use? Thanks.

---

## [Conditional statistics over 1 dimension of a multidimensional array](https://discourse.julialang.org/t/conditional-statistics-over-1-dimension-of-a-multidimensional-array/69944)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 2\
**Last updated:** [October 17, 2021, 8:39pm UTC](https://discourse.julialang.org/t/conditional-statistics-over-1-dimension-of-a-multidimensional-array/69944 "2021-10-17T20:39:50Z")

</div>

I would like to compute conditional statistics over one dimension of a two-dimensional array. I have an array a and I would like to compute a mean over the first dimension, taking into account only the cells where b \< 0.…

---

## [Specify a prerelease version in Project.toml compat section?](https://discourse.julialang.org/t/specify-a-prerelease-version-in-project-toml-compat-section/69938)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 1\
**Last updated:** [October 17, 2021, 8:00pm UTC](https://discourse.julialang.org/t/specify-a-prerelease-version-in-project-toml-compat-section/69938 "2021-10-17T20:00:48Z")

</div>

I have a clone of NativeSVG.jl at https://github.com/MarkNahabedian/NativeSVG.jl. It’s Project.toml file designates it as version = "0.1.0-naha" which parses successfully as a VersionNumber. VersionNumber("0.1.0-nah…

---

## [Special casing small integers known at compile time](https://discourse.julialang.org/t/special-casing-small-integers-known-at-compile-time/69934)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 4\
**Last updated:** [October 17, 2021, 6:35pm UTC](https://discourse.julialang.org/t/special-casing-small-integers-known-at-compile-time/69934 "2021-10-17T18:35:21Z")

</div>

I see this sort of code sometimes and it makes me cringe similar(a::Array{T,1}) where {T} = Vector{T}(undef, size(a,1)) similar(a::Array{T,2}) where {T} = Matrix{T}(undef, size(a,1)…

---

## [What does jl\_init\_restored\_modules do? Why does loading my package take so long?](https://discourse.julialang.org/t/what-does-jl-init-restored-modules-do-why-does-loading-my-package-take-so-long/69906)

<div class="topic-metadata">

**Author:** [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Replies:** 12\
**Last updated:** [October 17, 2021, 12:58pm UTC](https://discourse.julialang.org/t/what-does-jl-init-restored-modules-do-why-does-loading-my-package-take-so-long/69906 "2021-10-17T12:58:00Z")

</div>

Here is the ProfileView flamegraph of using PythonCall, which takes about 4.5 seconds: As you can see, almost half the time is spent in \_include\_from\_serialized at this line, namely the jl\_init\_restored\_modules C fun…

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

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