# General Usage

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

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

**Page:** 342

---

## [Using DifferentialEquations to solve a gravity problem results in runaway behaviour](https://discourse.julialang.org/t/using-differentialequations-to-solve-a-gravity-problem-results-in-runaway-behaviour/93140)

<div class="topic-metadata">

**Author:** [@srikumarks](https://discourse.julialang.org/u/srikumarks)\
**Replies:** 6\
**Last updated:** [January 18, 2023, 5:16pm UTC](https://discourse.julialang.org/t/using-differentialequations-to-solve-a-gravity-problem-results-in-runaway-behaviour/93140 "2023-01-18T17:16:35Z")

</div>

Hi, As a test and for learning, I’m using DifferentialEquations to solve a simple Newtonian gravity well motion problem. For the given initial conditions, I’m expecting circular motion, but I find that the orbit radius …

---

## [Plotting surface with plots and pyplot](https://discourse.julialang.org/t/plotting-surface-with-plots-and-pyplot/93154)

<div class="topic-metadata">

**Author:** [@neda](https://discourse.julialang.org/u/neda)\
**Replies:** 6\
**Last updated:** [January 18, 2023, 4:18pm UTC](https://discourse.julialang.org/t/plotting-surface-with-plots-and-pyplot/93154 "2023-01-18T16:18:04Z")

</div>

I am trying to plot a 3D object with using Plots or PyPlot with the command surface. When I utilize Plots and surface(x,y,z) where x,y,z are three vectors with the same size, I get the message: \*\*\* IDENTICAL DATA POIN…

---

## [Can the Genie Framework work with Makie and CairoMakie plots?](https://discourse.julialang.org/t/can-the-genie-framework-work-with-makie-and-cairomakie-plots/92609)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 1\
**Last updated:** [January 18, 2023, 3:10pm UTC](https://discourse.julialang.org/t/can-the-genie-framework-work-with-makie-and-cairomakie-plots/92609 "2023-01-18T15:10:30Z")

</div>

I was looking into the Genie framework to build a webapp. It seems like there is some good integration between Genie and Plotly plots. However I was wondering whether Genie can work with Makie and CairoMakie plots. My sp…

---

## [Improving performance of item response model in Turing.jl](https://discourse.julialang.org/t/improving-performance-of-item-response-model-in-turing-jl/86249)

<div class="topic-metadata">

**Author:** [@p-gw](https://discourse.julialang.org/u/p-gw)\
**Replies:** 23\
**Last updated:** [January 18, 2023, 3:06pm UTC](https://discourse.julialang.org/t/improving-performance-of-item-response-model-in-turing-jl/86249 "2023-01-18T15:06:52Z")

</div>

Hi everyone, I am trying to fit an item response model in Turing.jl and have some questions regarding performance. This question is related to Making Turing Fast with large numbers of parameters? and in fact is referenc…

---

## [How can I convert a bitstring to the binary form](https://discourse.julialang.org/t/how-can-i-convert-a-bitstring-to-the-binary-form/93134)

<div class="topic-metadata">

**Author:** [@dmtrung14](https://discourse.julialang.org/u/dmtrung14)\
**Replies:** 6\
**Last updated:** [January 18, 2023, 2:54pm UTC](https://discourse.julialang.org/t/how-can-i-convert-a-bitstring-to-the-binary-form/93134 "2023-01-18T14:54:22Z")

</div>

I am using bitstring to perform an xor operation on the ith bit of a string: string = bitstring(string ⊻ 1 \<\<i) However the result will be a string, so I cannot continue with other i. So I want to know how do I conver…

---

## [VS Code Remote - command 'language-julia.executeJuliaCodeInREPL' not found](https://discourse.julialang.org/t/vs-code-remote-command-language-julia-executejuliacodeinrepl-not-found/93101)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 7\
**Last updated:** [January 18, 2023, 2:37pm UTC](https://discourse.julialang.org/t/vs-code-remote-command-language-julia-executejuliacodeinrepl-not-found/93101 "2023-01-18T14:37:30Z")

</div>

Hi I am trying out VS Code remote via SSH tunnel. I usually run code via CTRL+Enter (runs the line where the cursor is, or the selection). This shortcut works on my local computer in VS code. It also works on the remo…

---

## [Multiple Plots for Parametric Equations](https://discourse.julialang.org/t/multiple-plots-for-parametric-equations/93131)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 7\
**Last updated:** [January 18, 2023, 12:00pm UTC](https://discourse.julialang.org/t/multiple-plots-for-parametric-equations/93131 "2023-01-18T12:00:00Z")

</div>

Hi all, I want to do multiple plots with layout for parametric equations. This is my code: using Plots, LaTeXStrings pyplot() θ1 = 0:0.1:2π x1 = 3 .\*cos.(θ1) y1 = 3 .\*sin.(θ1) x2 = 3 .\*cos.(θ1) y2 = sin.(θ1) θ2 = 0:…

---

## [Help me understand vector initialization](https://discourse.julialang.org/t/help-me-understand-vector-initialization/93129)

<div class="topic-metadata">

**Author:** [@udax](https://discourse.julialang.org/u/udax)\
**Replies:** 7\
**Last updated:** [January 18, 2023, 11:01am UTC](https://discourse.julialang.org/t/help-me-understand-vector-initialization/93129 "2023-01-18T11:01:50Z")

</div>

Here is a MWE of a problem that I am facing. In method 1, the array “arr” gets initialized correctly, but it seems very inelegant. In the second method, the array “brr” often does not get initialized correctly. for k = …

---

## [Not easy to add utility packages to env](https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 22\
**Last updated:** [January 18, 2023, 6:32am UTC](https://discourse.julialang.org/t/not-easy-to-add-utility-packages-to-env/93068 "2023-01-18T06:32:10Z")

</div>

Let’s say I’m trying to edit someone’s package. While debugging my code using the environment provided by the package’s Project.toml, I realize it would be useful to plot something. So I’d like to add Plots.jl. However, …

---

## [Pkg: unable to connect to https://kr.pkg.julialang.org/registries (bad gateway) -- SOLVED](https://discourse.julialang.org/t/pkg-unable-to-connect-to-https-kr-pkg-julialang-org-registries-bad-gateway-solved/93066)

<div class="topic-metadata">

**Author:** [@paulbthub](https://discourse.julialang.org/u/paulbthub)\
**Replies:** 1\
**Last updated:** [January 18, 2023, 12:35am UTC](https://discourse.julialang.org/t/pkg-unable-to-connect-to-https-kr-pkg-julialang-org-registries-bad-gateway-solved/93066 "2023-01-18T00:35:13Z")

</div>

When trying to update in Pkg, I’m seeing: Warning: could not download https://pkg.julialang.org/registries And I’ve also checked and found what I think is the probable cause, which is that https://kr.pkg.julialang.org/…

---

## [Force Revise.jl to Rerun Script](https://discourse.julialang.org/t/force-revise-jl-to-rerun-script/92969)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 7\
**Last updated:** [January 17, 2023, 11:06pm UTC](https://discourse.julialang.org/t/force-revise-jl-to-rerun-script/92969 "2023-01-17T23:06:49Z")

</div>

Example: Contents of script named test.jl: println("Hello") I run the script with includet("test.jl") then change test.jl to be: println("Hello2") When running includet("test.jl"), the “Hello2” does not print. Is t…

---

## [Programmatically restart julia](https://discourse.julialang.org/t/programmatically-restart-julia/73806)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 10\
**Last updated:** [January 17, 2023, 10:50pm UTC](https://discourse.julialang.org/t/programmatically-restart-julia/73806 "2023-01-17T22:50:24Z")

</div>

I am creating a set of independent scripts for illustrating some concepts and I want to be sure that each of them starts “clean”. Performance is not a matter, how can I put something at the beginning of each script to f…

---

## [Function subtypes](https://discourse.julialang.org/t/function-subtypes/92292)

<div class="topic-metadata">

**Author:** [@nchisholm](https://discourse.julialang.org/u/nchisholm)\
**Replies:** 41\
**Last updated:** [January 17, 2023, 8:38pm UTC](https://discourse.julialang.org/t/function-subtypes/92292 "2023-01-17T20:38:08Z")

</div>

According to the somewhat dated discussion in this bug report, the only way to create a function whose supertype is a custom subtype of Function is to create a new singleton type, and then define methods on its sole inst…

---

## [PGFPlotsX.jl boxplot](https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 8:24am UTC](https://discourse.julialang.org/t/pgfplotsx-jl-boxplot/93047 "2023-01-17T08:24:46Z")

</div>

Hi, I was wondering if there is a way to get overlay a line chart on top of a boxplot in PGFPlotsX.jl (something like this). Has anyone tried that before?

---

## [Imaginary unit in Julia Symbolics](https://discourse.julialang.org/t/imaginary-unit-in-julia-symbolics/93078)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 3:39pm UTC](https://discourse.julialang.org/t/imaginary-unit-in-julia-symbolics/93078 "2023-01-17T15:39:05Z")

</div>

Hi, I would like to use Symbolics.jl to make some symbolic algebra on matrices. I have got a problem to express this using Symbolics using Latexify using LinearAlgebra @variables ω A = exp(-1im\*ω) This is the out…

---

## [Double precompilation](https://discourse.julialang.org/t/double-precompilation/93100)

<div class="topic-metadata">

**Author:** [@bernardofpc](https://discourse.julialang.org/u/bernardofpc)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 3:13pm UTC](https://discourse.julialang.org/t/double-precompilation/93100 "2023-01-17T15:13:23Z")

</div>

I just downloaded a Project.toml for a project I’m working on another computer. I went through Pkg.instantiate(), Pkg.precompile() and then started using some packages. To my surprise, JuMP was precompiled again. Is t…

---

## [Outputing/Inputing vectors in DataFrames](https://discourse.julialang.org/t/outputing-inputing-vectors-in-dataframes/93099)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 3:03pm UTC](https://discourse.julialang.org/t/outputing-inputing-vectors-in-dataframes/93099 "2023-01-17T15:03:57Z")

</div>

Hi, After some calculations I define a DataFrame to store my results and output them as a CSV file. The cutoffs columns are vectors. After outputting them as a CSV file I would like to read the file again an access …

---

## [Splatting specific dimension of multidimensional array?](https://discourse.julialang.org/t/splatting-specific-dimension-of-multidimensional-array/93089)

<div class="topic-metadata">

**Author:** [@davidschlegel](https://discourse.julialang.org/u/davidschlegel)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 2:49pm UTC](https://discourse.julialang.org/t/splatting-specific-dimension-of-multidimensional-array/93089 "2023-01-17T14:49:14Z")

</div>

Suppose, I have a multidimensional array. Can I somehow splat over a specific dimension? An example scenario would be the following: arr = randn(2,2,3) kron(arr...) # I would like to splat over the last dimension How…

---

## [Mid points of interval elements in interval vector](https://discourse.julialang.org/t/mid-points-of-interval-elements-in-interval-vector/93090)

<div class="topic-metadata">

**Author:** [@Kanishk](https://discourse.julialang.org/u/Kanishk)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 1:38pm UTC](https://discourse.julialang.org/t/mid-points-of-interval-elements-in-interval-vector/93090 "2023-01-17T13:38:24Z")

</div>

Hello, I have an interval vector containing 10 interval elements (\[0…50\]). Now I want to get a vector containing the midpoints of all the interval elements. How to do it? Thank you

---

## [Type instability issue with parameterizable struct and tuples](https://discourse.julialang.org/t/type-instability-issue-with-parameterizable-struct-and-tuples/93088)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 1:01pm UTC](https://discourse.julialang.org/t/type-instability-issue-with-parameterizable-struct-and-tuples/93088 "2023-01-17T13:01:08Z")

</div>

Here is a MWE: struct Foo{T} buffer::Vector{Complex{T}} end function Foo(T, num\_samples) Foo(Vector{Complex{T}}(undef, num\_samples)) end function foos(T, states, num\_samples) map(y -\> map(x -\> Foo(T, num\_s…

---

## [Package boost\_jll: how to use?](https://discourse.julialang.org/t/package-boost-jll-how-to-use/92998)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 11:31am UTC](https://discourse.julialang.org/t/package-boost-jll-how-to-use/92998 "2023-01-17T11:31:15Z")

</div>

Hi, There is a package called boost\_jll.jl, how can I use it? Is there an example showing how I can use a boost c++ function in another package? Thank you

---

## [Recompilation depends on package include order?](https://discourse.julialang.org/t/recompilation-depends-on-package-include-order/93084)

<div class="topic-metadata">

**Author:** [@msravi](https://discourse.julialang.org/u/msravi)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 11:25am UTC](https://discourse.julialang.org/t/recompilation-depends-on-package-include-order/93084 "2023-01-17T11:25:10Z")

</div>

Hi, I have a situation where I’m seeing different load times of packages depending on the order I include them. If I first include PyCall and then include Dates, the Dates package recompiles. However, if I do it the oth…

---

## [How to broadcast a scalar multiplication through a Mesh?](https://discourse.julialang.org/t/how-to-broadcast-a-scalar-multiplication-through-a-mesh/93038)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 1:07am UTC](https://discourse.julialang.org/t/how-to-broadcast-a-scalar-multiplication-through-a-mesh/93038 "2023-01-17T01:07:18Z")

</div>

I’m trying to port a JavaScript 3D slicer example to Julia. The example loads a 3D model of a bunny (from https://enkimute.github.io/ganja.js/examples/bunny.obj having 5002 triangle faces) and then calculates horizontal …

---

## [How can I limit the number of CPU cores Julia has access to?](https://discourse.julialang.org/t/how-can-i-limit-the-number-of-cpu-cores-julia-has-access-to/93082)

<div class="topic-metadata">

**Author:** [@Ashley](https://discourse.julialang.org/u/Ashley)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 10:57am UTC](https://discourse.julialang.org/t/how-can-i-limit-the-number-of-cpu-cores-julia-has-access-to/93082 "2023-01-17T10:57:01Z")

</div>

I am using a PBS cluster system where I request a number of CPU cores for a job. However, my Julia program seems to use more than what I allocate, causing the job to be killed by the manager! I have tried setting JULIA\_…

---

## [Symbolics with Control Flow](https://discourse.julialang.org/t/symbolics-with-control-flow/93073)

<div class="topic-metadata">

**Author:** [@Daniel\_Lewis](https://discourse.julialang.org/u/Daniel_Lewis)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 9:59am UTC](https://discourse.julialang.org/t/symbolics-with-control-flow/93073 "2023-01-17T09:59:04Z")

</div>

hello, I’m trying to create a function with if condition using a symbolic var: using Symbolics @variables t params = @parameters F function f(t) if 0≤t\<5 return 1 end if 5≤t\<10 return -1 end …

---

## [Help with LLVM error "Bad $ operand number in inline asm string"](https://discourse.julialang.org/t/help-with-llvm-error-bad-operand-number-in-inline-asm-string/93080)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [January 17, 2023, 9:33am UTC](https://discourse.julialang.org/t/help-with-llvm-error-bad-operand-number-in-inline-asm-string/93080 "2023-01-17T09:33:19Z")

</div>

At the end of a long code that I’m running on a cluster, I sometimes find the error LLVM ERROR: Bad $ operand number in inline asm string: 'P$��' \[4047386\] signal (6.-6): Aborted in expression starting at none:0 gsigna…

---

## [Difference b/w @threads and @spawn macros](https://discourse.julialang.org/t/difference-b-w-threads-and-spawn-macros/92984)

<div class="topic-metadata">

**Author:** [@sajjad\_khan](https://discourse.julialang.org/u/sajjad_khan)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 8:28am UTC](https://discourse.julialang.org/t/difference-b-w-threads-and-spawn-macros/92984 "2023-01-17T08:28:11Z")

</div>

What the difference b/w @threads and @spawn? It’s mentioned somewhere that @spawn spawns just one task thread. If so then how it can be different than @threads?

---

## [I want to plot a Sphere with Two Parallel Planes with PlotlyJS in 3D](https://discourse.julialang.org/t/i-want-to-plot-a-sphere-with-two-parallel-planes-with-plotlyjs-in-3d/93070)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [January 17, 2023, 7:48am UTC](https://discourse.julialang.org/t/i-want-to-plot-a-sphere-with-two-parallel-planes-with-plotlyjs-in-3d/93070 "2023-01-17T07:48:27Z")

</div>

Hi all, I want to plot a sphere and two planes that are parallel to each other, here is how it looks like from the slice of the sphere, the circle: I try to read this: this is my code and unable to plot the planes…

---

## [Symbolics and ModelingToolkit](https://discourse.julialang.org/t/symbolics-and-modelingtoolkit/93010)

<div class="topic-metadata">

**Author:** [@Daniel\_Lewis](https://discourse.julialang.org/u/Daniel_Lewis)\
**Replies:** 4\
**Last updated:** [January 17, 2023, 6:59am UTC](https://discourse.julialang.org/t/symbolics-and-modelingtoolkit/93010 "2023-01-17T06:59:13Z")

</div>

hi, i’m trying to simulate a cart pole using the code example taken from this topic. my code looks like this: using Symbolics, Plots, DifferentialEquations, ModelingToolkit n = 2 # number of general coordinates vars…

---

## [Is there a way to remove a certain type from a Union of types?](https://discourse.julialang.org/t/is-there-a-way-to-remove-a-certain-type-from-a-union-of-types/42094)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [January 17, 2023, 6:48am UTC](https://discourse.julialang.org/t/is-there-a-way-to-remove-a-certain-type-from-a-union-of-types/42094 "2023-01-17T06:48:21Z")

</div>

Eg. given Union{Int,Float64,String} I want to obtain Union{Int,Float64} by removing String. Is there a way to carry this out?

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

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