# General Usage

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

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

**Page:** 542

---

## [Iterate through all combinations of elements in an arbitrary number of arrays](https://discourse.julialang.org/t/iterate-through-all-combinations-of-elements-in-an-arbitrary-number-of-arrays/68819)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [September 27, 2021, 4:53pm UTC](https://discourse.julialang.org/t/iterate-through-all-combinations-of-elements-in-an-arbitrary-number-of-arrays/68819 "2021-09-27T16:53:29Z")

</div>

I have an array arrays which contains a number of arrays (arbitrary). How do I iterate through all combinations of elelements? If I know that there are e.g. 3 arrays I can do: for e1 in arrays\[1\], e2 in arrays\[2\], e3 i…

---

## [Help for the lazy](https://discourse.julialang.org/t/help-for-the-lazy/68801)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 2\
**Last updated:** [September 27, 2021, 3:33pm UTC](https://discourse.julialang.org/t/help-for-the-lazy/68801 "2021-09-27T15:33:26Z")

</div>

I have several matrices x1, ..., xn what’s a way to create a named tuple (x1=x1, ..., xn=xn) without having to type all components one by one? For example: x1 = rand(2, 2) x2 = rand(2, 2) x3 = rand(2, 2) lazyhelper(x1…

---

## [How to change Gtk predefined widgets?](https://discourse.julialang.org/t/how-to-change-gtk-predefined-widgets/68812)

<div class="topic-metadata">

**Author:** [@mathdeep](https://discourse.julialang.org/u/mathdeep)\
**Replies:** 0\
**Last updated:** [September 27, 2021, 2:14pm UTC](https://discourse.julialang.org/t/how-to-change-gtk-predefined-widgets/68812 "2021-09-27T14:14:20Z")

</div>

Hi there, I’m trying to build a little help for a friend and therefor would like to have a small UI. What I want to do: The user should be able to select files (maybe drag and drop them if I have the time and am not to…

---

## [Agent-based model performance](https://discourse.julialang.org/t/agent-based-model-performance/68758)

<div class="topic-metadata">

**Author:** [@Peter\_Uhl](https://discourse.julialang.org/u/Peter_Uhl)\
**Replies:** 14\
**Last updated:** [September 27, 2021, 5:39am UTC](https://discourse.julialang.org/t/agent-based-model-performance/68758 "2021-09-27T05:39:14Z")

</div>

Hi all, I am working to improve the performance of an agent-based model. The model is of two bacterial species whose growth and death probabilities are determined by the amount of a nutrient available locally. I’m aware…

---

## [Best way for a task to read from two channels](https://discourse.julialang.org/t/best-way-for-a-task-to-read-from-two-channels/68704)

<div class="topic-metadata">

**Author:** [@adriano.vilela](https://discourse.julialang.org/u/adriano.vilela)\
**Replies:** 25\
**Last updated:** [September 27, 2021, 12:48am UTC](https://discourse.julialang.org/t/best-way-for-a-task-to-read-from-two-channels/68704 "2021-09-27T00:48:30Z")

</div>

Hi, I’m working on a problem that involves tasks communicating through channels. I have a task that needs to read from two channels and I’m trying to figure out the best way of doing that. The task needs to read an in…

---

## [Julia 1.6.3 pdf version of documentation missing](https://discourse.julialang.org/t/julia-1-6-3-pdf-version-of-documentation-missing/68760)

<div class="topic-metadata">

**Author:** [@murrayE](https://discourse.julialang.org/u/murrayE)\
**Replies:** 1\
**Last updated:** [September 26, 2021, 10:51pm UTC](https://discourse.julialang.org/t/julia-1-6-3-pdf-version-of-documentation-missing/68760 "2021-09-26T22:51:54Z")

</div>

The link at Julia Documentation · The Julia Language to the PDF version of Julia 1.6.3 documentation gives a “404 not found” error.

---

## [Sum of doubles](https://discourse.julialang.org/t/sum-of-doubles/68747)

<div class="topic-metadata">

**Author:** [@HexxCube](https://discourse.julialang.org/u/HexxCube)\
**Replies:** 16\
**Last updated:** [September 26, 2021, 9:02pm UTC](https://discourse.julialang.org/t/sum-of-doubles/68747 "2021-09-26T21:02:55Z")

</div>

I am trying to speed up my solution to the following exercise: Given a Array of int values (from 1 to p), return the sum of doubles. If one of the values occurs only once, it does not count towards the sum. loneSum(\[1…

---

## [Why is this @tullio example failing with a range error?](https://discourse.julialang.org/t/why-is-this-tullio-example-failing-with-a-range-error/68748)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 2\
**Last updated:** [September 26, 2021, 7:52pm UTC](https://discourse.julialang.org/t/why-is-this-tullio-example-failing-with-a-range-error/68748 "2021-09-26T19:52:25Z")

</div>

I am experimenting with Tullio in order to write fast nested loops. I have arrays on which I perform computations on a subset. I do not know why this is failing, as all indices get a range provided. using Tullio itot =…

---

## [Manipulating Parameters of Parametrized Types](https://discourse.julialang.org/t/manipulating-parameters-of-parametrized-types/68763)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 6\
**Last updated:** [September 26, 2021, 7:04pm UTC](https://discourse.julialang.org/t/manipulating-parameters-of-parametrized-types/68763 "2021-09-26T19:04:26Z")

</div>

I have a struct which is composed of N components and N - 1 weights (because they add up to 1 and I don’t need the additional degree of freedom). My attempt is below struct WeightedComponents{N} components::NTuple{N…

---

## [Symbolics and substitution using broadcasting](https://discourse.julialang.org/t/symbolics-and-substitution-using-broadcasting/68705)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 5\
**Last updated:** [September 26, 2021, 4:50pm UTC](https://discourse.julialang.org/t/symbolics-and-substitution-using-broadcasting/68705 "2021-09-26T16:50:50Z")

</div>

Hello everyone, I’m trying to substitute some variables by some strings in a matrix using broadcasting. The aim is to make the visually simplify the expression such that stuff like eta(Exx,Eyy,Exy) simply reads as eta …

---

## [Julia could have a Tau constant](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181)

<div class="topic-metadata">

**Author:** [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Replies:** 33\
**Last updated:** [September 26, 2021, 1:38pm UTC](https://discourse.julialang.org/t/julia-could-have-a-tau-constant/68181 "2021-09-26T13:38:54Z")

</div>

Python is already into the movement. Let’s get into the tau revolution? const taunumber = 6.283

---

## [Problem with \`println()\` and \`display()\`, \`display()\` can't display line breaks](https://discourse.julialang.org/t/problem-with-println-and-display-display-cant-display-line-breaks/68762)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [September 26, 2021, 8:57am UTC](https://discourse.julialang.org/t/problem-with-println-and-display-display-cant-display-line-breaks/68762 "2021-09-26T08:57:51Z")

</div>

I have a script that analyses some parameters and prints the result (in a Julia notebook). This includes both text messages and plots. I have problem finding a print format which preserved the order things are printed (l…

---

## [How to call arguments from outside of the scope](https://discourse.julialang.org/t/how-to-call-arguments-from-outside-of-the-scope/68752)

<div class="topic-metadata">

**Author:** [@Jakub\_Mitura](https://discourse.julialang.org/u/Jakub_Mitura)\
**Replies:** 4\
**Last updated:** [September 26, 2021, 8:55am UTC](https://discourse.julialang.org/t/how-to-call-arguments-from-outside-of-the-scope/68752 "2021-09-26T08:55:35Z")

</div>

Hello is it possible to invoke a function to use variable from caller function scope using macros ? I think about sth like function innerFunction() println(a\*4) end function outerContext() a = 4 @useOutArgs innerF…

---

## [Optional parameter causes type instability](https://discourse.julialang.org/t/optional-parameter-causes-type-instability/68768)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 1\
**Last updated:** [September 26, 2021, 3:19am UTC](https://discourse.julialang.org/t/optional-parameter-causes-type-instability/68768 "2021-09-26T03:19:50Z")

</div>

Using @code\_warntype, function f(x::Float64, T=Float64 ) T(x) end passes with flying colors, but function f(x::Float64; T=Float64) T(x) end causes mayhem. Why?

---

## [Question on Calling Julia functions from C++ with CxxWrap (and Eventually Interfacing with Julia from MATLAB)](https://discourse.julialang.org/t/question-on-calling-julia-functions-from-c-with-cxxwrap-and-eventually-interfacing-with-julia-from-matlab/68378)

<div class="topic-metadata">

**Author:** [@GrantHecht](https://discourse.julialang.org/u/GrantHecht)\
**Replies:** 2\
**Last updated:** [September 25, 2021, 8:08pm UTC](https://discourse.julialang.org/t/question-on-calling-julia-functions-from-c-with-cxxwrap-and-eventually-interfacing-with-julia-from-matlab/68378 "2021-09-25T20:08:28Z")

</div>

Hello everyone, I have a relatively unique use case for Julia and CxxWrap.jl. To provide some background, my current research involves employing heuristic optimization algorithms to assist in solving spacecraft trajecto…

---

## [Using Jetson Nano as replacement for RPi (3D printing)](https://discourse.julialang.org/t/using-jetson-nano-as-replacement-for-rpi-3d-printing/68739)

<div class="topic-metadata">

**Author:** [@skypuppy](https://discourse.julialang.org/u/skypuppy)\
**Replies:** 1\
**Last updated:** [September 25, 2021, 2:55pm UTC](https://discourse.julialang.org/t/using-jetson-nano-as-replacement-for-rpi-3d-printing/68739 "2021-09-25T14:55:20Z")

</div>

I’d like to use a Jetson Nano as replacement for multiple RPi’s to control several 3D printers. Octoprint is my preferred tool at the start. Octoprint is written in Python so my first labor of love is to translate it i…

---

## [I can't update Flux to the latest version, probably due to a package compat constraint. How do I fix this?](https://discourse.julialang.org/t/i-cant-update-flux-to-the-latest-version-probably-due-to-a-package-compat-constraint-how-do-i-fix-this/68672)

<div class="topic-metadata">

**Author:** [@DevJac](https://discourse.julialang.org/u/DevJac)\
**Replies:** 2\
**Last updated:** [September 25, 2021, 3:09am UTC](https://discourse.julialang.org/t/i-cant-update-flux-to-the-latest-version-probably-due-to-a-package-compat-constraint-how-do-i-fix-this/68672 "2021-09-25T03:09:24Z")

</div>

I recently got a NVIDIA GPU and wanted to run some of my old Flux code, but there is a bug with the older version of Flux and I cannot get it to work. Long story short, I need to update to the latest version of Flux. Exp…

---

## [Package not opening PR for updating](https://discourse.julialang.org/t/package-not-opening-pr-for-updating/68725)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 4\
**Last updated:** [September 25, 2021, 1:47am UTC](https://discourse.julialang.org/t/package-not-opening-pr-for-updating/68725 "2021-09-25T01:47:15Z")

</div>

Hi, I’m working in a new package and tried the first update. However even after an hour nothing happened when I called the \[@JuliaRegistrator register(). https://github.com/GenericMappingTools/RemoteS.jl/issues/26 Th…

---

## [Fastest data structure for a priority queue](https://discourse.julialang.org/t/fastest-data-structure-for-a-priority-queue/68472)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 23\
**Last updated:** [September 24, 2021, 11:20pm UTC](https://discourse.julialang.org/t/fastest-data-structure-for-a-priority-queue/68472 "2021-09-24T23:20:34Z")

</div>

… depends on the number of events to be handled. I could not use the PQs I’ve seen in Julia because they did not handle multiple identical event times, so took this as an exercise. My events have the following structur…

---

## [De-structure results from broadcasting](https://discourse.julialang.org/t/de-structure-results-from-broadcasting/68721)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 4\
**Last updated:** [September 24, 2021, 8:30pm UTC](https://discourse.julialang.org/t/de-structure-results-from-broadcasting/68721 "2021-09-24T20:30:27Z")

</div>

Hello! When not using broadcasting, there is a way to destructure results from a function: julia\> f(x) = (x, x^2); julia\> (y1, y2) = f(5); julia\> y1 5 julia\> y2 25 However, this does not work while broadcasting: j…

---

## [Passing boolean settings to module to parse fast kernels via macros](https://discourse.julialang.org/t/passing-boolean-settings-to-module-to-parse-fast-kernels-via-macros/68702)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 7\
**Last updated:** [September 24, 2021, 6:53pm UTC](https://discourse.julialang.org/t/passing-boolean-settings-to-module-to-parse-fast-kernels-via-macros/68702 "2021-09-24T18:53:27Z")

</div>

I have a module that builds high performance kernels, based on user settings. I would like to construct them using settings that are provided by the user that imports the Kernels module. What would be the most logical wa…

---

## [How to skip arguments when using a function](https://discourse.julialang.org/t/how-to-skip-arguments-when-using-a-function/68621)

<div class="topic-metadata">

**Author:** [@Giulio\_Benedetti](https://discourse.julialang.org/u/Giulio_Benedetti)\
**Replies:** 9\
**Last updated:** [September 24, 2021, 5:51pm UTC](https://discourse.julialang.org/t/how-to-skip-arguments-when-using-a-function/68621 "2021-09-24T17:51:56Z")

</div>

Hi there! Is there a way in Julia to skip arguments when using a function? I am looking for something like the tilde in MATLAB: # MATLAB MyFunction(a, ~, c) Thanks in advance!

---

## [Why lu() factorization is not reducing the execution time?](https://discourse.julialang.org/t/why-lu-factorization-is-not-reducing-the-execution-time/68664)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 10\
**Last updated:** [September 24, 2021, 5:24pm UTC](https://discourse.julialang.org/t/why-lu-factorization-is-not-reducing-the-execution-time/68664 "2021-09-24T17:24:39Z")

</div>

I am using lu() to reduce the computation time but it turned out not as expected. Any idea why is that? julia\> A = \[1 3 3 2;2 6 9 7; -1 -3 3 4\] 3×4 Matrix{Int64}: 1 3 3 2 2 6 9 7 -1 -3 3 4 julia\> lu(A,c…

---

## [How to combine two column data into one matrix?](https://discourse.julialang.org/t/how-to-combine-two-column-data-into-one-matrix/68706)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 2\
**Last updated:** [September 24, 2021, 4:16pm UTC](https://discourse.julialang.org/t/how-to-combine-two-column-data-into-one-matrix/68706 "2021-09-24T16:16:37Z")

</div>

For example, I have two column data: A = \[1;2;3\]; B = \[5;6;7\]; In order to make a matrix with the first column being A and 2nd Column being B, I would do this in Matlab: C = \[A, B\]; But it does it the wrong way and …

---

## [How to define function parameters to be read as same type?](https://discourse.julialang.org/t/how-to-define-function-parameters-to-be-read-as-same-type/68696)

<div class="topic-metadata">

**Author:** [@Minimum-Pollution-96](https://discourse.julialang.org/u/Minimum-Pollution-96)\
**Replies:** 3\
**Last updated:** [September 24, 2021, 4:11pm UTC](https://discourse.julialang.org/t/how-to-define-function-parameters-to-be-read-as-same-type/68696 "2021-09-24T16:11:46Z")

</div>

Hi, This is how I’m defining the function. function unrestricted\_search(f::Function, δ::T, x0::T) where T# Maximization algorithm f0 = f(x0) Data = DataFrame(f=f0, x=x0) diff = f(x0+δ) - f(x0) if diff \< …

---

## [Evaluate Turing model posterior with many parameters](https://discourse.julialang.org/t/evaluate-turing-model-posterior-with-many-parameters/68699)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 0\
**Last updated:** [September 24, 2021, 2:27pm UTC](https://discourse.julialang.org/t/evaluate-turing-model-posterior-with-many-parameters/68699 "2021-09-24T14:27:39Z")

</div>

I want to evaluate the non-normalized posterior of a Turing model at some point in the parameter space. The guide suggests the prob"..." or logprob"..." string macros for this, but it seems inconvenient if there’s more …

---

## [Randn isn't consistent with Seed?](https://discourse.julialang.org/t/randn-isnt-consistent-with-seed/68287)

<div class="topic-metadata">

**Author:** [@klowrey](https://discourse.julialang.org/u/klowrey)\
**Replies:** 6\
**Last updated:** [September 24, 2021, 2:14pm UTC](https://discourse.julialang.org/t/randn-isnt-consistent-with-seed/68287 "2021-09-24T14:14:43Z")

</div>

When I run the following few lines of code, I get the attached behavior where the first few elements of using randn will be the same but after a while (not sure if machine dependent) the same rng will diverge, but only w…

---

## [PySpark + PyCall + UDF Integration - PyCall.jlwrap cannot pickle](https://discourse.julialang.org/t/pyspark-pycall-udf-integration-pycall-jlwrap-cannot-pickle/50122)

<div class="topic-metadata">

**Author:** [@dmoliveira](https://discourse.julialang.org/u/dmoliveira)\
**Replies:** 5\
**Last updated:** [September 24, 2021, 12:57pm UTC](https://discourse.julialang.org/t/pyspark-pycall-udf-integration-pycall-jlwrap-cannot-pickle/50122 "2021-09-24T12:57:28Z")

</div>

Hi Julia fellows! I just trying to see the potential for Pyspark + Julia. I know that we have Spark.jl but there are some limitations for my end goal experiment. Then, decided to give a try and for basic cases is workin…

---

## [Resizing a Figure with CairoMakie](https://discourse.julialang.org/t/resizing-a-figure-with-cairomakie/68691)

<div class="topic-metadata">

**Author:** [@DNF](https://discourse.julialang.org/u/DNF)\
**Replies:** 2\
**Last updated:** [September 24, 2021, 12:27pm UTC](https://discourse.julialang.org/t/resizing-a-figure-with-cairomakie/68691 "2021-09-24T12:27:16Z")

</div>

I am using CairoMakie, and I need a plot window which contains many subaxes. The number can change from time to time, and it is very hard to determine in advance the correct size and resolution for the Figure that holds …

---

## [Is there a way to keep the delimiter in split function, as a separate element?](https://discourse.julialang.org/t/is-there-a-way-to-keep-the-delimiter-in-split-function-as-a-separate-element/51995)

<div class="topic-metadata">

**Author:** [@D\_A](https://discourse.julialang.org/u/D_A)\
**Replies:** 2\
**Last updated:** [December 17, 2020, 8:15pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-keep-the-delimiter-in-split-function-as-a-separate-element/51995 "2020-12-17T20:15:41Z")

</div>

Hello, This is identical to this. In my case, if I want to split a string (for example a quite complex anthroponym, with dashes, apostrophes, etc.), making complex capitalization depending on these punctuation delimite…

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

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