# General Usage

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

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

**Page:** 662

---

## [How to write xs\[i\]..xs\[i+1\] in Julia 1.5 , two dots](https://discourse.julialang.org/t/how-to-write-xs-i-xs-i-1-in-julia-1-5-two-dots/52684)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 7\
**Last updated:** [January 1, 2021, 7:17pm UTC](https://discourse.julialang.org/t/how-to-write-xs-i-xs-i-1-in-julia-1-5-two-dots/52684 "2021-01-01T19:17:25Z")

</div>

how to write in Julai 1.5 xs\[i\]..xs\[i+1\] in Julai 1.5 function make\_intervals(N=10) xs = linspace(0, 2, N+1) return \[xs\[i\]..xs\[i+1\] for i in 1:length(xs)-1\] end Paul

---

## [The @avx and @btime macros: strange interdependency](https://discourse.julialang.org/t/the-avx-and-btime-macros-strange-interdependency/52698)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 4\
**Last updated:** [January 1, 2021, 6:13pm UTC](https://discourse.julialang.org/t/the-avx-and-btime-macros-strange-interdependency/52698 "2021-01-01T18:13:50Z")

</div>

I am a newbie to Julia, and I came up with a script to produce a bifurcation diagram for the logistic map. The logistic map is well known and I will be brief here: x(t+1) = r\*x(t)\*(1-x(t)), 0 ≤ r ≤ 4. For accuracy, I cho…

---

## [Gradient of Gradient in Zygote](https://discourse.julialang.org/t/gradient-of-gradient-in-zygote/52685)

<div class="topic-metadata">

**Author:** [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Replies:** 2\
**Last updated:** [January 1, 2021, 6:00pm UTC](https://discourse.julialang.org/t/gradient-of-gradient-in-zygote/52685 "2021-01-01T18:00:58Z")

</div>

I am trying to find the Hessian of a quadratic form. I know the answer. But if I apply gradient on the gradient, I get an error. Can Zygote do the differentiation only if the output is a scalar? But then how can it work …

---

## [How to change the type of a column of a DataFrame](https://discourse.julialang.org/t/how-to-change-the-type-of-a-column-of-a-dataframe/30074)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 9\
**Last updated:** [January 1, 2021, 1:26pm UTC](https://discourse.julialang.org/t/how-to-change-the-type-of-a-column-of-a-dataframe/30074 "2021-01-01T13:26:16Z")

</div>

I have a DataFrame that has a few columns of the types “Union{Missing, String}” and “Union{Missing, Float64}”. But there are no missing values in the data. I would like to change the type of these columns to either “Str…

---

## [Plotting a grouped bar chart in Gnuplot.jl](https://discourse.julialang.org/t/plotting-a-grouped-bar-chart-in-gnuplot-jl/52671)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [December 31, 2020, 9:37pm UTC](https://discourse.julialang.org/t/plotting-a-grouped-bar-chart-in-gnuplot-jl/52671 "2020-12-31T21:37:49Z")

</div>

pinging @gcalderone I am trying to create a grouped bar chart. Something like Clustered bar plot in gnuplot - Stack Overflow or Gnuplot documentation (bersch.net) but I am not getting anywhere. I have so far @gp "re…

---

## [MultivariateStats - Error in LinearDiscriminant option? Opportunity?](https://discourse.julialang.org/t/multivariatestats-error-in-lineardiscriminant-option-opportunity/52667)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 0\
**Last updated:** [December 31, 2020, 5:50pm UTC](https://discourse.julialang.org/t/multivariatestats-error-in-lineardiscriminant-option-opportunity/52667 "2020-12-31T17:50:19Z")

</div>

The LinearDiscriminant option of MultivariateStats allows input of means and covariance, the latter either common or distinct. In the case of common covariance matrices, the Discriminant is linear. However, if the c…

---

## [How to automatically use packages at startup?](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 16\
**Last updated:** [December 31, 2020, 4:03pm UTC](https://discourse.julialang.org/t/how-to-automatically-use-packages-at-startup/8509 "2020-12-31T16:03:16Z")

</div>

Is it possible to have the REPL automatically call using PackageName at startup? This seems very useful with 0.7 (using LinearAlgebra), etc. I tried to find it the Julia docs, maybe the answer could be added to the FAQ …

---

## [Black scholes pde](https://discourse.julialang.org/t/black-scholes-pde/52336)

<div class="topic-metadata">

**Author:** [@animeshsaxena](https://discourse.julialang.org/u/animeshsaxena)\
**Replies:** 3\
**Last updated:** [December 31, 2020, 3:16pm UTC](https://discourse.julialang.org/t/black-scholes-pde/52336 "2020-12-31T15:16:10Z")

</div>

Hello I am new to julia coming from a python / mathematica background for pde solving. For simple testing I was trying a simpler version of black scholes equation. 0 drift (rates / dividends 0) so it’s just the 2 term …

---

## [Consistency testing when unit-testing is infeasible](https://discourse.julialang.org/t/consistency-testing-when-unit-testing-is-infeasible/52540)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 25\
**Last updated:** [December 31, 2020, 2:40pm UTC](https://discourse.julialang.org/t/consistency-testing-when-unit-testing-is-infeasible/52540 "2020-12-31T14:40:46Z")

</div>

Unit-testing is a great concept. Unfortunately, when you are dealing with complex scientific code, it is usually impossible to formulate the tests since you don’t know exactly what are you going to obtain (with the excep…

---

## [Finding values and deleting rows in a DataFrame](https://discourse.julialang.org/t/finding-values-and-deleting-rows-in-a-dataframe/52653)

<div class="topic-metadata">

**Author:** [@FDon](https://discourse.julialang.org/u/FDon)\
**Replies:** 2\
**Last updated:** [December 31, 2020, 1:45pm UTC](https://discourse.julialang.org/t/finding-values-and-deleting-rows-in-a-dataframe/52653 "2020-12-31T13:45:30Z")

</div>

I’m new to this place, as I am currently taking an introduction course to Julia at university. I am having trouble regarding our take home assignement and hope that you guys can help me out a bit. So here’s the question…

---

## [Flux; \`params\` cannot track any parameters of networks when building networks without \`Chain\`](https://discourse.julialang.org/t/flux-params-cannot-track-any-parameters-of-networks-when-building-networks-without-chain/52257)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 6\
**Last updated:** [December 31, 2020, 12:17pm UTC](https://discourse.julialang.org/t/flux-params-cannot-track-any-parameters-of-networks-when-building-networks-without-chain/52257 "2020-12-31T12:17:36Z")

</div>

For my personal uses, I build a network like the example provided by Flux. However, the resulting function (model) m is not compatible with Flux.params. Here’s reproducible easy example corresponding to my case: julia\>…

---

## [String interpolation in the short-hand call of macro @bash1\_str](https://discourse.julialang.org/t/string-interpolation-in-the-short-hand-call-of-macro-bash1-str/51846)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 2\
**Last updated:** [December 31, 2020, 3:01am UTC](https://discourse.julialang.org/t/string-interpolation-in-the-short-hand-call-of-macro-bash1-str/51846 "2020-12-31T03:01:54Z")

</div>

Hello everyone, I am trying to improve the following macro: macro bash1\_str(s1) s = eval(s1); println(s); open(bash,"w",stdout) do io; print(io, s); end; end ; If I call @bash1\_str "mkdir $FD" The string FD is inter…

---

## [Variational inference for linear regression](https://discourse.julialang.org/t/variational-inference-for-linear-regression/52636)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 0\
**Last updated:** [December 30, 2020, 10:42pm UTC](https://discourse.julialang.org/t/variational-inference-for-linear-regression/52636 "2020-12-30T22:42:38Z")

</div>

This code presents a linear regression with generated data. Using NUTS, the parameter estimates are close to the true parameter values. However, using ADVI, the estimates are far from the true parameter values. Because …

---

## [Registrator's crazy privileges](https://discourse.julialang.org/t/registrators-crazy-privileges/52222)

<div class="topic-metadata">

**Author:** [@FedericoStra](https://discourse.julialang.org/u/FedericoStra)\
**Replies:** 11\
**Last updated:** [December 30, 2020, 6:53pm UTC](https://discourse.julialang.org/t/registrators-crazy-privileges/52222 "2020-12-30T18:53:30Z")

</div>

I was trying to register a package on https://juliahub.com/ui/Registrator but got stuck at a scary banner: We need read/write privileges for your repositories to determine whether you are a contributor of this package. …

---

## [Performance problems when dealing with deliberately type-unstable code. How to use type knowledge better?](https://discourse.julialang.org/t/performance-problems-when-dealing-with-deliberately-type-unstable-code-how-to-use-type-knowledge-better/52535)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 33\
**Last updated:** [December 30, 2020, 1:47pm UTC](https://discourse.julialang.org/t/performance-problems-when-dealing-with-deliberately-type-unstable-code-how-to-use-type-knowledge-better/52535 "2020-12-30T13:47:40Z")

</div>

I have a problem that crops up again and again, which relates to the use of different concrete types in situations where I can’t possibly establish type stability. Here’s a contrived example: There are three different su…

---

## [How to add a development version of an unregistered package](https://discourse.julialang.org/t/how-to-add-a-development-version-of-an-unregistered-package/52611)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 2\
**Last updated:** [December 30, 2020, 1:30pm UTC](https://discourse.julialang.org/t/how-to-add-a-development-version-of-an-unregistered-package/52611 "2020-12-30T13:30:48Z")

</div>

Hello. I know how to add a development version of a registered package add PackageName#dev Also, I know how to add an unregistered package Pkg.add(url="\<git path\>/PackageName.jl") However, I have tried lots of ways…

---

## [DiscriminantAnalysis - old Package?](https://discourse.julialang.org/t/discriminantanalysis-old-package/34496)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 2\
**Last updated:** [December 30, 2020, 12:13pm UTC](https://discourse.julialang.org/t/discriminantanalysis-old-package/34496 "2020-12-30T12:13:28Z")

</div>

I have been trying to get DiscriminantAnalysis to work, and it seems to add OK (with a couple of warnings), but when I try to use it, it falls over: julia\> using DiscriminantAnalysis \[ Info: Precompiling DiscriminantAn…

---

## [Filter array of CartesianIndex based on x-value](https://discourse.julialang.org/t/filter-array-of-cartesianindex-based-on-x-value/52583)

<div class="topic-metadata">

**Author:** [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Replies:** 9\
**Last updated:** [December 30, 2020, 8:35am UTC](https://discourse.julialang.org/t/filter-array-of-cartesianindex-based-on-x-value/52583 "2020-12-30T08:35:35Z")

</div>

I have a vector of Cartesian indexes, for example: temp = \[CartesianIndex(3, 1), CartesianIndex(2, 2), CartesianIndex(6, 3), CartesianIndex(3, 4), CartesianIndex(1, 5), CartesianIndex(5, 6), CartesianIndex(1, 7…

---

## [Val types vs singletons, is one easier for inference / compilation?](https://discourse.julialang.org/t/val-types-vs-singletons-is-one-easier-for-inference-compilation/52599)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 3\
**Last updated:** [December 30, 2020, 5:52am UTC](https://discourse.julialang.org/t/val-types-vs-singletons-is-one-easier-for-inference-compilation/52599 "2020-12-30T05:52:40Z")

</div>

I’ve got some quantity which is inherently a singleton, and a function which returns it as part of a tuple. If I denote the singleton quantity by a type itself, I lose the type information (as expected): struct Singleto…

---

## [Slow Pkg operations (MacOS)](https://discourse.julialang.org/t/slow-pkg-operations-macos/52595)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 0\
**Last updated:** [December 29, 2020, 11:01pm UTC](https://discourse.julialang.org/t/slow-pkg-operations-macos/52595 "2020-12-29T23:01:13Z")

</div>

There have been several discussions about slow package operations on Windows 10. I have a similar problem on MacOS (Big Sur, but also the previous version; Julia 1.5.3). I observe that anti-virus uses a lot of cpu durin…

---

## [Inner parametric type constructor not defined error](https://discourse.julialang.org/t/inner-parametric-type-constructor-not-defined-error/52592)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 1\
**Last updated:** [December 29, 2020, 10:41pm UTC](https://discourse.julialang.org/t/inner-parametric-type-constructor-not-defined-error/52592 "2020-12-29T22:41:50Z")

</div>

I have the following parametric type newInt, which works, but adding an inner constructor that fills in certain fields causes errors: struct newInt{U,V} u::U v::V n::DataType end julia\> newInt(10,"a",String…

---

## [Log-polar transform of an image](https://discourse.julialang.org/t/log-polar-transform-of-an-image/52004)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 9\
**Last updated:** [December 29, 2020, 8:30pm UTC](https://discourse.julialang.org/t/log-polar-transform-of-an-image/52004 "2020-12-29T20:30:31Z")

</div>

Hi, I would like to perform the log-polar transform of an image. I tried. I failed. Maybe this is obvious to some of you… First, I deal with the polar transform. The trouble seems to come from a specific type of images …

---

## ["Pluto" memory usage](https://discourse.julialang.org/t/pluto-memory-usage/52493)

<div class="topic-metadata">

**Author:** [@vshesh](https://discourse.julialang.org/u/vshesh)\
**Replies:** 9\
**Last updated:** [December 29, 2020, 7:59pm UTC](https://discourse.julialang.org/t/pluto-memory-usage/52493 "2020-12-29T19:59:16Z")

</div>

I had a session of pluto open and I was doing some standard machine learning tasks, like: loading a data frame with ~3000 entries doing some clustering training some models evaluating some models making plots to see wh…

---

## [Plots.jl: shared colorbar with subplots?](https://discourse.julialang.org/t/plots-jl-shared-colorbar-with-subplots/47269)

<div class="topic-metadata">

**Author:** [@DanielIngraham](https://discourse.julialang.org/u/DanielIngraham)\
**Replies:** 6\
**Last updated:** [December 29, 2020, 5:19pm UTC](https://discourse.julialang.org/t/plots-jl-shared-colorbar-with-subplots/47269 "2020-12-29T17:19:23Z")

</div>

I’d like to be able to create an array of subplots with a shared colorbar, i.e., just one colorbar for all subplots. Is that possible? using Plots function doit() x1 = range(0.0, 1.0, length=51) y1 = range(-1.0…

---

## [Multiple Dispatch Across Seperate Files](https://discourse.julialang.org/t/multiple-dispatch-across-seperate-files/52480)

<div class="topic-metadata">

**Author:** [@Kieran\_Gill](https://discourse.julialang.org/u/Kieran_Gill)\
**Replies:** 16\
**Last updated:** [December 29, 2020, 4:44pm UTC](https://discourse.julialang.org/t/multiple-dispatch-across-seperate-files/52480 "2020-12-29T16:44:25Z")

</div>

I am attempting to use the same function forward in different contexts. Layers.jl module Layers export Dense, forward struct Dense n\_inputs n\_neurons weights biases function Dense(n\_inputs, n\_neur…

---

## [Appending to an array along dimension n](https://discourse.julialang.org/t/appending-to-an-array-along-dimension-n/52564)

<div class="topic-metadata">

**Author:** [@jakewilliami](https://discourse.julialang.org/u/jakewilliami)\
**Replies:** 2\
**Last updated:** [December 29, 2020, 9:52am UTC](https://discourse.julialang.org/t/appending-to-an-array-along-dimension-n/52564 "2020-12-29T09:52:04Z")

</div>

I am trying to write a function that fills rows along the ith dimension n many times. Let’s call this function fill\_n\_times. If the function takes parameters fill\_n\_times(M, n, fill\_elem; dim = 1) Then my expected ou…

---

## [How to force flux parameters to be within a certain compact set? (projection)](https://discourse.julialang.org/t/how-to-force-flux-parameters-to-be-within-a-certain-compact-set-projection/52561)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 1\
**Last updated:** [December 29, 2020, 9:15am UTC](https://discourse.julialang.org/t/how-to-force-flux-parameters-to-be-within-a-certain-compact-set-projection/52561 "2020-12-29T09:15:40Z")

</div>

Hi, I’m trying to realise projected gradient descent-like methods. As Flux said, I constructed my custom training loop as follows, function train!(m::ICNN, loss, data, opt) ps = Flux.params(ICNN) for d in data …

---

## [ERROR: this intrinsic must be compiled to be called](https://discourse.julialang.org/t/error-this-intrinsic-must-be-compiled-to-be-called/52497)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 9\
**Last updated:** [December 29, 2020, 6:00am UTC](https://discourse.julialang.org/t/error-this-intrinsic-must-be-compiled-to-be-called/52497 "2020-12-29T06:00:01Z")

</div>

Hello, For the past 2 weeks , I have been struggling with a flux model that I wrote. Since I am newbie to flux, zygote, and CuArrays, certainly, I don’t understand what is the actual problem right away. Below, I leave a…

---

## [Why by default two julia process running?](https://discourse.julialang.org/t/why-by-default-two-julia-process-running/52522)

<div class="topic-metadata">

**Author:** [@Ravinder\_Ram](https://discourse.julialang.org/u/Ravinder_Ram)\
**Replies:** 2\
**Last updated:** [December 29, 2020, 3:55am UTC](https://discourse.julialang.org/t/why-by-default-two-julia-process-running/52522 "2020-12-29T03:55:56Z")

</div>

two julia process running

---

## [Question about iterating through a for loop in Julia](https://discourse.julialang.org/t/question-about-iterating-through-a-for-loop-in-julia/52549)

<div class="topic-metadata">

**Author:** [@Brian\_Becsi](https://discourse.julialang.org/u/Brian_Becsi)\
**Replies:** 2\
**Last updated:** [December 29, 2020, 2:39am UTC](https://discourse.julialang.org/t/question-about-iterating-through-a-for-loop-in-julia/52549 "2020-12-29T02:39:25Z")

</div>

Hello. I am new to programming in general. I am translating some Python into Julia. There is a specific problem that’s been dogging me for like a week. I though it had it down but it’s still causing me troubles. When I…

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

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