# General Usage

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

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

**Page:** 188

---

## [Adding nullclines to a streamplot](https://discourse.julialang.org/t/adding-nullclines-to-a-streamplot/111750)

<div class="topic-metadata">

**Author:** [@Thomas\_Petit](https://discourse.julialang.org/u/Thomas_Petit)\
**Replies:** 4\
**Last updated:** [March 18, 2024, 7:18pm UTC](https://discourse.julialang.org/t/adding-nullclines-to-a-streamplot/111750 "2024-03-18T19:18:02Z")

</div>

Hello there, I’m still extremely new to Julia and I’m currently trying to plot both the flow of an autonomous system of linear ODEs + their corresponding nullclines. The flow itself I’m using - using Makie using CairoM…

---

## [Weird Errors in Julia VS Code](https://discourse.julialang.org/t/weird-errors-in-julia-vs-code/111382)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 2\
**Last updated:** [March 18, 2024, 7:01pm UTC](https://discourse.julialang.org/t/weird-errors-in-julia-vs-code/111382 "2024-03-18T19:01:08Z")

</div>

I started today getting weird errors when I tried to run Julia on my laptop. I re-installed Julia but nothing changed. Do you have any clue why this is happening and how I can fix it? └ ── unknown unicode character ‘\\0…

---

## [Hooking up code to run whenever Revise triggers?](https://discourse.julialang.org/t/hooking-up-code-to-run-whenever-revise-triggers/111787)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 1\
**Last updated:** [March 18, 2024, 6:54pm UTC](https://discourse.julialang.org/t/hooking-up-code-to-run-whenever-revise-triggers/111787 "2024-03-18T18:54:27Z")

</div>

I have a number of caches that store various things to make my code run faster. However, when i am interactively developing and debugging my package I often want to clear those caches because they have cached a result c…

---

## [Schema evolution: Structs considered harmful, in at least some cases? Non-semver version numbers as an example](https://discourse.julialang.org/t/schema-evolution-structs-considered-harmful-in-at-least-some-cases-non-semver-version-numbers-as-an-example/111595)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 6\
**Last updated:** [March 18, 2024, 6:24pm UTC](https://discourse.julialang.org/t/schema-evolution-structs-considered-harmful-in-at-least-some-cases-non-semver-version-numbers-as-an-example/111595 "2024-03-18T18:24:26Z")

</div>

I proposed allowing non-semver, as an option, or at least for debate: It got me thinking how would you implement this (and keep “full” compatibility), and I have a dilemma. julia\> v"∞" # rarely used option... not eve…

---

## [Documenter.jl failing to push -- I'm a bit lost](https://discourse.julialang.org/t/documenter-jl-failing-to-push-im-a-bit-lost/111777)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 4\
**Last updated:** [March 18, 2024, 5:30pm UTC](https://discourse.julialang.org/t/documenter-jl-failing-to-push-im-a-bit-lost/111777 "2024-03-18T17:30:01Z")

</div>

Hey, A friend of mine started out on a package without asking PkgTemplate to produce online documentation (there were no CI at all on the whole package). I tried to port some of it from other packages that I have but I …

---

## [JuliaFormatter for imports / using](https://discourse.julialang.org/t/juliaformatter-for-imports-using/111704)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 3\
**Last updated:** [March 18, 2024, 4:57pm UTC](https://discourse.julialang.org/t/juliaformatter-for-imports-using/111704 "2024-03-18T16:57:43Z")

</div>

I like writing my imports / using statements in the following style: import CairoMakie import CSV import HDF5 import KernelDensity import Makie import StatsBase using DataFrames: DataFrame using Distributions: Gamma usi…

---

## [Threading behavior on multiple-cpu systems](https://discourse.julialang.org/t/threading-behavior-on-multiple-cpu-systems/111780)

<div class="topic-metadata">

**Author:** [@astro-kevin](https://discourse.julialang.org/u/astro-kevin)\
**Replies:** 1\
**Last updated:** [March 18, 2024, 4:53pm UTC](https://discourse.julialang.org/t/threading-behavior-on-multiple-cpu-systems/111780 "2024-03-18T16:53:09Z")

</div>

I have written some code which runs faster on a system with 2x16 core intel chip than a system with a 4x16 core AMD cpu. The AMD cpu is of a slightly slower clockspeed, and I have ensured my Threading.@threads loop has m…

---

## [Question: using imdecode in OpenCV.jl](https://discourse.julialang.org/t/question-using-imdecode-in-opencv-jl/111779)

<div class="topic-metadata">

**Author:** [@Dhom\_Bios](https://discourse.julialang.org/u/Dhom_Bios)\
**Replies:** 0\
**Last updated:** [March 18, 2024, 4:18pm UTC](https://discourse.julialang.org/t/question-using-imdecode-in-opencv-jl/111779 "2024-03-18T16:18:48Z")

</div>

Hi everyone! I’m new to Julia and I’m trying to port an opencv script made in python to Julia. Since I haven’t seen an specific subforum dedicated to computer vision, I’m posting this question to general usage. The scr…

---

## [Benchmarking surprises with type assertions](https://discourse.julialang.org/t/benchmarking-surprises-with-type-assertions/111660)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 10\
**Last updated:** [March 18, 2024, 1:48pm UTC](https://discourse.julialang.org/t/benchmarking-surprises-with-type-assertions/111660 "2024-03-18T13:48:23Z")

</div>

While looking at another post I got surprised by the following differences when using type assertions: using Chairmarks tup = (10, 100im, 1.0, 2//3, 3.0im, 2//3+im) idx = 5 type = typeof(tup\[idx\]) function test1(tup, …

---

## [Deep Learning VScode Windows](https://discourse.julialang.org/t/deep-learning-vscode-windows/111747)

<div class="topic-metadata">

**Author:** [@jared\_rl](https://discourse.julialang.org/u/jared_rl)\
**Replies:** 0\
**Last updated:** [March 18, 2024, 4:27am UTC](https://discourse.julialang.org/t/deep-learning-vscode-windows/111747 "2024-03-18T04:27:27Z")

</div>

Hello! I have been doing some deep reinforcement learning experiments with reinforcementlearning.jl and flux.jl in VScode windows. I have noticed that the first experiment i run after opening Vscode or after restarting …

---

## [Simple example of calling Rust from Julia](https://discourse.julialang.org/t/simple-example-of-calling-rust-from-julia/111742)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [March 18, 2024, 3:31am UTC](https://discourse.julialang.org/t/simple-example-of-calling-rust-from-julia/111742 "2024-03-18T03:31:57Z")

</div>

Introduction I was asked for a simple example about how to call Rust from Julia on Slack. I thought I would post it here for posterity. Just to emphasize, my goal here is simplicity. For practical use, you would probabl…

---

## [Correct use of promotion and conversion](https://discourse.julialang.org/t/correct-use-of-promotion-and-conversion/111739)

<div class="topic-metadata">

**Author:** [@mdsalerno](https://discourse.julialang.org/u/mdsalerno)\
**Replies:** 1\
**Last updated:** [March 18, 2024, 1:07am UTC](https://discourse.julialang.org/t/correct-use-of-promotion-and-conversion/111739 "2024-03-18T01:07:36Z")

</div>

I defined the following: import Base: promote\_rule struct RationalNumber{T\<:Integer} \<: Real num::T den::T end #RationalNumber{T}(x::S) where {T\<:Integer, S\<:Integer} = RationalNumber(x, 1) RationalNumber(n:…

---

## [Allocations when writing to vectors in struct](https://discourse.julialang.org/t/allocations-when-writing-to-vectors-in-struct/111681)

<div class="topic-metadata">

**Author:** [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Replies:** 4\
**Last updated:** [March 17, 2024, 4:07pm UTC](https://discourse.julialang.org/t/allocations-when-writing-to-vectors-in-struct/111681 "2024-03-17T16:07:08Z")

</div>

I am parsing some data from file where one signal is composed or couple UInt8 glued together. I want to separate them into individual signals, so I did the following: mutable struct Status one::Vector{\<:Integer} …

---

## [Abstract - Programming Parallel Computers with Julia](https://discourse.julialang.org/t/abstract-programming-parallel-computers-with-julia/111326)

<div class="topic-metadata">

**Author:** [@benslinux](https://discourse.julialang.org/u/benslinux)\
**Replies:** 1\
**Last updated:** [March 17, 2024, 4:04pm UTC](https://discourse.julialang.org/t/abstract-programming-parallel-computers-with-julia/111326 "2024-03-17T16:04:28Z")

</div>

Came upon this abstract while investigating whether the Julia language had ever been applied in attempting to solve the ‘Three Body Problem’ - though this paper doesn’t address that, it’s interesting in that it really pu…

---

## [Splatting, tuples, vectors](https://discourse.julialang.org/t/splatting-tuples-vectors/111721)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [March 17, 2024, 9:30am UTC](https://discourse.julialang.org/t/splatting-tuples-vectors/111721 "2024-03-17T09:30:08Z")

</div>

I have the following MWE: struct PlotX X Y end function test(X, Y...) len=length(Y) println(len) println(typeof(Y)) PlotX(X, Y) end T = 0:0.1:2pi X = sin.(T) Y = cos.(T) p1 = test(T, X, Y); p2 …

---

## [How to get a tuple's field using a runtime index in a type stable way?](https://discourse.julialang.org/t/how-to-get-a-tuples-field-using-a-runtime-index-in-a-type-stable-way/111629)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 24\
**Last updated:** [March 16, 2024, 9:59pm UTC](https://discourse.julialang.org/t/how-to-get-a-tuples-field-using-a-runtime-index-in-a-type-stable-way/111629 "2024-03-16T21:59:14Z")

</div>

Suppose I have a tuple, which contains some data. I want to get one of the fields of the tuple, with an index at runtime, but I know the type of the field the index points to. Is there a way to do this? My best attempt …

---

## [Why aren't the permutations from sortslices() available?](https://discourse.julialang.org/t/why-arent-the-permutations-from-sortslices-available/99029)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 1\
**Last updated:** [March 16, 2024, 6:30pm UTC](https://discourse.julialang.org/t/why-arent-the-permutations-from-sortslices-available/99029 "2024-03-16T18:30:05Z")

</div>

I’m writing some data comparison code and it would be helpful if Julia had a sortslicesperm() similar to sortperm() so that a matrix could be sorted (like a vector) by M = rand(0:2, 16, 4); p = sortslicesperm(M, dims=1)…

---

## [Is there a better way to format each individual columns in a dataframe?](https://discourse.julialang.org/t/is-there-a-better-way-to-format-each-individual-columns-in-a-dataframe/111677)

<div class="topic-metadata">

**Author:** [@Philip\_Stuckey](https://discourse.julialang.org/u/Philip_Stuckey)\
**Replies:** 6\
**Last updated:** [March 16, 2024, 5:48pm UTC](https://discourse.julialang.org/t/is-there-a-better-way-to-format-each-individual-columns-in-a-dataframe/111677 "2024-03-16T17:48:20Z")

</div>

I wrote a function to format individual columns of a dataframe and I’m wondering if that’s a good idea or not. Is there a better way to format the columns of a dataframe before printing to markdown? I found the formatte…

---

## [Discussion about DateTime from POSIX timestamp. Was (incorrect assumption): Dates in Windows - error in datetime from posix](https://discourse.julialang.org/t/discussion-about-datetime-from-posix-timestamp-was-incorrect-assumption-dates-in-windows-error-in-datetime-from-posix/111691)

<div class="topic-metadata">

**Author:** [@kodintent](https://discourse.julialang.org/u/kodintent)\
**Replies:** 9\
**Last updated:** [March 16, 2024, 5:21pm UTC](https://discourse.julialang.org/t/discussion-about-datetime-from-posix-timestamp-was-incorrect-assumption-dates-in-windows-error-in-datetime-from-posix/111691 "2024-03-16T17:21:51Z")

</div>

Hi. I didnt copy old known-working code, i did something else. here is how to get the correct value, provided by an answer below. datetime\_utc\_from\_posix = unix2datetime(posix\_int) \[ below is NOT how to get the corre…

---

## [@var\_str fails on an example in its documentation](https://discourse.julialang.org/t/var-str-fails-on-an-example-in-its-documentation/111697)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 2\
**Last updated:** [March 16, 2024, 3:13pm UTC](https://discourse.julialang.org/t/var-str-fails-on-an-example-in-its-documentation/111697 "2024-03-16T15:13:52Z")

</div>

julia\> versioninfo() Julia Version 1.11.0-alpha1 Commit 671de9f5793 (2024-03-01 08:30 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: macOS (arm64-apple-darwin22.4.0) CPU: 8 × Apple M1 P…

---

## [How to embed multithreaded Julia in a graphical macOS app](https://discourse.julialang.org/t/how-to-embed-multithreaded-julia-in-a-graphical-macos-app/111637)

<div class="topic-metadata">

**Author:** [@droodman](https://discourse.julialang.org/u/droodman)\
**Replies:** 14\
**Last updated:** [March 16, 2024, 1:52pm UTC](https://discourse.julialang.org/t/how-to-embed-multithreaded-julia-in-a-graphical-macos-app/111637 "2024-03-16T13:52:53Z")

</div>

I wrote a C++ plugin for the statistical software Stata to give it access to Julia. Stata is a GUI program, so in macOS, it is normally not launched from a shell. The problem I have is giving the user the option to launc…

---

## [PGFPlotsX debugging: where is the tex file?](https://discourse.julialang.org/t/pgfplotsx-debugging-where-is-the-tex-file/111683)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [March 16, 2024, 10:10am UTC](https://discourse.julialang.org/t/pgfplotsx-debugging-where-is-the-tex-file/111683 "2024-03-16T10:10:23Z")

</div>

I’m trying to debug this error: Package pgfkeys Error: Choice ‘outer north west’ unknown in choice key ‘/pgfp lots/legend pos’. I am going to ignore this key. I’m not able to find the temporary file with the tex code. …

---

## [Pythonplot, set 2 plots with same color](https://discourse.julialang.org/t/pythonplot-set-2-plots-with-same-color/111692)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 1\
**Last updated:** [March 16, 2024, 9:36am UTC](https://discourse.julialang.org/t/pythonplot-set-2-plots-with-same-color/111692 "2024-03-16T09:36:24Z")

</div>

This little program: using PythonPlot x = \[1,2\] y = \[2,3\] fig1 = pyplot.figure() ax1 = fig1.add\_subplot(1, 1, 1) ax1.plot(x,y, '.', markersize=10) ax1.plot(x,y,'-') gives : I want to use what I would have done in…

---

## [How to define the DAE using du\[\] style](https://discourse.julialang.org/t/how-to-define-the-dae-using-du-style/111392)

<div class="topic-metadata">

**Author:** [@whucsu](https://discourse.julialang.org/u/whucsu)\
**Replies:** 6\
**Last updated:** [March 16, 2024, 12:58am UTC](https://discourse.julialang.org/t/how-to-define-the-dae-using-du-style/111392 "2024-03-16T00:58:03Z")

</div>

here is another windkessel model in the simulation, from “The differential-algebraic Windkessel model with power as input” by Henry Pigot. I don’t know to define the DAE using Julia common package like DifferentialEqu…

---

## [SimpleITK via PythonCall not loading NumPy](https://discourse.julialang.org/t/simpleitk-via-pythoncall-not-loading-numpy/104034)

<div class="topic-metadata">

**Author:** [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Replies:** 10\
**Last updated:** [March 15, 2024, 10:32pm UTC](https://discourse.julialang.org/t/simpleitk-via-pythoncall-not-loading-numpy/104034 "2024-03-15T22:32:01Z")

</div>

I am trying to use SimpleITK via PythonCall inside a Pluto notebook. I want to load a DICOM image and then convert it to a numpy array. The code to do this is straightforward and works in pure python, but with PythonCall…

---

## [Rotating the axis label in GR makes the label go out of the plot](https://discourse.julialang.org/t/rotating-the-axis-label-in-gr-makes-the-label-go-out-of-the-plot/111672)

<div class="topic-metadata">

**Author:** [@archisman](https://discourse.julialang.org/u/archisman)\
**Replies:** 1\
**Last updated:** [March 15, 2024, 8:41pm UTC](https://discourse.julialang.org/t/rotating-the-axis-label-in-gr-makes-the-label-go-out-of-the-plot/111672 "2024-03-15T20:41:45Z")

</div>

Here is my code using Plots using LaTeXStrings a = randn(100,1); b = sin.(a); scatter(a,b,xlabel=L"x",ylabel=L"\\sin(x)", framestyle = :box, legend=false, yguidefontrotation = -90 ) The label “s…

---

## [Fastest way of getting a long zero vector?](https://discourse.julialang.org/t/fastest-way-of-getting-a-long-zero-vector/111628)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 29\
**Last updated:** [March 15, 2024, 6:55pm UTC](https://discourse.julialang.org/t/fastest-way-of-getting-a-long-zero-vector/111628 "2024-03-15T18:55:48Z")

</div>

I have these three ways of creating a zero vector. module m function zeroout(a) @inbounds Threads.@threads for k in eachindex(a) a\[k\] = 0.0 end end N = 1000000000 println("a = fill(0.0, N);") @time a =…

---

## [Package SIIPExamples not found](https://discourse.julialang.org/t/package-siipexamples-not-found/111675)

<div class="topic-metadata">

**Author:** [@Igor](https://discourse.julialang.org/u/Igor)\
**Replies:** 0\
**Last updated:** [March 15, 2024, 6:30pm UTC](https://discourse.julialang.org/t/package-siipexamples-not-found/111675 "2024-03-15T18:30:41Z")

</div>

Package Package SIIPExamples not found not found using Package SIIPExamples not found Error Resolving package versions… ERROR: Unsatisfiable requirements detected for package PowerSystems \[bcd98974\]: PowerSystems …

---

## [Stipple.select label](https://discourse.julialang.org/t/stipple-select-label/111674)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 0\
**Last updated:** [March 15, 2024, 6:08pm UTC](https://discourse.julialang.org/t/stipple-select-label/111674 "2024-03-15T18:08:29Z")

</div>

Stipple.select(:dataset; options=:datanames, class="text-p", style="font-size: 11px;", color="white", bgcolor="bg-grey-8", popupcontentclass="bg-grey-9", label="Dataset:", labelcolor="orange") How can I change the font …

---

## [Flush stdout from workers](https://discourse.julialang.org/t/flush-stdout-from-workers/111669)

<div class="topic-metadata">

**Author:** [@AAL](https://discourse.julialang.org/u/AAL)\
**Replies:** 0\
**Last updated:** [March 15, 2024, 4:38pm UTC](https://discourse.julialang.org/t/flush-stdout-from-workers/111669 "2024-03-15T16:38:48Z")

</div>

I am running simulations in parallel processes that take many hours to run, so I print the number of replications to keep track of the progress. Here is a MWE: # test.jl using Distributed addprocs(2) @everywhere functi…

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

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