# General Usage

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

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

**Page:** 691

---

## [Struggling to express iterator that returns an index](https://discourse.julialang.org/t/struggling-to-express-iterator-that-returns-an-index/48378)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 2\
**Last updated:** [October 14, 2020, 6:10pm UTC](https://discourse.julialang.org/t/struggling-to-express-iterator-that-returns-an-index/48378 "2020-10-14T18:10:09Z")

</div>

This is a follow-on to another post–\> with a more specific question. for the array big = hcat(rand(1:4,2\_000\_000), rand(1:5, 2\_000\_000)) I want to get the index for a filter on the first column in order to index the val…

---

## [Procedures for package renaming, deletion and deprecation](https://discourse.julialang.org/t/procedures-for-package-renaming-deletion-and-deprecation/48108)

<div class="topic-metadata">

**Author:** [@citkane](https://discourse.julialang.org/u/citkane)\
**Replies:** 15\
**Last updated:** [October 14, 2020, 5:21pm UTC](https://discourse.julialang.org/t/procedures-for-package-renaming-deletion-and-deprecation/48108 "2020-10-14T17:21:00Z")

</div>

I want to highlight a recent experience regarding this subject and offer some criticism and suggestions in the spirit of improving the Julia ecosystem. A few days ago I registered a new websocket (generic tech term) lib…

---

## [Unitful: convert frequency to wavenumber](https://discourse.julialang.org/t/unitful-convert-frequency-to-wavenumber/48312)

<div class="topic-metadata">

**Author:** [@asubedi](https://discourse.julialang.org/u/asubedi)\
**Replies:** 3\
**Last updated:** [October 14, 2020, 2:22pm UTC](https://discourse.julialang.org/t/unitful-convert-frequency-to-wavenumber/48312 "2020-10-14T14:22:08Z")

</div>

I am trying to convert frequency in THz to wavenumber in cm^-1 by doing uconvert(1THz / c0, 1.0u"cm^-1"). But I get the following error: ERROR: MethodError: no method matching uconvert(::Quantity{Float64,𝐋⁻¹,Unitful.Fr…

---

## [Organizing local Julia code into modules and/or packages](https://discourse.julialang.org/t/organizing-local-julia-code-into-modules-and-or-packages/48350)

<div class="topic-metadata">

**Author:** [@Niclas\_Wiberg](https://discourse.julialang.org/u/Niclas_Wiberg)\
**Replies:** 7\
**Last updated:** [October 14, 2020, 11:30am UTC](https://discourse.julialang.org/t/organizing-local-julia-code-into-modules-and-or-packages/48350 "2020-10-14T11:30:13Z")

</div>

I’m trying to understand how to best work with local julia modules. Our project is in C++ but we use Julia for testing, partly because it is convenient to generate and verify the complex input/output data we are dealing…

---

## [Julia 1.4.2 memory cleaning error? Windows?](https://discourse.julialang.org/t/julia-1-4-2-memory-cleaning-error-windows/48347)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 1\
**Last updated:** [October 14, 2020, 11:11am UTC](https://discourse.julialang.org/t/julia-1-4-2-memory-cleaning-error-windows/48347 "2020-10-14T11:11:20Z")

</div>

Hi all, I am using a script in julia 1.4.2 at the moment such as: x=\[1 2 3 4 5\] for i=1:5 func(x\[i\]) end where ‘func’ is a function creating and using a dense large matrix (arrox 12GB) (mutable), which is close to my …

---

## [PlotlyJS vs Plots+plotlyjs()](https://discourse.julialang.org/t/plotlyjs-vs-plots-plotlyjs/46179)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 12\
**Last updated:** [October 14, 2020, 10:45am UTC](https://discourse.julialang.org/t/plotlyjs-vs-plots-plotlyjs/46179 "2020-10-14T10:45:00Z")

</div>

I like the Plots package together with plotlyjs backend for interactivity. But when compare to pure PlotlyJS package I see some drawbacks. Figure from Plots has defined size and in PlotlyJS the size of the figure chang…

---

## [Sortperm issue?](https://discourse.julialang.org/t/sortperm-issue/48351)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 2\
**Last updated:** [October 14, 2020, 9:25am UTC](https://discourse.julialang.org/t/sortperm-issue/48351 "2020-10-14T09:25:04Z")

</div>

I work with Julia 1.5.1 on Linux. I have this array x = \[0.3575631591952295; -1.2891687824408367; -0.5123400980902758; -1.61271953171407; 1.0854706981323956; 0.2748568949784879;…

---

## [Julia has exited. Press Enter to start a new session](https://discourse.julialang.org/t/julia-has-exited-press-enter-to-start-a-new-session/28035)

<div class="topic-metadata">

**Author:** [@LutinRose](https://discourse.julialang.org/u/LutinRose)\
**Replies:** 10\
**Last updated:** [October 14, 2020, 8:45am UTC](https://discourse.julialang.org/t/julia-has-exited-press-enter-to-start-a-new-session/28035 "2020-10-14T08:45:50Z")

</div>

Hello, I installed Julia, Atom and Juno-lab on Windows 10 following the steps on the Juno website. Julia is working but not in Atom. When I try to use Julia in atom in the REPL this is what I got: Press Enter to sta…

---

## [Using Manipulate for ploting](https://discourse.julialang.org/t/using-manipulate-for-ploting/48305)

<div class="topic-metadata">

**Author:** [@Kantvishu](https://discourse.julialang.org/u/Kantvishu)\
**Replies:** 3\
**Last updated:** [October 13, 2020, 7:15pm UTC](https://discourse.julialang.org/t/using-manipulate-for-ploting/48305 "2020-10-13T19:15:44Z")

</div>

Hello Everyone, I am trying to use interactive plotting using manipulate function (Pkg-Ineract) on Juno-Atom. I am unable to plot x-axis in dynamic plot using @manipulate function. I am pasting my static plot and dynami…

---

## [Nanosecond epoch time - POSIXClock.jl refresh](https://discourse.julialang.org/t/nanosecond-epoch-time-posixclock-jl-refresh/48321)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [October 13, 2020, 10:15pm UTC](https://discourse.julialang.org/t/nanosecond-epoch-time-posixclock-jl-refresh/48321 "2020-10-13T22:15:51Z")

</div>

These are just notes on updating from a conversation on Slack: const librt = Sys.isunix() ? Libdl.find\_library(\["librt.so"\]) : nothing mutable struct Clock{IsUnix} sec::Int nsec::Int end function Clock() …

---

## [Comparing two Complex Numbers](https://discourse.julialang.org/t/comparing-two-complex-numbers/48176)

<div class="topic-metadata">

**Author:** [@vaeli](https://discourse.julialang.org/u/vaeli)\
**Replies:** 12\
**Last updated:** [October 13, 2020, 5:31pm UTC](https://discourse.julialang.org/t/comparing-two-complex-numbers/48176 "2020-10-13T17:31:19Z")

</div>

Hello! How does Julia compare two complex numbers? Why it isn’t just looking the points and knowing, that if x1 \< x2, y1 \< y2, with the number being not smaller if x1 \> x2 or y1 \> y2. What is the primary reason, why Ju…

---

## [Will Julia support Flang Fortran?](https://discourse.julialang.org/t/will-julia-support-flang-fortran/48293)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [October 13, 2020, 4:07pm UTC](https://discourse.julialang.org/t/will-julia-support-flang-fortran/48293 "2020-10-13T16:07:45Z")

</div>

Just released: https://github.com/flang-compiler/flang/wiki Any comments?

---

## [Best practices for profiling compilation](https://discourse.julialang.org/t/best-practices-for-profiling-compilation/48249)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 5\
**Last updated:** [October 13, 2020, 3:40pm UTC](https://discourse.julialang.org/t/best-practices-for-profiling-compilation/48249 "2020-10-13T15:40:16Z")

</div>

In DataFrames.jl we see a strong trend that people want more and more powerful functions allowing for transformation of data frames (to match dplyr, data.table, pandas, …). This leads to a situation when code base becom…

---

## [Memory allocation when using broadcasting macro @. with long expression?](https://discourse.julialang.org/t/memory-allocation-when-using-broadcasting-macro-with-long-expression/48238)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 6\
**Last updated:** [October 13, 2020, 12:16pm UTC](https://discourse.julialang.org/t/memory-allocation-when-using-broadcasting-macro-with-long-expression/48238 "2020-10-13T12:16:45Z")

</div>

It seems that if the expression is a bit long then @. allocates memory whereas manually using . does not. Why? Here is an expression. No memory allocation if NOT including the last term within the brackets, but allocate…

---

## [Pin all packages of a project](https://discourse.julialang.org/t/pin-all-packages-of-a-project/39308)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 4\
**Last updated:** [October 13, 2020, 11:59am UTC](https://discourse.julialang.org/t/pin-all-packages-of-a-project/39308 "2020-10-13T11:59:11Z")

</div>

Is there a simple way to lock the versions of all the packages of a given project? Something like \]pin X for all (direct and indirect) dependencies of its environment. The Manifest.toml file is a very nice way of ensuri…

---

## [Convert DataFrame timestamp column to Data Type and split Date and Hour](https://discourse.julialang.org/t/convert-dataframe-timestamp-column-to-data-type-and-split-date-and-hour/48270)

<div class="topic-metadata">

**Author:** [@JohnFlorez25](https://discourse.julialang.org/u/JohnFlorez25)\
**Replies:** 1\
**Last updated:** [October 13, 2020, 2:01am UTC](https://discourse.julialang.org/t/convert-dataframe-timestamp-column-to-data-type-and-split-date-and-hour/48270 "2020-10-13T02:01:44Z")

</div>

Hello everybody, I need to Convert DataFrame timestamp column to Data Type and split Date and Hour, I have this column: I try to use the function unix2datetime(x) but I don’t know how we can do with a column in a Dat…

---

## [Bootstrap error when compiling julia master](https://discourse.julialang.org/t/bootstrap-error-when-compiling-julia-master/48258)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 4\
**Last updated:** [October 12, 2020, 10:53pm UTC](https://discourse.julialang.org/t/bootstrap-error-when-compiling-julia-master/48258 "2020-10-12T22:53:01Z")

</div>

I compiled Julia days ago, and now after git checkout master and git pull it doesn’t work. I tried make, then make clean, then make cleanall: combinatorics.jl error during bootstrap: LoadError("sysimg.jl", 3, LoadError…

---

## [Low usage of TypedTables.jl](https://discourse.julialang.org/t/low-usage-of-typedtables-jl/47881)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 16\
**Last updated:** [October 12, 2020, 10:23pm UTC](https://discourse.julialang.org/t/low-usage-of-typedtables-jl/47881 "2020-10-12T22:23:39Z")

</div>

My specific question is whether TypedTables will continue to be maintained and whether it may be a risk to use it for my project or not. This comes at the bottom after explaining the peculiarities of why it seems advant…

---

## [Method dispatch on function types with constructor](https://discourse.julialang.org/t/method-dispatch-on-function-types-with-constructor/48247)

<div class="topic-metadata">

**Author:** [@martenlienen](https://discourse.julialang.org/u/martenlienen)\
**Replies:** 2\
**Last updated:** [October 12, 2020, 6:59pm UTC](https://discourse.julialang.org/t/method-dispatch-on-function-types-with-constructor/48247 "2020-10-12T18:59:57Z")

</div>

I am using Zygote to autodiff some code and Zygote needs me to define an adjoint for some constructor. Following the docs, I went on to define an rrule with ChainRules but now I am stuck because it does not work. The pro…

---

## [LsqFit curve fit does not consider bounds on intercepts correctly](https://discourse.julialang.org/t/lsqfit-curve-fit-does-not-consider-bounds-on-intercepts-correctly/48233)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [October 12, 2020, 6:06pm UTC](https://discourse.julialang.org/t/lsqfit-curve-fit-does-not-consider-bounds-on-intercepts-correctly/48233 "2020-10-12T18:06:51Z")

</div>

I am trying to get some fits with LsqFit with bounds, but I am observing strange results which seem to imply that LsqFit is minimizing the correlation coefficient but not the residue of the fit. This is a minimal example…

---

## [Unstable type with dispatch by Val{:X}() with 5 functions](https://discourse.julialang.org/t/unstable-type-with-dispatch-by-val-x-with-5-functions/48072)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 9\
**Last updated:** [October 12, 2020, 5:19pm UTC](https://discourse.julialang.org/t/unstable-type-with-dispatch-by-val-x-with-5-functions/48072 "2020-10-12T17:19:10Z")

</div>

When i use following code i have no problems with types using LinearAlgebra, BlockDiagonals function f1(x::Vector{T}, ::Int, ::Val{:A}) where T Diagonal(x) end function f1(x::Vector{T}, i::Int, ::Val{:B}) where T …

---

## [Saving plot to html](https://discourse.julialang.org/t/saving-plot-to-html/48029)

<div class="topic-metadata">

**Author:** [@bnase](https://discourse.julialang.org/u/bnase)\
**Replies:** 8\
**Last updated:** [October 12, 2020, 5:14pm UTC](https://discourse.julialang.org/t/saving-plot-to-html/48029 "2020-10-12T17:14:40Z")

</div>

Hello, First time poster, long time lurker! We are using docker and we wait to avoid local X windows installation. Display() tries to use xdb-show, which we cannot have. We want to save the contents of the figure in ht…

---

## [How to debug profiler warning about invalid memory location](https://discourse.julialang.org/t/how-to-debug-profiler-warning-about-invalid-memory-location/40477)

<div class="topic-metadata">

**Author:** [@alemelis](https://discourse.julialang.org/u/alemelis)\
**Replies:** 5\
**Last updated:** [October 12, 2020, 4:08pm UTC](https://discourse.julialang.org/t/how-to-debug-profiler-warning-about-invalid-memory-location/40477 "2020-10-12T16:08:12Z")

</div>

Hello, I was curious about profiling (and learning how to do it) a code I wrote. Reading the official guide (here), I came across the ProfileView.jl package. I simply used the @profview macro provided by the package and…

---

## [Is there a way to reshape a Vector to a row-major AbstractMatrix?](https://discourse.julialang.org/t/is-there-a-way-to-reshape-a-vector-to-a-row-major-abstractmatrix/48214)

<div class="topic-metadata">

**Author:** [@astrojhgu](https://discourse.julialang.org/u/astrojhgu)\
**Replies:** 4\
**Last updated:** [October 12, 2020, 3:13pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-reshape-a-vector-to-a-row-major-abstractmatrix/48214 "2020-10-12T15:13:52Z")

</div>

I have a 1-D vector of size of (nm, 1), i.e., length=nm. I need to reshape it to a n rows m cols matrix, like 1 5 9 2 6 10 3 7 11 4 8 12 , but in memory it is row-majored. So that I can access its rows efficien…

---

## [How can I reset my Julia path in Atom?](https://discourse.julialang.org/t/how-can-i-reset-my-julia-path-in-atom/47818)

<div class="topic-metadata">

**Author:** [@JamesIrvineTrail](https://discourse.julialang.org/u/JamesIrvineTrail)\
**Replies:** 1\
**Last updated:** [October 12, 2020, 3:06pm UTC](https://discourse.julialang.org/t/how-can-i-reset-my-julia-path-in-atom/47818 "2020-10-12T15:06:25Z")

</div>

I upgraded to the latest versions of both Julia and Atom on Windows 10 Pro. I used the Windows uninstaller to uninstall the older versions; after that I deleted the .atom and .julia subfolders in my Users folder to make …

---

## [Get intertermediate results from gradient computation](https://discourse.julialang.org/t/get-intertermediate-results-from-gradient-computation/48226)

<div class="topic-metadata">

**Author:** [@AnnahDo](https://discourse.julialang.org/u/AnnahDo)\
**Replies:** 0\
**Last updated:** [October 12, 2020, 2:08pm UTC](https://discourse.julialang.org/t/get-intertermediate-results-from-gradient-computation/48226 "2020-10-12T14:08:35Z")

</div>

Hi, I am calculating the gradient of a function, but I also want to know some other values that are calculated. So in addition to wanting the loss and the gradient of the loss, I want my function to output more values. …

---

## [How to ship the exact environment together with a julia script](https://discourse.julialang.org/t/how-to-ship-the-exact-environment-together-with-a-julia-script/48199)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 14\
**Last updated:** [October 12, 2020, 12:47pm UTC](https://discourse.julialang.org/t/how-to-ship-the-exact-environment-together-with-a-julia-script/48199 "2020-10-12T12:47:42Z")

</div>

I did come across with the dependency hell for a Pyton script I wrote 4-5 years ago whose output was finally to get published. I need to run however my script under a slightly changed scenario and when I try to blindly …

---

## [Exporting specifically \`..\` from IntervalArithmetic.jl for use in module](https://discourse.julialang.org/t/exporting-specifically-from-intervalarithmetic-jl-for-use-in-module/48217)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 2\
**Last updated:** [October 12, 2020, 12:26pm UTC](https://discourse.julialang.org/t/exporting-specifically-from-intervalarithmetic-jl-for-use-in-module/48217 "2020-10-12T12:26:49Z")

</div>

I would like to specifically load the .. operator from IntervalArithmetic.jl The following don’t work: using IntervalArithmetic:.. using IntervalArithmetic:interval using IntervalArithmetic:@interval How can I load t…

---

## [Groupby, aggregate with unstack on multiple columns](https://discourse.julialang.org/t/groupby-aggregate-with-unstack-on-multiple-columns/48158)

<div class="topic-metadata">

**Author:** [@Clement\_POIRET](https://discourse.julialang.org/u/Clement_POIRET)\
**Replies:** 4\
**Last updated:** [October 12, 2020, 9:12am UTC](https://discourse.julialang.org/t/groupby-aggregate-with-unstack-on-multiple-columns/48158 "2020-10-12T09:12:13Z")

</div>

Hi everyone. I’m working a little project, and I have to translate python code to julia. For a toy example, here is my dataset: https://raw.githubusercontent.com/clementpoiret/Pingouin.jl/master/datasets/rm\_anova2.csv …

---

## [Convolution with a multi-layer kernel](https://discourse.julialang.org/t/convolution-with-a-multi-layer-kernel/48162)

<div class="topic-metadata">

**Author:** [@martenlienen](https://discourse.julialang.org/u/martenlienen)\
**Replies:** 7\
**Last updated:** [October 12, 2020, 8:41am UTC](https://discourse.julialang.org/t/convolution-with-a-multi-layer-kernel/48162 "2020-10-12T08:41:20Z")

</div>

I have a 2D input that I would like to run a convolutional model on. However, instead of using a matrix as a convolution kernel, I would like to use something like Chain(Dense(3^2; 3^2, tanh), ...) as a kernel. Since con…

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

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