# General Usage

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

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

**Page:** 497

---

## [Downloaded artifact: Enzyme took me forever and install failed](https://discourse.julialang.org/t/downloaded-artifact-enzyme-took-me-forever-and-install-failed/74585)

<div class="topic-metadata">

**Author:** [@frydaydeep](https://discourse.julialang.org/u/frydaydeep)\
**Replies:** 1\
**Last updated:** [January 14, 2022, 2:00am UTC](https://discourse.julialang.org/t/downloaded-artifact-enzyme-took-me-forever-and-install-failed/74585 "2022-01-14T02:00:53Z")

</div>

I met this problem when adding another package as well, what is artifact: Enzyme? google don’t know \]add OffsetArrays Resolving package versions… Downloaded artifact: Enzyme Downloaded artifact: Enzyme ERROR: Unab…

---

## [State of Julia grammar for tree-sitter](https://discourse.julialang.org/t/state-of-julia-grammar-for-tree-sitter/74573)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 5\
**Last updated:** [January 14, 2022, 1:00am UTC](https://discourse.julialang.org/t/state-of-julia-grammar-for-tree-sitter/74573 "2022-01-14T01:00:17Z")

</div>

Hi! I saw that Julia has an initial implementation of grammar for tree-sitter. However, the development seems stalled: https://github.com/tree-sitter/tree-sitter-julia I tried, but it seems to lack many things. It fai…

---

## [Parametric type with numbers](https://discourse.julialang.org/t/parametric-type-with-numbers/74544)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 3\
**Last updated:** [January 13, 2022, 6:52pm UTC](https://discourse.julialang.org/t/parametric-type-with-numbers/74544 "2022-01-13T18:52:49Z")

</div>

Hello! I am having difficulties trying to model the adequate code for what I want to achieve. Imagine I have the following struct: struct Device a::NTuple{3,Float64} b::NTuple{2,Float64} end where b is always…

---

## [Intersection of non-overlapping point clouds with Polyhedra.jl](https://discourse.julialang.org/t/intersection-of-non-overlapping-point-clouds-with-polyhedra-jl/74500)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [January 13, 2022, 2:39pm UTC](https://discourse.julialang.org/t/intersection-of-non-overlapping-point-clouds-with-polyhedra-jl/74500 "2022-01-13T14:39:20Z")

</div>

Hi all, I need to identify whether two point “clouds” of arbitrary dimension intersect. As a sanity check, I tested two non-overlapping point clouds to see if the results make sense. Strangely, the intersection is non…

---

## [Computational performance 3D finite difference stencil for different vectorization methods and precision](https://discourse.julialang.org/t/computational-performance-3d-finite-difference-stencil-for-different-vectorization-methods-and-precision/74382)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 1\
**Last updated:** [January 13, 2022, 2:30pm UTC](https://discourse.julialang.org/t/computational-performance-3d-finite-difference-stencil-for-different-vectorization-methods-and-precision/74382 "2022-01-13T14:30:37Z")

</div>

I have a code that generates with a macro a finite difference stencil. I have disabled the macro in order to make a minimal working example, so please forgive me for this absurdly long line, it is not there in my normal …

---

## [Strange error for unsupported Julia version](https://discourse.julialang.org/t/strange-error-for-unsupported-julia-version/74489)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 1\
**Last updated:** [January 13, 2022, 1:46pm UTC](https://discourse.julialang.org/t/strange-error-for-unsupported-julia-version/74489 "2022-01-13T13:46:08Z")

</div>

I am trying to set a minimum Julia version for a package I am developing. I may be misunderstanding something, but I thought from the docs (10. Project.toml and Manifest.toml · Pkg.jl) that the way to do this is to put …

---

## [CUDA CPU allocations with range](https://discourse.julialang.org/t/cuda-cpu-allocations-with-range/74549)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 5\
**Last updated:** [January 13, 2022, 1:15pm UTC](https://discourse.julialang.org/t/cuda-cpu-allocations-with-range/74549 "2022-01-13T13:15:16Z")

</div>

Hi! I was wondering, why CuArray of a range allocates the result on the CPU and moves it to the GPU afterwards? If I do the same directly with a broadcast call, it works flawless. Any suggestion how to prevent that? j…

---

## [Is there a better way to monitor a log file?](https://discourse.julialang.org/t/is-there-a-better-way-to-monitor-a-log-file/74538)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 4\
**Last updated:** [January 13, 2022, 12:47pm UTC](https://discourse.julialang.org/t/is-there-a-better-way-to-monitor-a-log-file/74538 "2022-01-13T12:47:28Z")

</div>

Hi all new to julia and so still learning the basics. I have a log file that another system updates about every 1 second. It’s just a simple text file and each “row” is about 1k bytes. I just want to get the “updates”…

---

## [Argmax, but n biggest elements](https://discourse.julialang.org/t/argmax-but-n-biggest-elements/74501)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 3\
**Last updated:** [January 13, 2022, 10:32am UTC](https://discourse.julialang.org/t/argmax-but-n-biggest-elements/74501 "2022-01-13T10:32:27Z")

</div>

I have an array with values, and I want to find the indices of the top n elements. argmax() allows me to find the biggest one, but not the n biggest, is there a way to modify it?

---

## [Help diagnosing a slow iterator](https://discourse.julialang.org/t/help-diagnosing-a-slow-iterator/74413)

<div class="topic-metadata">

**Author:** [@tecosaur](https://discourse.julialang.org/u/tecosaur)\
**Replies:** 5\
**Last updated:** [January 13, 2022, 9:56am UTC](https://discourse.julialang.org/t/help-diagnosing-a-slow-iterator/74413 "2022-01-13T09:56:16Z")

</div>

Note, this was asked on Zulip a week ago, but received no responses. Reposting in the hope that someone else might see and comment I have a tree-like structure, composed of a mix of types, and I’m looking to iterate th…

---

## [Writing to files on remote machine](https://discourse.julialang.org/t/writing-to-files-on-remote-machine/27356)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 7\
**Last updated:** [January 13, 2022, 9:45am UTC](https://discourse.julialang.org/t/writing-to-files-on-remote-machine/27356 "2022-01-13T09:45:40Z")

</div>

How can I write a text file on a remote machine where I log on using ssh? Thank you.

---

## [AbstractTrees needs one more kind of DFS?](https://discourse.julialang.org/t/abstracttrees-needs-one-more-kind-of-dfs/74468)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 8\
**Last updated:** [January 13, 2022, 7:47am UTC](https://discourse.julialang.org/t/abstracttrees-needs-one-more-kind-of-dfs/74468 "2022-01-13T07:47:39Z")

</div>

Here is what a PostOrderDFS does Any\[1,Any\[2,3\]\] ├─ 1 └─ Any\[2,3\] ├─ 2 └─ 3 we will get \[1, 2, 3, \[2, 3\], \[1, \[2, 3\]\]\] . but what I want it to do is \[2, 3, \[2,3\], 1, \[1,\[2,3\]\]\]. It doesn’t appear that Abstract…

---

## [Help optimizing IPFP algorithm](https://discourse.julialang.org/t/help-optimizing-ipfp-algorithm/74376)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 6\
**Last updated:** [January 13, 2022, 3:56am UTC](https://discourse.julialang.org/t/help-optimizing-ipfp-algorithm/74376 "2022-01-13T03:56:38Z")

</div>

I’m trying to speed up this version of the IPFP algorithm, which alternates between solving 2 systems of nonlinear equations until convergence: using NLsolve using LinearAlgebra const szAge = 64 - 19 + 1 const szE = 2 …

---

## [\`display\` and line breaks in \`TextDisplay\` and \`LineEditREPL\`](https://discourse.julialang.org/t/display-and-line-breaks-in-textdisplay-and-lineeditrepl/73459)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 2\
**Last updated:** [January 12, 2022, 11:08pm UTC](https://discourse.julialang.org/t/display-and-line-breaks-in-textdisplay-and-lineeditrepl/73459 "2022-01-12T23:08:57Z")

</div>

When I use display in a script and execute Julia from the command line julia script.jl, there seem to be missing line breaks after the display results. How do I make the “script” and REPL output look more similar? $ ju…

---

## [Segfault that I cannot explain, possibly related to Zygote](https://discourse.julialang.org/t/segfault-that-i-cannot-explain-possibly-related-to-zygote/74509)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 0\
**Last updated:** [January 12, 2022, 8:20pm UTC](https://discourse.julialang.org/t/segfault-that-i-cannot-explain-possibly-related-to-zygote/74509 "2022-01-12T20:20:18Z")

</div>

Naively maybe, I assumed that segfaults will only occur if I access memory I don’t own. Therefore, in Julia, with bounds checking turned on, it simply shouldn’t occur? I’ve now run into a case where the opposite happens…

---

## [Typo in constructor, why does Julia not complain?](https://discourse.julialang.org/t/typo-in-constructor-why-does-julia-not-complain/74495)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 4\
**Last updated:** [January 12, 2022, 6:50pm UTC](https://discourse.julialang.org/t/typo-in-constructor-why-does-julia-not-complain/74495 "2022-01-12T18:50:22Z")

</div>

I made a type in my constructor (Tset instead of Test) and noticed that Julia does not complain if there is another function in the struct definition that has a different name than the struct itself. What happens to this…

---

## [Matrix multiplication of a view of QR.Q with Vector{VariableRef} is slow](https://discourse.julialang.org/t/matrix-multiplication-of-a-view-of-qr-q-with-vector-variableref-is-slow/74480)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 6\
**Last updated:** [January 12, 2022, 3:17pm UTC](https://discourse.julialang.org/t/matrix-multiplication-of-a-view-of-qr-q-with-vector-variableref-is-slow/74480 "2022-01-12T15:17:55Z")

</div>

To assist with formulating a JuMP model for an SDP, I need to create affine expressions y (then the objectives and constraints can be cheaply constructed by getindex into y): F = qr(m::SparseMatrixCSC) # call to SuiteSp…

---

## [Working with a single equation, split up into several](https://discourse.julialang.org/t/working-with-a-single-equation-split-up-into-several/69551)

<div class="topic-metadata">

**Author:** [@adomasbaliuka](https://discourse.julialang.org/u/adomasbaliuka)\
**Replies:** 1\
**Last updated:** [January 12, 2022, 1:56pm UTC](https://discourse.julialang.org/t/working-with-a-single-equation-split-up-into-several/69551 "2022-01-12T13:56:12Z")

</div>

I’m trying to get into ModelingToolkit.jl but having some trouble understanding the documentation, which doesn’t seem to include basic examples. Solving nonlinear ODEs and plotting solutions in 3D is very impressive, but…

---

## [Concurrent Runs on HPC with Different Branches of the Same Package](https://discourse.julialang.org/t/concurrent-runs-on-hpc-with-different-branches-of-the-same-package/74488)

<div class="topic-metadata">

**Author:** [@Dr.Merkwuedigliebe](https://discourse.julialang.org/u/Dr.Merkwuedigliebe)\
**Replies:** 0\
**Last updated:** [January 12, 2022, 1:35pm UTC](https://discourse.julialang.org/t/concurrent-runs-on-hpc-with-different-branches-of-the-same-package/74488 "2022-01-12T13:35:03Z")

</div>

I have a package (added to Julia registry using dev) that runs a simulation on a single core. Its git repository has different branches with slightly varying sets of physics features. I would like to run these different …

---

## [How to use ECDSA ssh key to connect to Github private repo?](https://discourse.julialang.org/t/how-to-use-ecdsa-ssh-key-to-connect-to-github-private-repo/74372)

<div class="topic-metadata">

**Author:** [@metab0t](https://discourse.julialang.org/u/metab0t)\
**Replies:** 3\
**Last updated:** [January 12, 2022, 12:33pm UTC](https://discourse.julialang.org/t/how-to-use-ecdsa-ssh-key-to-connect-to-github-private-repo/74372 "2022-01-12T12:33:07Z")

</div>

I used to use a private Github repo as my personal registry. I followed the instructions in https://github.com/GunnarFarneback/LocalRegistry.jl/blob/master/docs/ssh\_keys.md#3-generating-a-compatible-key to generate a RS…

---

## [General environment creating issues for local ones](https://discourse.julialang.org/t/general-environment-creating-issues-for-local-ones/74327)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 13\
**Last updated:** [January 12, 2022, 11:54am UTC](https://discourse.julialang.org/t/general-environment-creating-issues-for-local-ones/74327 "2022-01-12T11:54:38Z")

</div>

Recently I was trying to work with the latest version of MLJBase, for this I created a sandbox environment sbx which I activated and added MLJBase in it, this is with Julia 1.7.1. Trying to use the package, I got errors…

---

## [In what format does the "permutations" command in the Combinatorics library compute the permutations?](https://discourse.julialang.org/t/in-what-format-does-the-permutations-command-in-the-combinatorics-library-compute-the-permutations/74451)

<div class="topic-metadata">

**Author:** [@BinChicken42](https://discourse.julialang.org/u/BinChicken42)\
**Replies:** 2\
**Last updated:** [January 12, 2022, 8:27am UTC](https://discourse.julialang.org/t/in-what-format-does-the-permutations-command-in-the-combinatorics-library-compute-the-permutations/74451 "2022-01-12T08:27:20Z")

</div>

I’m talking about this command: \[Docstrings · Combinatorics.jl\], Combinatorics version is 1.0.2, Julia version is 1.7.1 I want to see if the digits in a number (except one digit, called dig) add up to dig. My plan is to…

---

## [How to use multithreads in subthread?](https://discourse.julialang.org/t/how-to-use-multithreads-in-subthread/74470)

<div class="topic-metadata">

**Author:** [@HANHAOHAN](https://discourse.julialang.org/u/HANHAOHAN)\
**Replies:** 0\
**Last updated:** [January 12, 2022, 6:40am UTC](https://discourse.julialang.org/t/how-to-use-multithreads-in-subthread/74470 "2022-01-12T06:40:47Z")

</div>

\# start with -t 6 function test\_threads() Threads.@threads for i in 1:100 @show Threads.threadid() end end Threads.@spawn test\_threads() output as following: Threads.threadid() = 2 Threads.threadid() = 2 …

---

## [Char --\> ISO 15924 "code" ( four-letter script codes / unicode )](https://discourse.julialang.org/t/char-iso-15924-code-four-letter-script-codes-unicode/73988)

<div class="topic-metadata">

**Author:** [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Replies:** 2\
**Last updated:** [January 12, 2022, 2:47am UTC](https://discourse.julialang.org/t/char-iso-15924-code-four-letter-script-codes-unicode/73988 "2022-01-12T02:47:27Z")

</div>

Any function/package for converting Julia char to “four-letter script codes”? ISO 15924 Alphabetical Code List https://www.unicode.org/iso15924/iso15924.txt ISO 15924 - Wikipedia Script (Unicode) - Wikipedia

---

## [Converting a vector of static arrays](https://discourse.julialang.org/t/converting-a-vector-of-static-arrays/74448)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [January 12, 2022, 12:49am UTC](https://discourse.julialang.org/t/converting-a-vector-of-static-arrays/74448 "2022-01-12T00:49:00Z")

</div>

I have the following data structure: using KiteUtils syslog=demo\_syslog(7) syslog.Z Output: 201-element Vector{StaticArrays.MVector{7, Float32}}: \[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0\] \[0.0, 0.0007690057, 0.0030974336,…

---

## [Confusing memory allocations when using the integrator of DifferentialEquations.jl](https://discourse.julialang.org/t/confusing-memory-allocations-when-using-the-integrator-of-differentialequations-jl/74436)

<div class="topic-metadata">

**Author:** [@duan](https://discourse.julialang.org/u/duan)\
**Replies:** 10\
**Last updated:** [January 12, 2022, 12:28am UTC](https://discourse.julialang.org/t/confusing-memory-allocations-when-using-the-integrator-of-differentialequations-jl/74436 "2022-01-12T00:28:46Z")

</div>

Here is a prototype of my problem: using OrdinaryDiffEq n = 2^18; u0 = rand(ComplexF64, n); function f(du, u, p, t) for i in 1:length(u) du\[i\] = -1.0im \* u\[i\] end return end mutable struct A u0…

---

## [WSLtty Sixel REPL visualization](https://discourse.julialang.org/t/wsltty-sixel-repl-visualization/74430)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 0\
**Last updated:** [January 11, 2022, 8:53pm UTC](https://discourse.julialang.org/t/wsltty-sixel-repl-visualization/74430 "2022-01-11T20:53:22Z")

</div>

I am using Julia on Windows 11 and running a WSLtty terminal. I am trying to plot a figure in the REPL. I want to reproduce what “TerminalExtensions.jl” is doing in mac using iterm2. However, SixelTerm.jl and other ava…

---

## [Need help understanding best practices to organise projects with many scripts](https://discourse.julialang.org/t/need-help-understanding-best-practices-to-organise-projects-with-many-scripts/68683)

<div class="topic-metadata">

**Author:** [@fieldofnodes](https://discourse.julialang.org/u/fieldofnodes)\
**Replies:** 1\
**Last updated:** [January 11, 2022, 7:41pm UTC](https://discourse.julialang.org/t/need-help-understanding-best-practices-to-organise-projects-with-many-scripts/68683 "2022-01-11T19:41:13Z")

</div>

Hi all, This is a general question, which could be asked in a broader arena, but I wanted to see what people do to keep projects organised. I often, with the best of intentions, start with a clean basic template of fol…

---

## [Profiling Requires.jl](https://discourse.julialang.org/t/profiling-requires-jl/73570)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 1\
**Last updated:** [January 11, 2022, 7:37pm UTC](https://discourse.julialang.org/t/profiling-requires-jl/73570 "2022-01-11T19:37:58Z")

</div>

Is there any way to profile which Requires.jl usage are taking the longest time?

---

## [Dictionary from a String Sequence Iteration](https://discourse.julialang.org/t/dictionary-from-a-string-sequence-iteration/74359)

<div class="topic-metadata">

**Author:** [@Jdbeck66](https://discourse.julialang.org/u/Jdbeck66)\
**Replies:** 7\
**Last updated:** [January 11, 2022, 3:56pm UTC](https://discourse.julialang.org/t/dictionary-from-a-string-sequence-iteration/74359 "2022-01-11T15:56:44Z")

</div>

I’m looking for a more elegant, maybe faster way to create dictionary of position =\> difference between two string sequences. This is what I’m currently using. function mutationpositions(wildtype, variant) dict = D…

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

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