# General Usage

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

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

**Page:** 739

---

## [Problem about using DiscreteCallback function in solving ODE problem](https://discourse.julialang.org/t/problem-about-using-discretecallback-function-in-solving-ode-problem/41624)

<div class="topic-metadata">

**Author:** [@XiaodongMa-MRI](https://discourse.julialang.org/u/XiaodongMa-MRI)\
**Replies:** 4\
**Last updated:** [June 17, 2020, 7:54pm UTC](https://discourse.julialang.org/t/problem-about-using-discretecallback-function-in-solving-ode-problem/41624 "2020-06-17T19:54:11Z")

</div>

Hello everyone, I am a PostDoc in Department of Radiology, University of Minnesota. I want to use Julia to solve an ODE problem, where the user-provided parameter p is changed dynamically. I refered to several topics in…

---

## [\`LoadError: value not writable for any mimetypes\` is thrown when plotting from @manipulate in Interact.jl](https://discourse.julialang.org/t/loaderror-value-not-writable-for-any-mimetypes-is-thrown-when-plotting-from-manipulate-in-interact-jl/29476)

<div class="topic-metadata">

**Author:** [@KestutisMa](https://discourse.julialang.org/u/KestutisMa)\
**Replies:** 1\
**Last updated:** [June 17, 2020, 6:47pm UTC](https://discourse.julialang.org/t/loaderror-value-not-writable-for-any-mimetypes-is-thrown-when-plotting-from-manipulate-in-interact-jl/29476 "2020-06-17T18:47:54Z")

</div>

I am using modified @manipulate example from Tutorial · Interact and got LoadError: value not writable for any mimetypes. If I replace line Makie.plot(x,y) with print(y) then code is working. Makie.plot() function is w…

---

## [Why the inner constructor of a template structure returns "too few type parameters" error?](https://discourse.julialang.org/t/why-the-inner-constructor-of-a-template-structure-returns-too-few-type-parameters-error/41441)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 11\
**Last updated:** [June 17, 2020, 6:03pm UTC](https://discourse.julialang.org/t/why-the-inner-constructor-of-a-template-structure-returns-too-few-type-parameters-error/41441 "2020-06-17T18:03:11Z")

</div>

Why the following code: mutable struct Test{T \<:Number} μ::Union{T,Nothing} σ²::Union{T,Nothing} Test(μ=nothing,σ²=nothing) = new(μ,σ²) end returns the error ERROR: syntax: too few type parameters specified…

---

## [Annotating functions for analytic performance prediction](https://discourse.julialang.org/t/annotating-functions-for-analytic-performance-prediction/41485)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 6\
**Last updated:** [June 17, 2020, 5:57pm UTC](https://discourse.julialang.org/t/annotating-functions-for-analytic-performance-prediction/41485 "2020-06-17T17:57:14Z")

</div>

I would like to add function meta data and reflection to accomplish the following (I’ll use a simplistic scenario): Say I building a big-data solutions (call it ‘g’) using a library of functions (‘f\_i’) )for performing:…

---

## [How to extract substring of a Julia Dataframe column](https://discourse.julialang.org/t/how-to-extract-substring-of-a-julia-dataframe-column/41610)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 3\
**Last updated:** [June 17, 2020, 5:38pm UTC](https://discourse.julialang.org/t/how-to-extract-substring-of-a-julia-dataframe-column/41610 "2020-06-17T17:38:31Z")

</div>

Hi, I may be overthinking this one, but all I’m trying to do is turn a column into a specific indexed substring of that column. df = DataFrame(number=\[123456,134553\]) df\[:number\] = string.(df\[:number\] All I want to do …

---

## [Shuffling only non-missing values](https://discourse.julialang.org/t/shuffling-only-non-missing-values/41549)

<div class="topic-metadata">

**Author:** [@pdimens](https://discourse.julialang.org/u/pdimens)\
**Replies:** 2\
**Last updated:** [June 17, 2020, 5:25pm UTC](https://discourse.julialang.org/t/shuffling-only-non-missing-values/41549 "2020-06-17T17:25:53Z")

</div>

In trying to implement permutation functions in PopGen.jl, I came across a situation where I will need to shuffle values within some parameters (like genotypes across loci, or across loci across populations), and have to…

---

## [Euclidean distance from one point](https://discourse.julialang.org/t/euclidean-distance-from-one-point/41594)

<div class="topic-metadata">

**Author:** [@Geoffrey](https://discourse.julialang.org/u/Geoffrey)\
**Replies:** 6\
**Last updated:** [June 17, 2020, 3:59pm UTC](https://discourse.julialang.org/t/euclidean-distance-from-one-point/41594 "2020-06-17T15:59:45Z")

</div>

Hi, I’m looking for a way to compute an array representing the radius of the polar or spherical coordinates given the array sizes and a center point. I have this code for now but it’s incredibly slow and I’m looking for …

---

## [Use of "end" in array element selection](https://discourse.julialang.org/t/use-of-end-in-array-element-selection/41598)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [June 17, 2020, 3:27pm UTC](https://discourse.julialang.org/t/use-of-end-in-array-element-selection/41598 "2020-06-17T15:27:36Z")

</div>

The end token means “last element of array”, and it is essentially equivalent to -1 in Python. However, that is not always true. Consider the array: a = collection(1:100) b = view(a, 1:20) c = view(a, 30:end) I get the…

---

## [Persistently dirty registry .... case-insensitive file collision when cloning JuliaRegistries/General from GitHub](https://discourse.julialang.org/t/persistently-dirty-registry-case-insensitive-file-collision-when-cloning-juliaregistries-general-from-github/41577)

<div class="topic-metadata">

**Author:** [@lyonsquark](https://discourse.julialang.org/u/lyonsquark)\
**Replies:** 6\
**Last updated:** [June 17, 2020, 3:26pm UTC](https://discourse.julialang.org/t/persistently-dirty-registry-case-insensitive-file-collision-when-cloning-juliaregistries-general-from-github/41577 "2020-06-17T15:26:41Z")

</div>

Many Pkg commands are giving me Warning: Some registries failed to update: │ — \`~/.julia/registries/General\` — registry dirty and \] update does not work. Looking at my ~/.julia/registries/General, there are files…

---

## [Grouping in Julia plots](https://discourse.julialang.org/t/grouping-in-julia-plots/41596)

<div class="topic-metadata">

**Author:** [@gedankenexperiment](https://discourse.julialang.org/u/gedankenexperiment)\
**Replies:** 7\
**Last updated:** [June 17, 2020, 3:15pm UTC](https://discourse.julialang.org/t/grouping-in-julia-plots/41596 "2020-06-17T15:15:40Z")

</div>

Hi there, Let’s say I have a dataframe I want to plot. I know that I can use the keyword argument group to select a column and to have a grouping for the different cases. But what if I would like to manually group toget…

---

## [BinaryBuilder: enable compilers](https://discourse.julialang.org/t/binarybuilder-enable-compilers/41553)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 5\
**Last updated:** [June 17, 2020, 10:20am UTC](https://discourse.julialang.org/t/binarybuilder-enable-compilers/41553 "2020-06-17T10:20:48Z")

</div>

I’m trying to start using BinaryBuilder but have no success even for the simplest cases. E.g. I download https://github.com/JuliaPackaging/Yggdrasil/blob/master/H/HelloWorldFortran/build\_tarballs.jl and run it as julia b…

---

## [About memory allocation of auxiliary array in successive calls of a function](https://discourse.julialang.org/t/about-memory-allocation-of-auxiliary-array-in-successive-calls-of-a-function/41535)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [June 17, 2020, 8:31am UTC](https://discourse.julialang.org/t/about-memory-allocation-of-auxiliary-array-in-successive-calls-of-a-function/41535 "2020-06-17T08:31:02Z")

</div>

If I call a function that internally requires the allocation of an array for some computation, and afterwards I call this same function with the exact same type of input variables, is the auxiliary array which was alloca…

---

## ['warn not defined'-issue when using Callbacks & Multithreaded Ensemble Simulations with DifferentialEquations.jl](https://discourse.julialang.org/t/warn-not-defined-issue-when-using-callbacks-multithreaded-ensemble-simulations-with-differentialequations-jl/41532)

<div class="topic-metadata">

**Author:** [@luis\_munoz](https://discourse.julialang.org/u/luis_munoz)\
**Replies:** 2\
**Last updated:** [June 17, 2020, 7:06am UTC](https://discourse.julialang.org/t/warn-not-defined-issue-when-using-callbacks-multithreaded-ensemble-simulations-with-differentialequations-jl/41532 "2020-06-17T07:06:03Z")

</div>

Hi, I am trying to use multithreading via EnsembleThreads() within a EnsembleProblem and apply a DiscreteCallback to terminate! the individual simulations under a certain condition. Unfortunately my simulation results i…

---

## [Why selectdim is type instable](https://discourse.julialang.org/t/why-selectdim-is-type-instable/25271)

<div class="topic-metadata">

**Author:** [@shipengcheng1230](https://discourse.julialang.org/u/shipengcheng1230)\
**Replies:** 9\
**Last updated:** [June 16, 2020, 9:54pm UTC](https://discourse.julialang.org/t/why-selectdim-is-type-instable/25271 "2020-06-16T21:54:58Z")

</div>

Hi, I just found that selectdim does not infer the concrete SubArray: julia\> using InteractiveUtils julia\> a = rand(5, 5); julia\> @code\_warntype selectdim(a, 2, 1) Body::SubArray 1 ─ %1 = (Base.arraysize)(A, 1)::Int6…

---

## [Solving Differential Equations in "real time"](https://discourse.julialang.org/t/solving-differential-equations-in-real-time/41546)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 6\
**Last updated:** [June 16, 2020, 9:20pm UTC](https://discourse.julialang.org/t/solving-differential-equations-in-real-time/41546 "2020-06-16T21:20:10Z")

</div>

Hi! Is there a way to use Differential Equations to solve a system in “real time”? I want to solve a dynamic system that will receive data from the Raspberry Pi to update the simulation. Thus, this system must be solved…

---

## [Accelerated gradient descent algorithm](https://discourse.julialang.org/t/accelerated-gradient-descent-algorithm/41551)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 1\
**Last updated:** [June 16, 2020, 8:59pm UTC](https://discourse.julialang.org/t/accelerated-gradient-descent-algorithm/41551 "2020-06-16T20:59:42Z")

</div>

Hello, I am searching for an Example of the accelerated gradient descent Algorithm written in Julia … any recommendation?

---

## [Mechanism for optional interface functions - is this a bad idea?](https://discourse.julialang.org/t/mechanism-for-optional-interface-functions-is-this-a-bad-idea/41466)

<div class="topic-metadata">

**Author:** [@zsunberg](https://discourse.julialang.org/u/zsunberg)\
**Replies:** 2\
**Last updated:** [June 16, 2020, 8:48pm UTC](https://discourse.julialang.org/t/mechanism-for-optional-interface-functions-is-this-a-bad-idea/41466 "2020-06-16T20:48:10Z")

</div>

Hi all, some of us are working on an interface for reinforcement learning https://github.com/JuliaReinforcementLearning/CommonRLInterface.jl. There will be many interface functions that are optional, and perhaps multiple…

---

## [Failure to calculate the gradient of ODE with the RHS as an argument: "LoadError: TypeError: in TrackedReal, in V, expected V\<:Real, got Type{Any}"](https://discourse.julialang.org/t/failure-to-calculate-the-gradient-of-ode-with-the-rhs-as-an-argument-loaderror-typeerror-in-trackedreal-in-v-expected-v-real-got-type-any/41480)

<div class="topic-metadata">

**Author:** [@yanz4](https://discourse.julialang.org/u/yanz4)\
**Replies:** 4\
**Last updated:** [June 16, 2020, 6:16pm UTC](https://discourse.julialang.org/t/failure-to-calculate-the-gradient-of-ode-with-the-rhs-as-an-argument-loaderror-typeerror-in-trackedreal-in-v-expected-v-real-got-type-any/41480 "2020-06-16T18:16:55Z")

</div>

Dear Forum, I am trying to add ODE into machine learning pipeline and calculate the gradient of an ode layer that takes the RHS as an argument. We tried to feed the RHS, in terms of inputFunction(t), into ODE (i.e. fiip…

---

## [What's wrong with the 'while' line which is "missing comma or )"?](https://discourse.julialang.org/t/whats-wrong-with-the-while-line-which-is-missing-comma-or/41537)

<div class="topic-metadata">

**Author:** [@reb](https://discourse.julialang.org/u/reb)\
**Replies:** 1\
**Last updated:** [June 16, 2020, 5:46pm UTC](https://discourse.julialang.org/t/whats-wrong-with-the-while-line-which-is-missing-comma-or/41537 "2020-06-16T17:46:19Z")

</div>

arr = \[“6”,“-”,“2”," “,“6=”,”-“,“3”\] lenarr = 7 println(“arr=”,arr,” lenarr=",lenarr) i = 1 while (((arr\[i\] == " ") or (arr\[i\] == “\\t”)) and (i \< lenarr)) i = i + 1 end firstindex = i

---

## [Plan: when julia base will start to use threads?](https://discourse.julialang.org/t/plan-when-julia-base-will-start-to-use-threads/41507)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 1\
**Last updated:** [June 16, 2020, 4:46pm UTC](https://discourse.julialang.org/t/plan-when-julia-base-will-start-to-use-threads/41507 "2020-06-16T16:46:06Z")

</div>

Hello, I just wonder, if there is a time plan for julia base to use threads to parallelized the computations by default? Right now as I can see, only user defined threads actually can speed up things but not the base-co…

---

## [How to easily rename column of GroupedDataFrame](https://discourse.julialang.org/t/how-to-easily-rename-column-of-groupeddataframe/41505)

<div class="topic-metadata">

**Author:** [@SSU](https://discourse.julialang.org/u/SSU)\
**Replies:** 2\
**Last updated:** [June 16, 2020, 1:58pm UTC](https://discourse.julialang.org/t/how-to-easily-rename-column-of-groupeddataframe/41505 "2020-06-16T13:58:49Z")

</div>

Hi! I want to know how to rename the column of GroupedDataFrame easily. The following code is an example of what I want to do. Note: the real data I want to handle is a huge dataframe(~ 10 millions of rows). Any sugg…

---

## [The usage of \`QMDP\`](https://discourse.julialang.org/t/the-usage-of-qmdp/41518)

<div class="topic-metadata">

**Author:** [@jkwwwwow](https://discourse.julialang.org/u/jkwwwwow)\
**Replies:** 0\
**Last updated:** [June 16, 2020, 1:25pm UTC](https://discourse.julialang.org/t/the-usage-of-qmdp/41518 "2020-06-16T13:25:01Z")

</div>

Hello everyone, I’m not particularly sure if I posted this content in the appropriate section. I am trying to run a program on Github (https://github.com/mexsser/POMDPIDMModel.jl), but when I finish the installation par…

---

## [Error building \`GR\`](https://discourse.julialang.org/t/error-building-gr/41489)

<div class="topic-metadata">

**Author:** [@jkwwwwow](https://discourse.julialang.org/u/jkwwwwow)\
**Replies:** 3\
**Last updated:** [June 16, 2020, 12:29pm UTC](https://discourse.julialang.org/t/error-building-gr/41489 "2020-06-16T12:29:51Z")

</div>

I met a building error when I tried to add a package in here: Error: Error building \`GR\`: │ │ gzip: stdin: unexpected end of file │ tar: 归档文件中异常的 EOF │ tar: 归档文件中异常的 EOF │ tar: Error is not recoverable: exiting now │ …

---

## [Problem Lambdifying atan function](https://discourse.julialang.org/t/problem-lambdifying-atan-function/41501)

<div class="topic-metadata">

**Author:** [@Jake\_Double\_U](https://discourse.julialang.org/u/Jake_Double_U)\
**Replies:** 3\
**Last updated:** [June 16, 2020, 12:20pm UTC](https://discourse.julialang.org/t/problem-lambdifying-atan-function/41501 "2020-06-16T12:20:46Z")

</div>

Hi Folks, Apology if this is not the appropriate location for this post. Also, I am not much of a computer programmer so I also apologize for any incorrect terminology in the following. I have run across a problem tha…

---

## [TensorCast & CUDA](https://discourse.julialang.org/t/tensorcast-cuda/41483)

<div class="topic-metadata">

**Author:** [@bryce](https://discourse.julialang.org/u/bryce)\
**Replies:** 2\
**Last updated:** [June 16, 2020, 12:16pm UTC](https://discourse.julialang.org/t/tensorcast-cuda/41483 "2020-06-16T12:16:35Z")

</div>

I’m having problems using TensorCast on CuArrays. When I run the following with normal arrays, it works fine: using TensorCast C = ones(10,2) L = ones(10,3) @reduce D\[m,a\] := sum(p) C\[p,a\] + L\[p,m\] 3×2 Array{Float64,2}…

---

## [Compatibility problem when installing julia packages](https://discourse.julialang.org/t/compatibility-problem-when-installing-julia-packages/41423)

<div class="topic-metadata">

**Author:** [@jkwwwwow](https://discourse.julialang.org/u/jkwwwwow)\
**Replies:** 5\
**Last updated:** [June 16, 2020, 11:53am UTC](https://discourse.julialang.org/t/compatibility-problem-when-installing-julia-packages/41423 "2020-06-16T11:53:10Z")

</div>

I’m trying to run a Julia program (here), and I get the following error message: julia\> using Pkg julia\> Pkg.add(PackageSpec(url = "https://github.com/mexsser/POMDPIDMModel.jl")) Updating git-repo \`https://github.c…

---

## [Anyway to increase the heatmap "block" height?](https://discourse.julialang.org/t/anyway-to-increase-the-heatmap-block-height/41355)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 2\
**Last updated:** [June 16, 2020, 12:05am UTC](https://discourse.julialang.org/t/anyway-to-increase-the-heatmap-block-height/41355 "2020-06-16T00:05:09Z")

</div>

I am constructing a heatmap heatmap(xvals, yvals, zvals, size=(500,2000) but because the yvals are texts, they seem to overlap and jumble together. See Now increase size=(500, 10000) helps only slightly and seems to…

---

## [Pkg.develop() causing package to downgrade](https://discourse.julialang.org/t/pkg-develop-causing-package-to-downgrade/41484)

<div class="topic-metadata">

**Author:** [@EmadMasroor](https://discourse.julialang.org/u/EmadMasroor)\
**Replies:** 0\
**Last updated:** [June 15, 2020, 11:46pm UTC](https://discourse.julialang.org/t/pkg-develop-causing-package-to-downgrade/41484 "2020-06-15T23:46:28Z")

</div>

I am having trouble using pkg\> develop on a registered Julia package. Here’s the situation: When I enter Pkg mode on the REPL and add ViscousFlow, the correct package at the most recent version gets downloaded from the g…

---

## [Access jth component of stacked 1D array](https://discourse.julialang.org/t/access-jth-component-of-stacked-1d-array/41461)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 6\
**Last updated:** [June 15, 2020, 11:07pm UTC](https://discourse.julialang.org/t/access-jth-component-of-stacked-1d-array/41461 "2020-06-15T23:07:04Z")

</div>

Hello, I would like to access the jth component of stacked 1D arrays, what is the best option? Is it possible to create a view of this subarray? e.g.: Nx = 50 Ne = 20 A = map(i-\>randn(Nx,1:Ne) # Access jth component…

---

## [Bottleneck when receiving UDP packets?](https://discourse.julialang.org/t/bottleneck-when-receiving-udp-packets/41425)

<div class="topic-metadata">

**Author:** [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Replies:** 24\
**Last updated:** [June 15, 2020, 9:17pm UTC](https://discourse.julialang.org/t/bottleneck-when-receiving-udp-packets/41425 "2020-06-15T21:17:57Z")

</div>

I hope some network experts can help me here, this is probably not-so-Julia-related. My problem is that I am unable to receive more than ~600 UDP packets per second (on my MacBook, on my Xeon it’s ~900/s) however, I am …

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

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