# General Usage

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

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

**Page:** 611

---

## [Concatenate Generators](https://discourse.julialang.org/t/concatenate-generators/59653)

<div class="topic-metadata">

**Author:** [@etienne\_dg](https://discourse.julialang.org/u/etienne_dg)\
**Replies:** 18\
**Last updated:** [April 20, 2021, 3:01pm UTC](https://discourse.julialang.org/t/concatenate-generators/59653 "2021-04-20T15:01:00Z")

</div>

Hi, I try to initialize a vector in two parts, for example, a vector with fifty 0’s then fifty 1’s. I can create it in a loop, but it is not very concise: function foo1() a = Array{Int64}(undef, 100) for i in …

---

## [Order matters in the conflicts with imported names](https://discourse.julialang.org/t/order-matters-in-the-conflicts-with-imported-names/59628)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 2\
**Last updated:** [April 20, 2021, 2:37pm UTC](https://discourse.julialang.org/t/order-matters-in-the-conflicts-with-imported-names/59628 "2021-04-20T14:37:43Z")

</div>

I have been struggling to understand the nuances of what happens when there are conflicts with names imported from other modules. I eventually found by myself a consistent explanation for import Foo: bar. If I’m not mis…

---

## [Fail to execute jl. file](https://discourse.julialang.org/t/fail-to-execute-jl-file/59590)

<div class="topic-metadata">

**Author:** [@Rafael\_Brus](https://discourse.julialang.org/u/Rafael_Brus)\
**Replies:** 4\
**Last updated:** [April 20, 2021, 12:11pm UTC](https://discourse.julialang.org/t/fail-to-execute-jl-file/59590 "2021-04-20T12:11:02Z")

</div>

How can I execute this code by clicking on the jl file on windows? using Gtk ls = GtkListStore(String, Int, Bool) push!(ls,("Peter",20,false)) push!(ls,("Paul",30,false)) push!(ls,("Mary",25,true)) insert!(ls, 2, ("Sus…

---

## [How to arrange data for time series forecasting (mini-batching) without violoating the GPU memory for a LSTM?](https://discourse.julialang.org/t/how-to-arrange-data-for-time-series-forecasting-mini-batching-without-violoating-the-gpu-memory-for-a-lstm/54171)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 7\
**Last updated:** [April 20, 2021, 11:10am UTC](https://discourse.julialang.org/t/how-to-arrange-data-for-time-series-forecasting-mini-batching-without-violoating-the-gpu-memory-for-a-lstm/54171 "2021-04-20T11:10:01Z")

</div>

Hi, I would like to know how I have to arrange data for time series forecasting (mini-batching) without violoating the GPU memory for a LSTM. I tried to follow the instructions of @jeremiedb of the following link: http…

---

## [Efficient structure of Unitful arrays](https://discourse.julialang.org/t/efficient-structure-of-unitful-arrays/59612)

<div class="topic-metadata">

**Author:** [@snowgum](https://discourse.julialang.org/u/snowgum)\
**Replies:** 8\
**Last updated:** [April 20, 2021, 10:54am UTC](https://discourse.julialang.org/t/efficient-structure-of-unitful-arrays/59612 "2021-04-20T10:54:40Z")

</div>

I’m experiencing performance issues when using Unitful arrays inside a structure. I don’t know how to specify the type so well, so the problem may be from the type definition. Here is a simple example using a struct and…

---

## [Accessing values in a matrix for a column before the first?](https://discourse.julialang.org/t/accessing-values-in-a-matrix-for-a-column-before-the-first/59634)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 4\
**Last updated:** [April 20, 2021, 10:46am UTC](https://discourse.julialang.org/t/accessing-values-in-a-matrix-for-a-column-before-the-first/59634 "2021-04-20T10:46:10Z")

</div>

I am trying to access elements of the previous columns than first column. For example in python if i try to access elements before the first column 0 it will return an empty array. import numpy as np x = np.matrix(\[\[ 1…

---

## [Simulated annealing Algorithm](https://discourse.julialang.org/t/simulated-annealing-algorithm/41503)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 13\
**Last updated:** [April 20, 2021, 10:01am UTC](https://discourse.julialang.org/t/simulated-annealing-algorithm/41503 "2021-04-20T10:01:28Z")

</div>

Hello, I am trying to implement a basic simulated annealing Algorithm and test it on some benchmarks but when I test it on Rosenbrock Function I got some errors ( MethodError: objects of type Int64 are not callable ) an…

---

## [EXCEPTION\_ACCESS\_VIOLATION with LowRankApprox](https://discourse.julialang.org/t/exception-access-violation-with-lowrankapprox/59599)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 0\
**Last updated:** [April 19, 2021, 4:36pm UTC](https://discourse.julialang.org/t/exception-access-violation-with-lowrankapprox/59599 "2021-04-19T16:36:16Z")

</div>

While working on some functions based on LowRankApprox.jl I got an EXCEPTION\_ACCESS\_VIOLATION error in a MKL dll. Sadly, I was not able to make a MWE from my original code that shows the issue. My script uses a pqr …

---

## [Groupby() on two individual arrays](https://discourse.julialang.org/t/groupby-on-two-individual-arrays/59643)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 1\
**Last updated:** [April 20, 2021, 7:55am UTC](https://discourse.julialang.org/t/groupby-on-two-individual-arrays/59643 "2021-04-20T07:55:18Z")

</div>

I have two arrays with same dimension: a1 = \[1,1,3,4,6,6\] a2 = \[1,2,3,4,5,6\] But I want to group both of them with respect to array a1 and get the mean of the array a2 for each group. My output is coming from array a2,…

---

## [Creating a custom Julia AWS Layer Runtime](https://discourse.julialang.org/t/creating-a-custom-julia-aws-layer-runtime/18166)

<div class="topic-metadata">

**Author:** [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Replies:** 29\
**Last updated:** [April 20, 2021, 7:36am UTC](https://discourse.julialang.org/t/creating-a-custom-julia-aws-layer-runtime/18166 "2021-04-20T07:36:44Z")

</div>

To deploy a Julia program on AWS Lambda currently involves making a custom Docker Image. Recently, Amazon announced the ability to create a Custom Runtime, which lowers the barrier to entry. However, their tutorial is qu…

---

## [Saving output to txt/CSV file?](https://discourse.julialang.org/t/saving-output-to-txt-csv-file/59636)

<div class="topic-metadata">

**Author:** [@Bonjour-Lemonde](https://discourse.julialang.org/u/Bonjour-Lemonde)\
**Replies:** 2\
**Last updated:** [April 20, 2021, 5:47am UTC](https://discourse.julialang.org/t/saving-output-to-txt-csv-file/59636 "2021-04-20T05:47:25Z")

</div>

Hi guys, I am dealing with output saving, I have tried several ways referred to docs. But nothing works for me. The output I want to save look like this julia\> sim\_result GpABC.SimulatedABCRejectionOutput(3, 1465, 2000…

---

## [Intrusive Collections in Julia](https://discourse.julialang.org/t/intrusive-collections-in-julia/59381)

<div class="topic-metadata">

**Author:** [@bjkaria](https://discourse.julialang.org/u/bjkaria)\
**Replies:** 9\
**Last updated:** [April 20, 2021, 3:33am UTC](https://discourse.julialang.org/t/intrusive-collections-in-julia/59381 "2021-04-20T03:33:33Z")

</div>

Would intrusive collections modeled after the boost intrusive boost intrusive 1.75.0 collection be a useful addition for Julia. Does Julia already have mechanisms which make such collections superfluous. Consider the ad…

---

## [What's the best practice in Julia for research (often changed codes)?](https://discourse.julialang.org/t/whats-the-best-practice-in-julia-for-research-often-changed-codes/58892)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 26\
**Last updated:** [April 20, 2021, 1:04am UTC](https://discourse.julialang.org/t/whats-the-best-practice-in-julia-for-research-often-changed-codes/58892 "2021-04-20T01:04:58Z")

</div>

Hi, I’ve used Julia about one year and I still struggle with how to use it. First of all, as a researcher, I often change my code including code structure and Julia types. When redefining types, Julia REPL needs to be …

---

## [Diminishing returns to \`nthreads\`](https://discourse.julialang.org/t/diminishing-returns-to-nthreads/59621)

<div class="topic-metadata">

**Author:** [@kailukowiak](https://discourse.julialang.org/u/kailukowiak)\
**Replies:** 3\
**Last updated:** [April 19, 2021, 10:29pm UTC](https://discourse.julialang.org/t/diminishing-returns-to-nthreads/59621 "2021-04-19T22:29:12Z")

</div>

Performance with n Threads I have a script that parses a 1Gb file and writes out two CSV files. I want to make this faster by parallelizing it on a large cloud instance. I’m currently testing on an AWS machine c5.9xlarge …

---

## [How to handle Array of Arrays?](https://discourse.julialang.org/t/how-to-handle-array-of-arrays/59602)

<div class="topic-metadata">

**Author:** [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Replies:** 4\
**Last updated:** [April 19, 2021, 9:11pm UTC](https://discourse.julialang.org/t/how-to-handle-array-of-arrays/59602 "2021-04-19T21:11:55Z")

</div>

How to construct ff and gg from hh in the code below? Thx! f(x) = \[1;1\] g(x) = x\*\[1;1\] h(x) = \[1;1\], x\*\[1;1\] ff = mapreduce(f,vcat, \[1 2 3\]) gg = mapreduce(g,vcat, \[1 2 3\]) hh = map(h, \[1 2 3\])

---

## [How to catch stdout per module?](https://discourse.julialang.org/t/how-to-catch-stdout-per-module/59611)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 0\
**Last updated:** [April 19, 2021, 7:45pm UTC](https://discourse.julialang.org/t/how-to-catch-stdout-per-module/59611 "2021-04-19T19:45:27Z")

</div>

If I want to run unrelated tasks and output stdout over the network how would I capture stdout in a module without another module stealing it? As I see it there is only one Base.stdout, which is the default for println.…

---

## [Poor performance passing data structures as function argument](https://discourse.julialang.org/t/poor-performance-passing-data-structures-as-function-argument/59601)

<div class="topic-metadata">

**Author:** [@snowgum](https://discourse.julialang.org/u/snowgum)\
**Replies:** 5\
**Last updated:** [April 19, 2021, 7:43pm UTC](https://discourse.julialang.org/t/poor-performance-passing-data-structures-as-function-argument/59601 "2021-04-19T19:43:21Z")

</div>

I have a compute-heavy function kernel that I am trying to use inside another function. This function takes several arrays and other data as arguments, and I was trying to make the code cleaner by passing an object as ar…

---

## [What is the cause of this performance difference between Julia and Cython?](https://discourse.julialang.org/t/what-is-the-cause-of-this-performance-difference-between-julia-and-cython/58886)

<div class="topic-metadata">

**Author:** [@smpurkis](https://discourse.julialang.org/u/smpurkis)\
**Replies:** 9\
**Last updated:** [April 19, 2021, 6:47pm UTC](https://discourse.julialang.org/t/what-is-the-cause-of-this-performance-difference-between-julia-and-cython/58886 "2021-04-19T18:47:36Z")

</div>

Hello all, I’m fairly new to Julia. I have a simple array function I’m using for comparing the speed of different languages. In this case Julia and Cython (subset of Python). The function in Julia is: function comput…

---

## [Maintain min-Heap together with another vector](https://discourse.julialang.org/t/maintain-min-heap-together-with-another-vector/59604)

<div class="topic-metadata">

**Author:** [@Rouzaire](https://discourse.julialang.org/u/Rouzaire)\
**Replies:** 0\
**Last updated:** [April 19, 2021, 6:46pm UTC](https://discourse.julialang.org/t/maintain-min-heap-together-with-another-vector/59604 "2021-04-19T18:46:37Z")

</div>

Hello everyone, I have a 2D matrix of 2 rows and n columns. The first row represents a distance (type : Float \> 0). The second row represents an ID (type : Integer \> 0) corresponding to the distance above. First ques…

---

## [PSA: If your package's version is of the form \`0.y.z\`, please do NOT bump the minor version for new features](https://discourse.julialang.org/t/psa-if-your-packages-version-is-of-the-form-0-y-z-please-do-not-bump-the-minor-version-for-new-features/46570)

<div class="topic-metadata">

**Author:** [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Replies:** 0\
**Last updated:** [September 14, 2020, 3:08am UTC](https://discourse.julialang.org/t/psa-if-your-packages-version-is-of-the-form-0-y-z-please-do-not-bump-the-minor-version-for-new-features/46570 "2020-09-14T03:08:55Z")

</div>

The Julia package manager implements semantic versioning differently for packages that are pre-1.0 versus packages that are post-1.0. For packages that are pre-1.0 (i.e. the package’s version is of the form 0.y.z), we i…

---

## [Different outcomes with the same function](https://discourse.julialang.org/t/different-outcomes-with-the-same-function/59570)

<div class="topic-metadata">

**Author:** [@valperez](https://discourse.julialang.org/u/valperez)\
**Replies:** 1\
**Last updated:** [April 19, 2021, 6:24pm UTC](https://discourse.julialang.org/t/different-outcomes-with-the-same-function/59570 "2021-04-19T18:24:40Z")

</div>

Hi, I’m making a program in Julia that calculates the posteriori distribution of a beta binomial model. My first model was the following: @model betabinomial(n, z, x, y, delta, gamma) = begin alpha\_p ~ truncated(Norma…

---

## [Questions about SymEngine.jl](https://discourse.julialang.org/t/questions-about-symengine-jl/59598)

<div class="topic-metadata">

**Author:** [@cnf](https://discourse.julialang.org/u/cnf)\
**Replies:** 0\
**Last updated:** [April 19, 2021, 3:05pm UTC](https://discourse.julialang.org/t/questions-about-symengine-jl/59598 "2021-04-19T15:05:43Z")

</div>

I have the following questions about the package SymEngine.jl (running with julia 1.5.2 on a linux machine). (1) List of SymEngine.jl functions for linear algebra computations with symbolic matrices. For example, reduc…

---

## [Fast Distance Histograms](https://discourse.julialang.org/t/fast-distance-histograms/59439)

<div class="topic-metadata">

**Author:** [@JAgho](https://discourse.julialang.org/u/JAgho)\
**Replies:** 6\
**Last updated:** [April 19, 2021, 4:08pm UTC](https://discourse.julialang.org/t/fast-distance-histograms/59439 "2021-04-19T16:08:06Z")

</div>

I’m writing distance histograms in Julia, and I think I’ve hit a limit in the performance of my serial code. The problem is pretty simple - given a list of vectors (positions), compute the distance (euclidian) between al…

---

## [Can't install Plots on julia-1.6.0](https://discourse.julialang.org/t/cant-install-plots-on-julia-1-6-0/59360)

<div class="topic-metadata">

**Author:** [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Replies:** 24\
**Last updated:** [April 18, 2021, 9:40pm UTC](https://discourse.julialang.org/t/cant-install-plots-on-julia-1-6-0/59360 "2021-04-18T21:40:35Z")

</div>

I can’t install the Plots package on julia-1.6.0. I’ve moved my ~/.julia directory and re-added the package but it fails the same way, as follows gibson@sophist$ mv ~/.julia ~/.julia-2021-04-15 gibson@sophist$ julia …

---

## [How do I force GLM to pass through a certain y intercept?](https://discourse.julialang.org/t/how-do-i-force-glm-to-pass-through-a-certain-y-intercept/59500)

<div class="topic-metadata">

**Author:** [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)\
**Replies:** 3\
**Last updated:** [April 19, 2021, 3:07pm UTC](https://discourse.julialang.org/t/how-do-i-force-glm-to-pass-through-a-certain-y-intercept/59500 "2021-04-19T15:07:16Z")

</div>

Hello all! So I am using GLM to fit a graph of resistance vs. temperature, and I need the regression line to have an intercept of 100 Ohms at 0 degrees Centigrade. My code is - xdata = temp\_calib\_data\[:Pt100\]\[:, 1\] |\> …

---

## [Pkg: how to setup the "dev" version of a package (i.e. \`\] dev MyPkg\`) from a script?](https://discourse.julialang.org/t/pkg-how-to-setup-the-dev-version-of-a-package-i-e-dev-mypkg-from-a-script/59584)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [April 19, 2021, 8:50am UTC](https://discourse.julialang.org/t/pkg-how-to-setup-the-dev-version-of-a-package-i-e-dev-mypkg-from-a-script/59584 "2021-04-19T08:50:29Z")

</div>

How to setup the “dev” version of a package (i.e. \] dev MyPkg) from a script ? Pkg.dev("MyPkg) doesn’t exists, and pkg"dev MyPkg" returns a warning “use with caution” (!) In general, I would love so much that the two…

---

## [Linking against libjulia.so v1.6.0 does not link additional dependencies](https://discourse.julialang.org/t/linking-against-libjulia-so-v1-6-0-does-not-link-additional-dependencies/59409)

<div class="topic-metadata">

**Author:** [@Clonkk](https://discourse.julialang.org/u/Clonkk)\
**Replies:** 6\
**Last updated:** [April 19, 2021, 8:10am UTC](https://discourse.julialang.org/t/linking-against-libjulia-so-v1-6-0-does-not-link-additional-dependencies/59409 "2021-04-19T08:10:10Z")

</div>

Hello, I have code which uses the C-API of Julia. It used to be that linking with libjulia.so in v1.5.3 (my previous installed version) linked against Julia dependencies. The output of ldd command on the binaries was …

---

## [LinearAlgebra.SingularException Error while executing radial basis interpolation using Surrogates in julia?](https://discourse.julialang.org/t/linearalgebra-singularexception-error-while-executing-radial-basis-interpolation-using-surrogates-in-julia/59573)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 3\
**Last updated:** [April 19, 2021, 3:01am UTC](https://discourse.julialang.org/t/linearalgebra-singularexception-error-while-executing-radial-basis-interpolation-using-surrogates-in-julia/59573 "2021-04-19T03:01:40Z")

</div>

I am trying to execute radial basis interpolation in Julia using Surrogates package. I have developed the following code: using Surrogates function t(train, test) xy = zip(train\[:,1\],train\[:,2\]) |\> collect …

---

## [Question about setting up new package environment](https://discourse.julialang.org/t/question-about-setting-up-new-package-environment/59571)

<div class="topic-metadata">

**Author:** [@quazirfan](https://discourse.julialang.org/u/quazirfan)\
**Replies:** 1\
**Last updated:** [April 19, 2021, 12:44am UTC](https://discourse.julialang.org/t/question-about-setting-up-new-package-environment/59571 "2021-04-19T00:44:42Z")

</div>

I am trying to understand how I can efficiently setup a new package environment. I have the following questions, When I create a new environment using pkg\> activate EnvName - why the folder named EnvName with associat…

---

## [How to find source code of a function in DifferentialEquations.jl?](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402)

<div class="topic-metadata">

**Author:** [@Abolfazl\_Ziaeemehr](https://discourse.julialang.org/u/Abolfazl_Ziaeemehr)\
**Replies:** 9\
**Last updated:** [April 18, 2021, 9:08pm UTC](https://discourse.julialang.org/t/how-to-find-source-code-of-a-function-in-differentialequations-jl/40402 "2021-04-18T21:08:48Z")

</div>

Hello everybody, I am new to the forum. I need to have access to detail documentation of some functions in DiffrentialEquations.jl package. I look into the source code in Github repository, but I could not find the fu…

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

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