# General Usage

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

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

**Page:** 596

---

## [Threads.@threads parallelism and htop](https://discourse.julialang.org/t/threads-threads-parallelism-and-htop/61762)

<div class="topic-metadata">

**Author:** [@cricci](https://discourse.julialang.org/u/cricci)\
**Replies:** 2\
**Last updated:** [May 25, 2021, 1:45pm UTC](https://discourse.julialang.org/t/threads-threads-parallelism-and-htop/61762 "2021-05-25T13:45:03Z")

</div>

Hello, on my machine I am observing the following behavior when running julia 1.6 and using DifferentialEquations.jl to solve a PDE. Basically I wrote a function f!(du,u,p,t) that uses the macro Threads.@threads insid…

---

## [Reusing temporary variables (ed: Object Pools)](https://discourse.julialang.org/t/reusing-temporary-variables-ed-object-pools/61726)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 16\
**Last updated:** [May 25, 2021, 1:18pm UTC](https://discourse.julialang.org/t/reusing-temporary-variables-ed-object-pools/61726 "2021-05-25T13:18:56Z")

</div>

In most of my producton codes I am very cautious about making performance critical parts non-allocating and passing in temporary variables (e.g. large arrays, NamedTuples of arrays, etc). This results in code of the form …

---

## [Trying to CVODE\_BDF with complex-valued ODE (?)](https://discourse.julialang.org/t/trying-to-cvode-bdf-with-complex-valued-ode/61710)

<div class="topic-metadata">

**Author:** [@Caique\_Rodrigues](https://discourse.julialang.org/u/Caique_Rodrigues)\
**Replies:** 8\
**Last updated:** [May 25, 2021, 11:54am UTC](https://discourse.julialang.org/t/trying-to-cvode-bdf-with-complex-valued-ode/61710 "2021-05-25T11:54:47Z")

</div>

Most of the systems that I solve have complex-valued functions and, until now, I always separate the real and imaginary part of each equation to solve them in the real domain, i.e., going from a single complex equation t…

---

## [I still can't use Julia 1.6.x](https://discourse.julialang.org/t/i-still-cant-use-julia-1-6-x/61345)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 28\
**Last updated:** [May 25, 2021, 11:06am UTC](https://discourse.julialang.org/t/i-still-cant-use-julia-1-6-x/61345 "2021-05-25T11:06:56Z")

</div>

Julia 1.6 corporate firewall Any news to solve this problem?

---

## [Saving sparse matrix](https://discourse.julialang.org/t/saving-sparse-matrix/28089)

<div class="topic-metadata">

**Author:** [@saeed](https://discourse.julialang.org/u/saeed)\
**Replies:** 6\
**Last updated:** [May 25, 2021, 9:27am UTC](https://discourse.julialang.org/t/saving-sparse-matrix/28089 "2021-05-25T09:27:32Z")

</div>

How to save a sparse matrix in Julia? I want the saved file to be small since my Matrix size is about (2^26,2^26). Thanks.

---

## [Avoiding temporaries in hvcat with scalar functions](https://discourse.julialang.org/t/avoiding-temporaries-in-hvcat-with-scalar-functions/61759)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 0\
**Last updated:** [May 25, 2021, 7:31am UTC](https://discourse.julialang.org/t/avoiding-temporaries-in-hvcat-with-scalar-functions/61759 "2021-05-25T07:31:17Z")

</div>

Many times I need to build matrices by hvcating combinations of other matrices, for example M = \[ω\*I-A -D; -D' B-C\] for some general matrices A, B, C, D. Let’s assume they are dense (i.e. of type Matrix), but quite lar…

---

## [Adding vs multiplying matrices with DistributedArrays](https://discourse.julialang.org/t/adding-vs-multiplying-matrices-with-distributedarrays/61698)

<div class="topic-metadata">

**Author:** [@Debasish](https://discourse.julialang.org/u/Debasish)\
**Replies:** 7\
**Last updated:** [May 25, 2021, 7:34am UTC](https://discourse.julialang.org/t/adding-vs-multiplying-matrices-with-distributedarrays/61698 "2021-05-25T07:34:16Z")

</div>

Hello everyone, I have a question regarding usage of distributed arrays. In preparation of a bigger calculation, I am doing a simple toy calculation to understand how distributed arrays works. Let me add 4 processors t…

---

## [Promote field of abstract type](https://discourse.julialang.org/t/promote-field-of-abstract-type/61732)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 7\
**Last updated:** [May 25, 2021, 7:10am UTC](https://discourse.julialang.org/t/promote-field-of-abstract-type/61732 "2021-05-25T07:10:22Z")

</div>

I’d like to simplify the following code so that there is only one method for multiplication that applies to all subtypes of AbstractTerm abstract type AbstractTerm{T} end struct ATerm{T} \<: AbstractTerm{T} data::T …

---

## [Importing module in same file](https://discourse.julialang.org/t/importing-module-in-same-file/21724)

<div class="topic-metadata">

**Author:** [@yash](https://discourse.julialang.org/u/yash)\
**Replies:** 9\
**Last updated:** [May 25, 2021, 1:40am UTC](https://discourse.julialang.org/t/importing-module-in-same-file/21724 "2021-05-25T01:40:16Z")

</div>

How can I import a module in another module in same file in julia ??

---

## [\`convert\` vs constructor](https://discourse.julialang.org/t/convert-vs-constructor/61735)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 4\
**Last updated:** [May 24, 2021, 7:28pm UTC](https://discourse.julialang.org/t/convert-vs-constructor/61735 "2021-05-24T19:28:32Z")

</div>

Which is considered better Julia style, this: f(a::T) where{T\<:Number} = T(2) or this: f(a::T) where{T\<:Number} = convert(T,2) Or are they equivalent in practice?

---

## [Difference between function that accepts abstract types and another that uses type parameters](https://discourse.julialang.org/t/difference-between-function-that-accepts-abstract-types-and-another-that-uses-type-parameters/61687)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 4\
**Last updated:** [May 24, 2021, 4:28pm UTC](https://discourse.julialang.org/t/difference-between-function-that-accepts-abstract-types-and-another-that-uses-type-parameters/61687 "2021-05-24T16:28:40Z")

</div>

Consider the following code: function do\_work(first::Number,second::Number) println("Working with $(typeof(first)) and $(typeof(second))") end function do\_work(first::A,second::B) where {A\<:Number, B\<:Number} …

---

## [Package updated but not available (12 hours latter)](https://discourse.julialang.org/t/package-updated-but-not-available-12-hours-latter/61718)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 13\
**Last updated:** [May 24, 2021, 4:20pm UTC](https://discourse.julialang.org/t/package-updated-but-not-available-12-hours-latter/61718 "2021-05-24T16:20:33Z")

</div>

Yesterday I released a new patch version of a package. It is still not available here for update. (@v1.6) pkg\> up ComplexMixtures Updating registry at \`~/.julia/registries/General\` No Changes to \`~/.julia/environm…

---

## [Problems with environment - Tree Hash Mismatch!](https://discourse.julialang.org/t/problems-with-environment-tree-hash-mismatch/60103)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 23\
**Last updated:** [May 24, 2021, 3:44pm UTC](https://discourse.julialang.org/t/problems-with-environment-tree-hash-mismatch/60103 "2021-05-24T15:44:29Z")

</div>

I have a Julia project on my machine, and I then run the project on a different machine (cluster). To do that I copy the relevant files including the Project.toml, manifest.toml files. I included the package JLD2, and r…

---

## [Plot the Theodorus Spiral with Plots](https://discourse.julialang.org/t/plot-the-theodorus-spiral-with-plots/61720)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 2\
**Last updated:** [May 24, 2021, 2:30pm UTC](https://discourse.julialang.org/t/plot-the-theodorus-spiral-with-plots/61720 "2021-05-24T14:30:40Z")

</div>

Tried to reproduce the following code from the link in Julia But I can’t configure the graphics part correctly. I show you where I have been: #https://theredforgepublishinghouse.com/learn-maths-with-the-theodorus-spir…

---

## [Tagbot is not tagging releases automatically](https://discourse.julialang.org/t/tagbot-is-not-tagging-releases-automatically/61712)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [May 24, 2021, 9:49am UTC](https://discourse.julialang.org/t/tagbot-is-not-tagging-releases-automatically/61712 "2021-05-24T09:49:27Z")

</div>

In my package SphericalHarmonics.jl the tagbot has not been tagging releases. My TagBot.yml is name: TagBot on: issue\_comment: types: - created workflow\_dispatch: jobs: TagBot: if: github.event\_name …

---

## [Reading in xlsx with multiple header rows using the XLSX Pkg](https://discourse.julialang.org/t/reading-in-xlsx-with-multiple-header-rows-using-the-xlsx-pkg/61594)

<div class="topic-metadata">

**Author:** [@kbot](https://discourse.julialang.org/u/kbot)\
**Replies:** 2\
**Last updated:** [May 24, 2021, 8:46am UTC](https://discourse.julialang.org/t/reading-in-xlsx-with-multiple-header-rows-using-the-xlsx-pkg/61594 "2021-05-24T08:46:30Z")

</div>

I’m attempting to use API Reference · XLSX.jl to (called from a custom wrapper tool) to read in an excel workbook and create a dataframe. However, the header is split across the top two rows → is there an alternative pa…

---

## [Documentation build workflow can't resolve dependency version while CI workflow can](https://discourse.julialang.org/t/documentation-build-workflow-cant-resolve-dependency-version-while-ci-workflow-can/61684)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [May 24, 2021, 6:45am UTC](https://discourse.julialang.org/t/documentation-build-workflow-cant-resolve-dependency-version-while-ci-workflow-can/61684 "2021-05-24T06:45:53Z")

</div>

I’m facing a somewhat strange issue in a package of mine, where a dependency is correctly found in the CI workflow but the documenter workflow can’t resolve its version. Here is the output from the documenter workflow: …

---

## [Optimization allowed in C++14, not done in Julia, but could it be done?](https://discourse.julialang.org/t/optimization-allowed-in-c-14-not-done-in-julia-but-could-it-be-done/61217)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 7\
**Last updated:** [May 24, 2021, 5:27am UTC](https://discourse.julialang.org/t/optimization-allowed-in-c-14-not-done-in-julia-but-could-it-be-done/61217 "2021-05-24T05:27:56Z")

</div>

I tried something similar to here: julia\> function demo() for i in 0:9 v = \[1, 2, 3\] push!(v, i) println(size(v)) end end demo (generic function with 1 method)…

---

## [Convert type to dictionary](https://discourse.julialang.org/t/convert-type-to-dictionary/6982)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 7\
**Last updated:** [May 24, 2021, 2:11am UTC](https://discourse.julialang.org/t/convert-type-to-dictionary/6982 "2021-05-24T02:11:56Z")

</div>

Is there a way to convert a type into a Dict? Or is there a way to get a list of keys inside a type?

---

## [Plots ColorSchemes issues](https://discourse.julialang.org/t/plots-colorschemes-issues/61670)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 5\
**Last updated:** [May 24, 2021, 2:14am UTC](https://discourse.julialang.org/t/plots-colorschemes-issues/61670 "2021-05-24T02:14:52Z")

</div>

I’m trying to debug a shifty little plotting issue. Plotting gif of examples seems broken · Issue #15 · weymouth/WaterLily.jl · GitHub The root cause seems to be inconsistent behaviour for palette() (but I might be wron…

---

## [Problem generating/hosting documentation on Github](https://discourse.julialang.org/t/problem-generating-hosting-documentation-on-github/39899)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 4\
**Last updated:** [May 21, 2020, 8:54pm UTC](https://discourse.julialang.org/t/problem-generating-hosting-documentation-on-github/39899 "2020-05-21T20:54:50Z")

</div>

I’ve been away from Julia since the 0.3 days but am trying to get back into the flow. The repo I’m having trouble with is CITIfile.jl. This is my first experience with Documenter. I have successfully generated the HTM…

---

## [Creating + viewing a html visualisation](https://discourse.julialang.org/t/creating-viewing-a-html-visualisation/61694)

<div class="topic-metadata">

**Author:** [@baptnz](https://discourse.julialang.org/u/baptnz)\
**Replies:** 0\
**Last updated:** [May 23, 2021, 9:23pm UTC](https://discourse.julialang.org/t/creating-viewing-a-html-visualisation/61694 "2021-05-23T21:23:51Z")

</div>

I’m hoping to display in Juno’s plot panel a three.js widget consisting of a few particles in space, that the user could manipulate in 3D to get a sense of the geometry. I have a working example and can produce the r…

---

## [What the...? eigs GEP eigenvectors no longer mass-normalized?](https://discourse.julialang.org/t/what-the-eigs-gep-eigenvectors-no-longer-mass-normalized/61667)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [May 23, 2021, 5:17pm UTC](https://discourse.julialang.org/t/what-the-eigs-gep-eigenvectors-no-longer-mass-normalized/61667 "2021-05-23T17:17:34Z")

</div>

What the…? eigs GEP eigenvectors no longer mass-normalized? A nasty bit of surprise. Broke a lot of my code.

---

## [Unable to update packages even after fresh installation](https://discourse.julialang.org/t/unable-to-update-packages-even-after-fresh-installation/61659)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 1\
**Last updated:** [May 23, 2021, 2:16am UTC](https://discourse.julialang.org/t/unable-to-update-packages-even-after-fresh-installation/61659 "2021-05-23T02:16:39Z")

</div>

Hi all, I am unable to update packages to new versions on Ubuntu and Mac OS. The problem persists even after reinstalling Julia. However, updating works on Windows 10. Here is an example of the problem: (@v1.6) pkg\> st…

---

## [SimJulia, interrupt() error](https://discourse.julialang.org/t/simjulia-interrupt-error/30571)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 1\
**Last updated:** [May 23, 2021, 1:49am UTC](https://discourse.julialang.org/t/simjulia-interrupt-error/30571 "2021-05-23T01:49:18Z")

</div>

When interrupt one process which have an event with callback function, an error occurs. The small example code is as follows. function my\_callback(ev::AbstractEvent, env::Environment) println("Called back from ", ev) …

---

## [Insert dummy 0 value rows into dataframe](https://discourse.julialang.org/t/insert-dummy-0-value-rows-into-dataframe/61647)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 7\
**Last updated:** [May 23, 2021, 1:41am UTC](https://discourse.julialang.org/t/insert-dummy-0-value-rows-into-dataframe/61647 "2021-05-23T01:41:37Z")

</div>

Hello All, I’m trying to figure out a quick way to insert dummy rows with 0 values if they are missing for a set of index fields For example, let’s say I have this dataframe: data = DataFrame(:index =\> String\[\], :met…

---

## [Parse structured string to dictionary](https://discourse.julialang.org/t/parse-structured-string-to-dictionary/8126)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 6\
**Last updated:** [May 22, 2021, 7:41pm UTC](https://discourse.julialang.org/t/parse-structured-string-to-dictionary/8126 "2021-05-22T19:41:53Z")

</div>

Let’s say I have a string which has the following template structure: "a\_{a}\_b\_{b}\_c\_{c}.{txt}.{ext}" Example: “a\_3\_b\_4\_c\_5.whatever.jld” My question is how to conveniently generate such string from given (string) va…

---

## [Pythontex and Julia](https://discourse.julialang.org/t/pythontex-and-julia/2867)

<div class="topic-metadata">

**Author:** [@mykelk](https://discourse.julialang.org/u/mykelk)\
**Replies:** 6\
**Last updated:** [May 22, 2021, 5:07pm UTC](https://discourse.julialang.org/t/pythontex-and-julia/2867 "2021-05-22T17:07:38Z")

</div>

Pythontex provides very nice support for typesetting documents with Julia code embedded—however, it does not support the Julia console, like it does for Python. See sec. 3 here for an example. It looks like there are a f…

---

## [Weird @btime results with \`sin\`](https://discourse.julialang.org/t/weird-btime-results-with-sin/61644)

<div class="topic-metadata">

**Author:** [@cryptic.ax](https://discourse.julialang.org/u/cryptic.ax)\
**Replies:** 1\
**Last updated:** [May 22, 2021, 4:23pm UTC](https://discourse.julialang.org/t/weird-btime-results-with-sin/61644 "2021-05-22T16:23:44Z")

</div>

I was profiling timing differences between using sin, sind, and I noticed some interesting results. julia\> using BenchmarkTools julia\> sin(10); julia\> sind(10); julia\> const ° = π/180; julia\> x = 1.234; julia\> @bti…

---

## [Unreachable reached when using Dict for kwargs](https://discourse.julialang.org/t/unreachable-reached-when-using-dict-for-kwargs/61635)

<div class="topic-metadata">

**Author:** [@kimauth](https://discourse.julialang.org/u/kimauth)\
**Replies:** 2\
**Last updated:** [May 22, 2021, 3:52pm UTC](https://discourse.julialang.org/t/unreachable-reached-when-using-dict-for-kwargs/61635 "2021-05-22T15:52:48Z")

</div>

I am getting an unreachable reached crash, when I convert a result from NLsolve.jl back to my custum type after calling nlsolve with a Dict containing the keyword arguments. If I give the same keyword arguments to nlsolv…

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

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