# General Usage

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

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

**Page:** 427

---

## [PackageCompiler.jl: packages(s) {MyCustomModules...} not in project](https://discourse.julialang.org/t/packagecompiler-jl-packages-s-mycustommodules-not-in-project/58080)

<div class="topic-metadata">

**Author:** [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 7:48am UTC](https://discourse.julialang.org/t/packagecompiler-jl-packages-s-mycustommodules-not-in-project/58080 "2022-07-07T07:48:55Z")

</div>

I’m trying to use PackageCompiler.jl to reduce the startup time for a server that uses some custom modules (CreditScoreEstimation, WalletOptimization, UserProfiles). approvalPath = joinpath(@\_\_DIR\_\_, "Algorithms-Approva…

---

## [Convert a matrix to a dictionary](https://discourse.julialang.org/t/convert-a-matrix-to-a-dictionary/83872)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 7:11am UTC](https://discourse.julialang.org/t/convert-a-matrix-to-a-dictionary/83872 "2022-07-07T07:11:34Z")

</div>

Suppose I have a 40122 matrix, and a 122-element vector. I want to convert the matrix to a dictionary, in which keys are the elements of the 122-element vector, values are vectors of the 40122 matrix. How can I get that?…

---

## [Subplot function in Julia](https://discourse.julialang.org/t/subplot-function-in-julia/83810)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 14\
**Last updated:** [July 7, 2022, 2:17am UTC](https://discourse.julialang.org/t/subplot-function-in-julia/83810 "2022-07-07T02:17:12Z")

</div>

Hi, I’m trying to get a plot function in Julia. This is my code function split(pt1,pt2::Number) x = \[\] y = \[\] for i in 1:122 if matrix\[1,i\] \> pt1 & matrix\[1,i\] \< pt2 push!(x, matrix\[1,i\])…

---

## [Creating Generators](https://discourse.julialang.org/t/creating-generators/3962)

<div class="topic-metadata">

**Author:** [@rokkuran](https://discourse.julialang.org/u/rokkuran)\
**Replies:** 32\
**Last updated:** [July 6, 2022, 8:34pm UTC](https://discourse.julialang.org/t/creating-generators/3962 "2022-07-06T20:34:58Z")

</div>

I’ve been playing around with Julia lately and have been enjoying it. I have come from python and as a learning exercise was looking at re-writing some code I had written to do least significant bit embedding. I’m wonde…

---

## [Bound checking in eachindex(x,y) in 1.7.3](https://discourse.julialang.org/t/bound-checking-in-eachindex-x-y-in-1-7-3/83847)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [July 6, 2022, 5:50pm UTC](https://discourse.julialang.org/t/bound-checking-in-eachindex-x-y-in-1-7-3/83847 "2022-07-06T17:50:32Z")

</div>

I noticed now that in 1.7.3 a code like this does not skip bounds checking: julia\> function f!(x,y) for i in eachindex(x,y) x\[i\] = x\[i\] + y\[i\] end end f! (generic function wit…

---

## [Exponentiation with literals in both base and exponent not removed by compiler in 1.8](https://discourse.julialang.org/t/exponentiation-with-literals-in-both-base-and-exponent-not-removed-by-compiler-in-1-8/83834)

<div class="topic-metadata">

**Author:** [@albheim](https://discourse.julialang.org/u/albheim)\
**Replies:** 10\
**Last updated:** [July 6, 2022, 3:59pm UTC](https://discourse.julialang.org/t/exponentiation-with-literals-in-both-base-and-exponent-not-removed-by-compiler-in-1-8/83834 "2022-07-06T15:59:31Z")

</div>

Between 1.7.3 and 1.8.0-rc1 it seems like the compiler stopped calculating exponentiation Float64^Int literals (maybe other to, haven’t checked) if the exponent is larger than 3. This resulted in adding an overhead for v…

---

## [Github ci: add custom registry](https://discourse.julialang.org/t/github-ci-add-custom-registry/63590)

<div class="topic-metadata">

**Author:** [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Replies:** 1\
**Last updated:** [July 6, 2022, 2:31pm UTC](https://discourse.julialang.org/t/github-ci-add-custom-registry/63590 "2022-07-06T14:31:12Z")

</div>

Hi, I have a dependency that is not registered on General so I add this line to my ci.yml file (full file at the end) before to run the tests: - run: julia -e 'import Pkg; Pkg.Registry.add(Pkg.RegistrySpec(url = "https:…

---

## [\`cispi\` is not accurate](https://discourse.julialang.org/t/cispi-is-not-accurate/83811)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 6\
**Last updated:** [July 6, 2022, 2:27pm UTC](https://discourse.julialang.org/t/cispi-is-not-accurate/83811 "2022-07-06T14:27:21Z")

</div>

In a package of mine, I replaced every occurrence of exp(1im\*pi\*z) with cispi(z). Then one of my unit tests has failed, and this test is a comparison of the evaluation of a special function to the exact value. There were…

---

## [Best way to vectorize a function](https://discourse.julialang.org/t/best-way-to-vectorize-a-function/83786)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 6\
**Last updated:** [July 6, 2022, 12:39pm UTC](https://discourse.julialang.org/t/best-way-to-vectorize-a-function/83786 "2022-07-06T12:39:04Z")

</div>

Hello, I have a function like this in a package I’m currently developing: function jtheta3(z::Number, tau::Number) if imag(tau) \<= 0 ArgumentError("Invalid \`tau\`.") end return \_jtheta3(z, tau) end Imagine th…

---

## [Move elements between vectors](https://discourse.julialang.org/t/move-elements-between-vectors/83825)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 4\
**Last updated:** [July 6, 2022, 12:37pm UTC](https://discourse.julialang.org/t/move-elements-between-vectors/83825 "2022-07-06T12:37:48Z")

</div>

what is an efficient way to move an element from one position in one vector to another position in another vector? And in particular from the first position of the transferring vector to the last position of the receivi…

---

## [Full cell output in jupyter](https://discourse.julialang.org/t/full-cell-output-in-jupyter/83838)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 0\
**Last updated:** [July 6, 2022, 12:12pm UTC](https://discourse.julialang.org/t/full-cell-output-in-jupyter/83838 "2022-07-06T12:12:23Z")

</div>

How can i get full output for this code. I know about empty!(out) but its don’t help me.

---

## [Updating integrator parameter/initial condition with ForwardDiff.Dual types](https://discourse.julialang.org/t/updating-integrator-parameter-initial-condition-with-forwarddiff-dual-types/82862)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 3\
**Last updated:** [July 6, 2022, 11:17am UTC](https://discourse.julialang.org/t/updating-integrator-parameter-initial-condition-with-forwarddiff-dual-types/82862 "2022-07-06T11:17:18Z")

</div>

Suppose I have the following function which takes the solution to an ODE and returns a sum-of-squared errors, making use of the integrator interface (which I need to use for my actual application, not necessary for this …

---

## [Plotting a raster image](https://discourse.julialang.org/t/plotting-a-raster-image/83796)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 8\
**Last updated:** [July 6, 2022, 10:53am UTC](https://discourse.julialang.org/t/plotting-a-raster-image/83796 "2022-07-06T10:53:19Z")

</div>

Hello, Is there a Julia package to plot a raster image pixel by pixel? I mean I have a complex function f, say on a square, and for each point z of the square I want to plot f(z) as a color (with my own color mapping). …

---

## [Julia uses a lot of memory with package DifferentialEquations.jl; DynamicalSystems.jl](https://discourse.julialang.org/t/julia-uses-a-lot-of-memory-with-package-differentialequations-jl-dynamicalsystems-jl/83771)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 11\
**Last updated:** [July 6, 2022, 9:25am UTC](https://discourse.julialang.org/t/julia-uses-a-lot-of-memory-with-package-differentialequations-jl-dynamicalsystems-jl/83771 "2022-07-06T09:25:18Z")

</div>

I calculate the map of the largest Lyapunov exponent (LE) and extreme events(EV), that is, i change two parameters within some range. Julia uses above 2gb memory when calculating map LE and EV. How can i fix this? I use …

---

## [Designing abstract type and related abstract functions](https://discourse.julialang.org/t/designing-abstract-type-and-related-abstract-functions/45300)

<div class="topic-metadata">

**Author:** [@satyabrata\_pal](https://discourse.julialang.org/u/satyabrata_pal)\
**Replies:** 9\
**Last updated:** [July 6, 2022, 7:20am UTC](https://discourse.julialang.org/t/designing-abstract-type-and-related-abstract-functions/45300 "2022-07-06T07:20:46Z")

</div>

I want to implement a type from where i would like to build other subtypes. The supertype would be something similar to this. Abstract type A end function process end @keywdef mutable struct B\<:A a b…

---

## [VoronoiDelaunay includes domain corners](https://discourse.julialang.org/t/voronoidelaunay-includes-domain-corners/83817)

<div class="topic-metadata">

**Author:** [@SDA](https://discourse.julialang.org/u/SDA)\
**Replies:** 0\
**Last updated:** [July 6, 2022, 5:05am UTC](https://discourse.julialang.org/t/voronoidelaunay-includes-domain-corners/83817 "2022-07-06T05:05:30Z")

</div>

The calculation of the Voronoi tessellation with the VoronoiDelaunay.jl package seems to add the bounding corners as points in the tessellation. Is there a way to turn this off? If the source code needs to be altered doe…

---

## [Question about @rtransform?](https://discourse.julialang.org/t/question-about-rtransform/83815)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 1\
**Last updated:** [July 6, 2022, 2:59am UTC](https://discourse.julialang.org/t/question-about-rtransform/83815 "2022-07-06T02:59:26Z")

</div>

Why doesn’t this code work? julia\> df 4×3 DataFrame Row │ y x1 x2 │ Int64 Int64 Int64 ─────┼───────────────────── 1 │ 2 -97 -999 2 │ 6 2 3 3 │ 3 5 -999 4 │ …

---

## [Question about transpose dataframe?](https://discourse.julialang.org/t/question-about-transpose-dataframe/83807)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 4\
**Last updated:** [July 6, 2022, 12:49am UTC](https://discourse.julialang.org/t/question-about-transpose-dataframe/83807 "2022-07-06T00:49:21Z")

</div>

Dear all, How to transpose the dataframe below, julia\> df 3×7 DataFrame Row │ year 2000 2001 2002 2003 2004 2005 │ String Int64 Int64 Int64 Int64 Int64 Int64 ─────┼─────────────────────────────…

---

## [Avoiding Race Condition using Channels](https://discourse.julialang.org/t/avoiding-race-condition-using-channels/83785)

<div class="topic-metadata">

**Author:** [@algunion](https://discourse.julialang.org/u/algunion)\
**Replies:** 6\
**Last updated:** [July 5, 2022, 11:45pm UTC](https://discourse.julialang.org/t/avoiding-race-condition-using-channels/83785 "2022-07-05T23:45:02Z")

</div>

The multi-threading docs only mention lock and atomic operations (for primitives) as a way to avoid race conditions. How about the Channel approach? Is this solution a safe (and good practice) approach? (it seems to wo…

---

## [Broadcasting Flux.jl model over vectors](https://discourse.julialang.org/t/broadcasting-flux-jl-model-over-vectors/83775)

<div class="topic-metadata">

**Author:** [@RomeoV](https://discourse.julialang.org/u/RomeoV)\
**Replies:** 5\
**Last updated:** [July 5, 2022, 11:01pm UTC](https://discourse.julialang.org/t/broadcasting-flux-jl-model-over-vectors/83775 "2022-07-05T23:01:11Z")

</div>

Hello, Flux.jl based models are usually evaluated in a batch-wise fashion for performance reasons, i.e. xs\_batch = rand(10, 64); # 64 ten-dimensional features ys\_batch = model(xs\_batch) @assert size(ys\_batch) == (1, 6…

---

## [What does this mean in Julia](https://discourse.julialang.org/t/what-does-this-mean-in-julia/83799)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 3\
**Last updated:** [July 5, 2022, 9:32pm UTC](https://discourse.julialang.org/t/what-does-this-mean-in-julia/83799 "2022-07-05T21:32:55Z")

</div>

Hi I’m very new to Julia and I’m given this code in Julia. r\[k\] = length(m) \> 0 ? median(m) : missing What does this mean in Julia? Thanks in advance!

---

## [Is PackageCompiler still the best way to avoid the overhead loading CSV, DataFrames, and such?](https://discourse.julialang.org/t/is-packagecompiler-still-the-best-way-to-avoid-the-overhead-loading-csv-dataframes-and-such/83792)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 1\
**Last updated:** [July 5, 2022, 6:39pm UTC](https://discourse.julialang.org/t/is-packagecompiler-still-the-best-way-to-avoid-the-overhead-loading-csv-dataframes-and-such/83792 "2022-07-05T18:39:50Z")

</div>

Is PackageCompiler still the best way to avoid the overhead loading CSV, DataFrames, and such?

---

## [Mutex in finalizers](https://discourse.julialang.org/t/mutex-in-finalizers/83781)

<div class="topic-metadata">

**Author:** [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)\
**Replies:** 0\
**Last updated:** [July 5, 2022, 3:23pm UTC](https://discourse.julialang.org/t/mutex-in-finalizers/83781 "2022-07-05T15:23:39Z")

</div>

There seem to be a few limitations within the usage of finalizers. In particular, can a finalizer make use of mutexes in multi-threading code?

---

## [Order of operations matrix multiplications](https://discourse.julialang.org/t/order-of-operations-matrix-multiplications/83770)

<div class="topic-metadata">

**Author:** [@Rasmus\_Hoier](https://discourse.julialang.org/u/Rasmus_Hoier)\
**Replies:** 5\
**Last updated:** [July 5, 2022, 2:10pm UTC](https://discourse.julialang.org/t/order-of-operations-matrix-multiplications/83770 "2022-07-05T14:10:31Z")

</div>

I know that in MATLAB the default order of operations is left to right, so it can be very useful to use parenthesis to specify the optimal order of matrix multiplications. I was surprised to see that Julia seems to figur…

---

## [How to replace a value at a specif place in a matrix with another value?](https://discourse.julialang.org/t/how-to-replace-a-value-at-a-specif-place-in-a-matrix-with-another-value/83774)

<div class="topic-metadata">

**Author:** [@Hupdup](https://discourse.julialang.org/u/Hupdup)\
**Replies:** 2\
**Last updated:** [July 5, 2022, 2:07pm UTC](https://discourse.julialang.org/t/how-to-replace-a-value-at-a-specif-place-in-a-matrix-with-another-value/83774 "2022-07-05T14:07:00Z")

</div>

Hi, I want to replace the value of the Matrix “q\_update” (Size: (3, 1)) at position “a”, which can be a number between 1 and 3, with a new value. The new Value at this position should be y, a float32. But unfortunaly i…

---

## [PackageCompiler.jl Portability Issue](https://discourse.julialang.org/t/packagecompiler-jl-portability-issue/64660)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 3\
**Last updated:** [July 5, 2022, 11:19am UTC](https://discourse.julialang.org/t/packagecompiler-jl-portability-issue/64660 "2022-07-05T11:19:41Z")

</div>

I’m having an issue with PackageCompiler.jl, the error I’m getting on the sister PC is: julia -JCrashSimPackages.dll fatal: error thrown and no exception handler available. InitError(mod=:Libiconv\_jll, error=ErrorExcept…

---

## [Equation involving floor function](https://discourse.julialang.org/t/equation-involving-floor-function/83751)

<div class="topic-metadata">

**Author:** [@Smsng2\_Xprss](https://discourse.julialang.org/u/Smsng2_Xprss)\
**Replies:** 2\
**Last updated:** [July 5, 2022, 10:49am UTC](https://discourse.julialang.org/t/equation-involving-floor-function/83751 "2022-07-05T10:49:25Z")

</div>

How can I solve the following in Julia; 6t^2 - 7floor(t) - 3 = 0 I thought when I define t, with Sym(“t”), it would work. Instead it gives me Is there a workaround. By the way I’m interested in exact solutions and …

---

## [Same random seed, but different random numbers?](https://discourse.julialang.org/t/same-random-seed-but-different-random-numbers/83731)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 11\
**Last updated:** [July 5, 2022, 10:11am UTC](https://discourse.julialang.org/t/same-random-seed-but-different-random-numbers/83731 "2022-07-05T10:11:00Z")

</div>

Dear all, I try to generate random number using both randn() and rand(), I set the same random seed, but why they generate different results? julia\> using Distributions, Random julia\> Random.seed!(123) TaskLocalRNG() …

---

## [Unsatisfiable requirement to uninstalled?](https://discourse.julialang.org/t/unsatisfiable-requirement-to-uninstalled/83767)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [July 5, 2022, 9:51am UTC](https://discourse.julialang.org/t/unsatisfiable-requirement-to-uninstalled/83767 "2022-07-05T09:51:06Z")

</div>

Hello, I have this weird error when trying to resolve the manifest of a main package (ReinforcementLearning) that I deved. (ReinforcementLearning) pkg\> resolve ERROR: Unsatisfiable requirements detected for package Lin…

---

## [Why is the kwarg \`dims\` not being constant-propagated?](https://discourse.julialang.org/t/why-is-the-kwarg-dims-not-being-constant-propagated/83610)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 5\
**Last updated:** [July 5, 2022, 3:03am UTC](https://discourse.julialang.org/t/why-is-the-kwarg-dims-not-being-constant-propagated/83610 "2022-07-05T03:03:13Z")

</div>

This doesn’t seem to be inferred julia\> a = rand(1,1); julia\> @code\_warntype (a -\> eachslice(a, dims=1))(a) MethodInstance for (::var"#13#14")(::Matrix{Float64}) from (::var"#13#14")(a) @ Main REPL\[23\]:1 Argume…

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

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