# General Usage

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

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

**Page:** 271

---

## [Multi Line TTY printing weirdness from the non-main thread](https://discourse.julialang.org/t/multi-line-tty-printing-weirdness-from-the-non-main-thread/100423)

<div class="topic-metadata">

**Author:** [@curtd](https://discourse.julialang.org/u/curtd)\
**Replies:** 1\
**Last updated:** [July 10, 2023, 11:24am UTC](https://discourse.julialang.org/t/multi-line-tty-printing-weirdness-from-the-non-main-thread/100423 "2023-07-10T11:24:27Z")

</div>

There’s some TTY-weirdness going on when I try to print a multi-line strings to stdout or stderr from a spawned task. Sometimes when printing a string with multiple line-breaks in it (although not always), the printed s…

---

## [Activating environment for a specific branch](https://discourse.julialang.org/t/activating-environment-for-a-specific-branch/101425)

<div class="topic-metadata">

**Author:** [@hzarei](https://discourse.julialang.org/u/hzarei)\
**Replies:** 1\
**Last updated:** [July 10, 2023, 11:20am UTC](https://discourse.julialang.org/t/activating-environment-for-a-specific-branch/101425 "2023-07-10T11:20:50Z")

</div>

Hello, I have created a development branch from the main branch for a package. Is it possible to activate another Julia environment for this branch that is slightly different?

---

## [Get index corresponding to some number in list of outputs](https://discourse.julialang.org/t/get-index-corresponding-to-some-number-in-list-of-outputs/101068)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 24\
**Last updated:** [July 10, 2023, 3:43am UTC](https://discourse.julialang.org/t/get-index-corresponding-to-some-number-in-list-of-outputs/101068 "2023-07-10T03:43:39Z")

</div>

I want to get indices in lines corresponding to A=0 in output. :face\_with\_monocle: My goal is to get out the data between row index 14 and 23 of the lines variable output in terms of variable i. using HTTP , Gumbo , C…

---

## [Multi-threading appears to be single thread when some threads cost much more time than the others?](https://discourse.julialang.org/t/multi-threading-appears-to-be-single-thread-when-some-threads-cost-much-more-time-than-the-others/101353)

<div class="topic-metadata">

**Author:** [@WellWellww](https://discourse.julialang.org/u/WellWellww)\
**Replies:** 13\
**Last updated:** [July 10, 2023, 9:53am UTC](https://discourse.julialang.org/t/multi-threading-appears-to-be-single-thread-when-some-threads-cost-much-more-time-than-the-others/101353 "2023-07-10T09:53:45Z")

</div>

Hi, I have the following code section with millions of loops using multi-threading. global result\_list = Vector{Union{Nothing,SparseVector{Float64,Int64}}}(nothing, tot\_num) Threads.@threads for element in element\_list…

---

## [Broadcast over struct fields?](https://discourse.julialang.org/t/broadcast-over-struct-fields/101307)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 12\
**Last updated:** [July 10, 2023, 9:54am UTC](https://discourse.julialang.org/t/broadcast-over-struct-fields/101307 "2023-07-10T09:54:55Z")

</div>

For a struct with elements of the same type. Is there a way to broadcast operations over the elements, and create a new struct. Like you can for a Dictionary. struct X a::Float64 b::Float64 c::Float64 end…

---

## [Help to reduce memory allocations in a function](https://discourse.julialang.org/t/help-to-reduce-memory-allocations-in-a-function/101422)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 2\
**Last updated:** [July 10, 2023, 8:44am UTC](https://discourse.julialang.org/t/help-to-reduce-memory-allocations-in-a-function/101422 "2023-07-10T08:44:54Z")

</div>

Hello Julia experts, I have been working on the function shortest\_distance2\_t for quite a while, trying to optimise its performance. I do not have very advanced perf tools. Currently I use BenchmarkTools and PProf. I re…

---

## [Caching metadata in custom broadcasting interface](https://discourse.julialang.org/t/caching-metadata-in-custom-broadcasting-interface/101289)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 6\
**Last updated:** [July 10, 2023, 12:52am UTC](https://discourse.julialang.org/t/caching-metadata-in-custom-broadcasting-interface/101289 "2023-07-10T00:52:35Z")

</div>

I’m trying to create a QuantityArray type for DynamicQuantities.jl (on the arrays-2 branch). Original announcement here: \[ANN\] DynamicQuantities.jl: type stable physical quantities. cc @non-Jedi The reason you would wan…

---

## [Regex capture next line in text file](https://discourse.julialang.org/t/regex-capture-next-line-in-text-file/101361)

<div class="topic-metadata">

**Author:** [@Nick\_Mulholland](https://discourse.julialang.org/u/Nick_Mulholland)\
**Replies:** 7\
**Last updated:** [July 9, 2023, 4:45pm UTC](https://discourse.julialang.org/t/regex-capture-next-line-in-text-file/101361 "2023-07-09T16:45:00Z")

</div>

I’m fairly next to Julia and was wondering if anyone had some advice. I’m loving the regex feature which is working great on a line by line query for example open(filename) do file for (index, ln) in enumerate(e…

---

## [Higher-level function with variable number of parameters](https://discourse.julialang.org/t/higher-level-function-with-variable-number-of-parameters/101390)

<div class="topic-metadata">

**Author:** [@pao](https://discourse.julialang.org/u/pao)\
**Replies:** 0\
**Last updated:** [July 9, 2023, 10:00am UTC](https://discourse.julialang.org/t/higher-level-function-with-variable-number-of-parameters/101390 "2023-07-09T10:00:30Z")

</div>

Hi guys, I need to write this kind of higher level operators op. op ∈ {T,S,R,H,G}: op -\> indxs::Int -\> params::Real -\> obj::UserType =\> obj::UserType Problem I’m not able to solve is about having indxs and params …

---

## [Franklin.jl -- How to Extract Properties of Specific Posts/Pages](https://discourse.julialang.org/t/franklin-jl-how-to-extract-properties-of-specific-posts-pages/101338)

<div class="topic-metadata">

**Author:** [@Steve\_Shupe](https://discourse.julialang.org/u/Steve_Shupe)\
**Replies:** 6\
**Last updated:** [July 9, 2023, 1:09pm UTC](https://discourse.julialang.org/t/franklin-jl-how-to-extract-properties-of-specific-posts-pages/101338 "2023-07-09T13:09:35Z")

</div>

I’ve started using the Franklin package. I generally understand how it works, but am struggling with how to extract specific information about a post or page when writing an “hfun\_” function for utils.jl. For example, if…

---

## [Task/thread-local caches/buffers](https://discourse.julialang.org/t/task-thread-local-caches-buffers/101309)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 12\
**Last updated:** [July 9, 2023, 10:56am UTC](https://discourse.julialang.org/t/task-thread-local-caches-buffers/101309 "2023-07-09T10:56:05Z")

</div>

What is currently the best way to handle task/thread-local caches/buffers that need to be accessed efficiently from functions called from a Threads.@threads for loop? The background is as follows. As described in the re…

---

## [Using callback functions when solving pde's with MethodOfLines](https://discourse.julialang.org/t/using-callback-functions-when-solving-pdes-with-methodoflines/101379)

<div class="topic-metadata">

**Author:** [@mkretzschmar](https://discourse.julialang.org/u/mkretzschmar)\
**Replies:** 1\
**Last updated:** [July 9, 2023, 10:38am UTC](https://discourse.julialang.org/t/using-callback-functions-when-solving-pdes-with-methodoflines/101379 "2023-07-09T10:38:22Z")

</div>

I am using the MethodOfLines package for solving a system of first order pde’s. Now I want to introduce callback functions to handle discrete events. It is unclear to me how to call the integrator, because the pde system…

---

## [How should I use Revise.jl (and other developer tools) to develop a package?](https://discourse.julialang.org/t/how-should-i-use-revise-jl-and-other-developer-tools-to-develop-a-package/101344)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 17\
**Last updated:** [July 9, 2023, 6:43am UTC](https://discourse.julialang.org/t/how-should-i-use-revise-jl-and-other-developer-tools-to-develop-a-package/101344 "2023-07-09T06:43:11Z")

</div>

When I create a new package, I often want BenchmarkTools, Revise, and other dependencies that are accessible within my package’s environment, but won’t be added as dependencies for users. I’ve tried playing around with \[…

---

## [Cannot \`pkg\> dev .\` a package with extensions inside a shared environment?](https://discourse.julialang.org/t/cannot-pkg-dev-a-package-with-extensions-inside-a-shared-environment/101363)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 0\
**Last updated:** [July 8, 2023, 7:54pm UTC](https://discourse.julialang.org/t/cannot-pkg-dev-a-package-with-extensions-inside-a-shared-environment/101363 "2023-07-08T19:54:17Z")

</div>

Following a recent discussion on dev environments, I tried this new workflow of using a shared environment. But when I used pkg\> dev . on a locally downloaded package with extensions (aka weakdeps, introduced in Julia …

---

## [Precompilation OOM](https://discourse.julialang.org/t/precompilation-oom/101366)

<div class="topic-metadata">

**Author:** [@NAS](https://discourse.julialang.org/u/NAS)\
**Replies:** 2\
**Last updated:** [July 8, 2023, 8:50pm UTC](https://discourse.julialang.org/t/precompilation-oom/101366 "2023-07-08T20:50:40Z")

</div>

Has anyone had an issue with a project precompilation just running and continuing to consume memory. I have a module I’m working on developing right now and when I Pkg.add it appears to update all of the dependencies and…

---

## [Error installing GLMakie](https://discourse.julialang.org/t/error-installing-glmakie/101347)

<div class="topic-metadata">

**Author:** [@Uve](https://discourse.julialang.org/u/Uve)\
**Replies:** 5\
**Last updated:** [July 8, 2023, 8:02pm UTC](https://discourse.julialang.org/t/error-installing-glmakie/101347 "2023-07-08T20:02:48Z")

</div>

I just installed julia on a new PC (Windows 10) and I have problems precompiling GLMakie (or any other version of Makie). I have tried reinstalling everything but have not been successful. julia\> using GLMakie \[ Info: P…

---

## [Avoid truncation for display of custom Tables object](https://discourse.julialang.org/t/avoid-truncation-for-display-of-custom-tables-object/101326)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 0\
**Last updated:** [July 7, 2023, 7:07pm UTC](https://discourse.julialang.org/t/avoid-truncation-for-display-of-custom-tables-object/101326 "2023-07-07T19:07:29Z")

</div>

I have a custom type CollectedBenchmarks that implements the Tables.jl interface. I’ve defined function Base.show(io::IO, ::MIME"text/plain", b::CollectedBenchmarks) pretty\_table(io, b; show\_row\_number=true) end us…

---

## [Shared data between processes](https://discourse.julialang.org/t/shared-data-between-processes/101350)

<div class="topic-metadata">

**Author:** [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Replies:** 0\
**Last updated:** [July 8, 2023, 3:20pm UTC](https://discourse.julialang.org/t/shared-data-between-processes/101350 "2023-07-08T15:20:23Z")

</div>

I was surprised that SharedArrays.jl does not support SparseArrays. Is there any package that can place any data structure in a shared memory segment so that collaborating processes from Distributed.jl can access them w…

---

## [Make function ignore Case-sensitivity of its input](https://discourse.julialang.org/t/make-function-ignore-case-sensitivity-of-its-input/101294)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 5\
**Last updated:** [July 7, 2023, 9:29pm UTC](https://discourse.julialang.org/t/make-function-ignore-case-sensitivity-of-its-input/101294 "2023-07-07T21:29:42Z")

</div>

I want make findfirst() function Case-insensitive. I want to extract texts after Filter word in webpages text. Some webpages contains it as FILTER and some as Filter. How to make them equivalent ? while for other w…

---

## [Low rank factorized AbstractMatrix](https://discourse.julialang.org/t/low-rank-factorized-abstractmatrix/19838)

<div class="topic-metadata">

**Author:** [@jarl](https://discourse.julialang.org/u/jarl)\
**Replies:** 18\
**Last updated:** [July 7, 2023, 8:52pm UTC](https://discourse.julialang.org/t/low-rank-factorized-abstractmatrix/19838 "2023-07-07T20:52:02Z")

</div>

Basic question: Is there an AbstractMatrix which can represent a low-rank factorized matrix? Example: I have the rank-one matrix: n1=900; n2=100; u=\[zeros(n1);randn(n2)\]; A=u\*u'; I want to use A in functions which tak…

---

## [Custom Compat.jl Block](https://discourse.julialang.org/t/custom-compat-jl-block/101328)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 1\
**Last updated:** [July 7, 2023, 8:15pm UTC](https://discourse.julialang.org/t/custom-compat-jl-block/101328 "2023-07-07T20:15:02Z")

</div>

I wrote a function to collect an iterator into a tuple: collect\_tuple(itr) = \_collect\_tuple(Iterators.peel(itr)) \_collect\_tuple(peel\_return) = \_collect\_tuple(peel\_return...) \_collect\_tuple(::Nothing) = () \_collect\_tuple…

---

## [Extracting values from UnivariateFinite](https://discourse.julialang.org/t/extracting-values-from-univariatefinite/62794)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 8\
**Last updated:** [July 7, 2023, 6:51pm UTC](https://discourse.julialang.org/t/extracting-values-from-univariatefinite/62794 "2023-07-07T18:51:22Z")

</div>

So MLJ gave me, as its output, a UnivariateFinite data structure; I have: UnivariateFinite{OrderedFactor{2}}(0=\>0.937, 1=\>0.0626) Is there a way I can extract, as an array, the probabilities from this distribution (oth…

---

## [Does Pkg.develop have different behavior with and without path?](https://discourse.julialang.org/t/does-pkg-develop-have-different-behavior-with-and-without-path/101325)

<div class="topic-metadata">

**Author:** [@kmp5](https://discourse.julialang.org/u/kmp5)\
**Replies:** 0\
**Last updated:** [July 7, 2023, 6:48pm UTC](https://discourse.julialang.org/t/does-pkg-develop-have-different-behavior-with-and-without-path/101325 "2023-07-07T18:48:07Z")

</div>

Hi all I also posted this question on the stackoverflow I am having an interesting issue with the Package manager system and wondering if its related to the way my Project.toml is set up. The issue is that when I call P…

---

## [Drawing a large network using Julia](https://discourse.julialang.org/t/drawing-a-large-network-using-julia/85793)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 6\
**Last updated:** [July 7, 2023, 6:13pm UTC](https://discourse.julialang.org/t/drawing-a-large-network-using-julia/85793 "2023-07-07T18:13:26Z")

</div>

Is there a way to draw a network (with nods and edges) in Julia? In particular, I have (say) 5 nodes of type 1 and 10 of type 2. Directed edges exist from each type 1 node to type 2 node, and I would probably show nodes …

---

## [Mapreduce performance and dispatch](https://discourse.julialang.org/t/mapreduce-performance-and-dispatch/101322)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 0\
**Last updated:** [July 7, 2023, 5:49pm UTC](https://discourse.julialang.org/t/mapreduce-performance-and-dispatch/101322 "2023-07-07T17:49:14Z")

</div>

I’m having trouble getting mapreduce to dispatch correctly and am looking for tips. From profiling I can see that it dispatches to map and reduce independently rather than something better like mapfoldl. There’s a simil…

---

## [String7 and Bools : bug or feature?](https://discourse.julialang.org/t/string7-and-bools-bug-or-feature/101188)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 7\
**Last updated:** [July 7, 2023, 4:36pm UTC](https://discourse.julialang.org/t/string7-and-bools-bug-or-feature/101188 "2023-07-07T16:36:26Z")

</div>

This one got me (by reading in a DataFrame via CSV). Is this behavior intentional? julia\> using CSV julia\> x = String7( "4" ) "4" julia\> parse( Int, x ) 4 julia\> y = String7( "true" ) "true" julia\> parse( Bool, y …

---

## [CCXT with Julia](https://discourse.julialang.org/t/ccxt-with-julia/90905)

<div class="topic-metadata">

**Author:** [@W4C](https://discourse.julialang.org/u/W4C)\
**Replies:** 2\
**Last updated:** [July 7, 2023, 3:01pm UTC](https://discourse.julialang.org/t/ccxt-with-julia/90905 "2023-07-07T15:01:14Z")

</div>

Hello, I wonder if some people here have been able to run CCXT GitHub - ccxt/ccxt: A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges with Julia Wondering if…

---

## [1.10 alpha significantly slower to start REPL](https://discourse.julialang.org/t/1-10-alpha-significantly-slower-to-start-repl/101293)

<div class="topic-metadata">

**Author:** [@albheim](https://discourse.julialang.org/u/albheim)\
**Replies:** 9\
**Last updated:** [July 7, 2023, 2:00pm UTC](https://discourse.julialang.org/t/1-10-alpha-significantly-slower-to-start-repl/101293 "2023-07-07T14:00:01Z")

</div>

Got the new alpha from juliaup, and the REPL seemed significantly slower to boot than in the release. Did a very simple test where I pressed Ctrl-D as soon as I saw the julia prompt, so might be a little variability fro…

---

## [The proper way of documenting constructors](https://discourse.julialang.org/t/the-proper-way-of-documenting-constructors/17049)

<div class="topic-metadata">

**Author:** [@fjarri](https://discourse.julialang.org/u/fjarri)\
**Replies:** 3\
**Last updated:** [July 7, 2023, 1:58pm UTC](https://discourse.julialang.org/t/the-proper-way-of-documenting-constructors/17049 "2023-07-07T13:58:47Z")

</div>

If a type has outer constructors, Julia’s REPL shows all their docstrings joined together with the type’s docstring when asked for help, which is pretty neat: "Type docstring" struct A x end "Constructor docstring…

---

## [PackageCompiler executable Error](https://discourse.julialang.org/t/packagecompiler-executable-error/81466)

<div class="topic-metadata">

**Author:** [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Replies:** 6\
**Last updated:** [July 7, 2023, 1:20pm UTC](https://discourse.julialang.org/t/packagecompiler-executable-error/81466 "2023-07-07T13:20:22Z")

</div>

Hi I built an exectuable with PackageCompiler.create\_app("JuliaPlotting", "/home/christian/trasch/julia-plotting") but when I run it with /home/christian/trasch/julia-plotting/bin/JuliaPlotting it spits out the follow…

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

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