# General Usage

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

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

**Page:** 609

---

## [Readlines() output format](https://discourse.julialang.org/t/readlines-output-format/59941)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 2\
**Last updated:** [April 24, 2021, 6:16pm UTC](https://discourse.julialang.org/t/readlines-output-format/59941 "2021-04-24T18:16:02Z")

</div>

I have tried to read lines from text file filename.ixc using readlines() function readlines("filename.ixc") and I have got strange output format. In vscode I can see the file content as plaintext, a few lines follow …

---

## [Creating Package Problem with dependencies](https://discourse.julialang.org/t/creating-package-problem-with-dependencies/59897)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 4\
**Last updated:** [April 24, 2021, 12:28pm UTC](https://discourse.julialang.org/t/creating-package-problem-with-dependencies/59897 "2021-04-24T12:28:38Z")

</div>

I am trying to write my code to be in packages, and am having some problems. I have used PkgTemplates to create the package. There seem to be a number of problems that may be related. Which command writes the package …

---

## [IJulia 1.6.1 Kernel not showing up in Jupyter](https://discourse.julialang.org/t/ijulia-1-6-1-kernel-not-showing-up-in-jupyter/59923)

<div class="topic-metadata">

**Author:** [@Rodrigo\_PY](https://discourse.julialang.org/u/Rodrigo_PY)\
**Replies:** 2\
**Last updated:** [April 24, 2021, 8:52am UTC](https://discourse.julialang.org/t/ijulia-1-6-1-kernel-not-showing-up-in-jupyter/59923 "2021-04-24T08:52:39Z")

</div>

I just update to 1.6.1. Added IJulia, but still cant see the 1.6.1 kernel in Jupyter. How can I fix it? Thanks

---

## [Realised covariance estimator](https://discourse.julialang.org/t/realised-covariance-estimator/59918)

<div class="topic-metadata">

**Author:** [@Shahal](https://discourse.julialang.org/u/Shahal)\
**Replies:** 1\
**Last updated:** [April 24, 2021, 8:21am UTC](https://discourse.julialang.org/t/realised-covariance-estimator/59918 "2021-04-24T08:21:59Z")

</div>

Hello, is there a code for the realised covariance estimator, rcov in Julia? I understand it is the simplest form of covariance matrix estimation. I wish to estimate the matrix for 10 assets.

---

## [Avoiding rewriting accessor methods for new composite types with similar fields](https://discourse.julialang.org/t/avoiding-rewriting-accessor-methods-for-new-composite-types-with-similar-fields/59772)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 7\
**Last updated:** [April 24, 2021, 3:14am UTC](https://discourse.julialang.org/t/avoiding-rewriting-accessor-methods-for-new-composite-types-with-similar-fields/59772 "2021-04-24T03:14:25Z")

</div>

I want to get an idea of the best practices for reusing accessor methods on new composite types with similar fields. The biggest tip for method reuse in general seems to be informal interfaces. When types have dissimilar…

---

## [Best way to enforce argument requirements (assert vs. exception, or something else)?](https://discourse.julialang.org/t/best-way-to-enforce-argument-requirements-assert-vs-exception-or-something-else/6293)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 3\
**Last updated:** [April 23, 2021, 11:47pm UTC](https://discourse.julialang.org/t/best-way-to-enforce-argument-requirements-assert-vs-exception-or-something-else/6293 "2021-04-23T23:47:29Z")

</div>

I have a function that expects a positive number as argument, for example: f(x) = sqrt(x) I want to be safe about this, so I want to throw an error if x \< 0. Currently I do an assert: function f(x) @assert x \>= 0 …

---

## [Updating Julia from 1.6 to 1.6.1](https://discourse.julialang.org/t/updating-julia-from-1-6-to-1-6-1/59907)

<div class="topic-metadata">

**Author:** [@Rodrigo\_PY](https://discourse.julialang.org/u/Rodrigo_PY)\
**Replies:** 2\
**Last updated:** [April 23, 2021, 11:44pm UTC](https://discourse.julialang.org/t/updating-julia-from-1-6-to-1-6-1/59907 "2021-04-23T23:44:31Z")

</div>

Hello, How do I update from 1.6 to 1.6.1 without losing all the packages I already have? I am on Linux. Thanks

---

## [Save animation makie](https://discourse.julialang.org/t/save-animation-makie/59879)

<div class="topic-metadata">

**Author:** [@boroboro77](https://discourse.julialang.org/u/boroboro77)\
**Replies:** 5\
**Last updated:** [April 23, 2021, 11:28pm UTC](https://discourse.julialang.org/t/save-animation-makie/59879 "2021-04-23T23:28:02Z")

</div>

I am trying to save an animation using Makie.jl. I have no clue how this should work using the record method. I manage to see the animated output in the popup, but I can nowhere find the output as an “.mp4” with the fil…

---

## [Error building TimeZones on hpc](https://discourse.julialang.org/t/error-building-timezones-on-hpc/59893)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 2\
**Last updated:** [April 23, 2021, 9:43pm UTC](https://discourse.julialang.org/t/error-building-timezones-on-hpc/59893 "2021-04-23T21:43:08Z")

</div>

For some reason this works fine locally, but fails on hpc: (DTMwork) pkg\> build TimeZones Building TimeZones → \`~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/4ba8a9579a243400db412b50300cd61d7447e583/bu…

---

## [Dataframe (or generally pretty table) without header in Pluto](https://discourse.julialang.org/t/dataframe-or-generally-pretty-table-without-header-in-pluto/59880)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 7\
**Last updated:** [April 23, 2021, 5:42pm UTC](https://discourse.julialang.org/t/dataframe-or-generally-pretty-table-without-header-in-pluto/59880 "2021-04-23T17:42:13Z")

</div>

I am creating a certificate in Pluto, and I am currently displaying tables by putting them in a dataframe, which produces: But the headers, which are not necessary, take up a lot of space. While a problem on its own,…

---

## [Pseudo inverse matrix of hessian isn't differentiated](https://discourse.julialang.org/t/pseudo-inverse-matrix-of-hessian-isnt-differentiated/59887)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 0\
**Last updated:** [April 23, 2021, 5:09pm UTC](https://discourse.julialang.org/t/pseudo-inverse-matrix-of-hessian-isnt-differentiated/59887 "2021-04-23T17:09:30Z")

</div>

I want to compute the grad of pinv(hessian) struct hess\_nn model re params # Define inner constructor method function hess\_nn(model; p = nothing) \_p, re = Flux.destructure(model) if …

---

## [Release of docs problem](https://discourse.julialang.org/t/release-of-docs-problem/59871)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [April 23, 2021, 4:19pm UTC](https://discourse.julialang.org/t/release-of-docs-problem/59871 "2021-04-23T16:19:46Z")

</div>

I am having problems (again) with the release of the documentation of a new version of a package. THIS is the package. Yesterday night I registered version 0.11.3 and everything seemed to work smoothly: automatic merge…

---

## [Check that all fields are concrete types?](https://discourse.julialang.org/t/check-that-all-fields-are-concrete-types/10225)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 7\
**Last updated:** [April 23, 2021, 2:25pm UTC](https://discourse.julialang.org/t/check-that-all-fields-are-concrete-types/10225 "2021-04-23T14:25:21Z")

</div>

I’ve discovered that I may have introduced some performance-sapping code into my project because of the following issue. I have two structs A and B like this: struct A field1::Int end struct B …

---

## [ArgParse error “too many arguments”](https://discourse.julialang.org/t/argparse-error-too-many-arguments/59859)

<div class="topic-metadata">

**Author:** [@hei06j](https://discourse.julialang.org/u/hei06j)\
**Replies:** 1\
**Last updated:** [April 23, 2021, 1:37pm UTC](https://discourse.julialang.org/t/argparse-error-too-many-arguments/59859 "2021-04-23T13:37:33Z")

</div>

Hi, I am trying to use ArgParse to read options from command line. It works when I have three options, but when I add another option it throws “too many argument” error. I appreciate your help. using ArgParse function …

---

## [Julia 1.6 libcurl firewall download issue: Windows Schannel certificate revocation check failure](https://discourse.julialang.org/t/julia-1-6-libcurl-firewall-download-issue-windows-schannel-certificate-revocation-check-failure/58021)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 32\
**Last updated:** [April 23, 2021, 7:56am UTC](https://discourse.julialang.org/t/julia-1-6-libcurl-firewall-download-issue-windows-schannel-certificate-revocation-check-failure/58021 "2021-04-23T07:56:42Z")

</div>

In Julia 1.5.3, I had https-proxy, http\_proxy, html\_proxy, SSL\_CERT\_FILE set in the environment variables. I also had a \_curlrc file with “insecure” in it in my home directory as well as a .condarc to get things workin…

---

## [Odd BenchmarkTools timings using @threads and Octavian](https://discourse.julialang.org/t/odd-benchmarktools-timings-using-threads-and-octavian/59838)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 4\
**Last updated:** [April 23, 2021, 2:54am UTC](https://discourse.julialang.org/t/odd-benchmarktools-timings-using-threads-and-octavian/59838 "2021-04-23T02:54:07Z")

</div>

I’m getting some odd behavior using @threads and Octavian. If I time matmul! and a simple tmap! implementation, I see reasonable speedup. using Octavian using LinearAlgebra A = randn(8,8) x = randn(8,10000) b = simila…

---

## [Hcat with matrices as elements](https://discourse.julialang.org/t/hcat-with-matrices-as-elements/59817)

<div class="topic-metadata">

**Author:** [@FeldrinH](https://discourse.julialang.org/u/FeldrinH)\
**Replies:** 17\
**Last updated:** [April 22, 2021, 9:26pm UTC](https://discourse.julialang.org/t/hcat-with-matrices-as-elements/59817 "2021-04-22T21:26:16Z")

</div>

If I want a matrix with a single row of numbers I can do \[1 2 3 4 5\] or the equivalen function call hcat(1, 2, 3, 4, 5). However, what if I want a matrix with a single row of matrices as elements? If a,b, c, d and e are …

---

## [Strange white space dependence with @assert](https://discourse.julialang.org/t/strange-white-space-dependence-with-assert/59825)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [April 22, 2021, 9:24pm UTC](https://discourse.julialang.org/t/strange-white-space-dependence-with-assert/59825 "2021-04-22T21:24:15Z")

</div>

Julia syntax is usually insensitive to white space, but I encountered a situation when @assert introduces a strange dependence on white space. Is this a bug? (I’m using Julia 1.6.0.) julia\> t = Int64\[1,2\]; julia\> @asse…

---

## [Colorbar position inside layout](https://discourse.julialang.org/t/colorbar-position-inside-layout/59762)

<div class="topic-metadata">

**Author:** [@AshtonSBradley](https://discourse.julialang.org/u/AshtonSBradley)\
**Replies:** 1\
**Last updated:** [April 22, 2021, 5:30pm UTC](https://discourse.julialang.org/t/colorbar-position-inside-layout/59762 "2021-04-22T17:30:35Z")

</div>

having done (the heatmap is the 4th plot down in a 5x2 layout) cbar = Colorbar(f\[4, 1\]\[2, 1\], vertical=false,height = 20) I get something like this: Is there a way to get the colorbar to sit just below the heatmap…

---

## [Unit test equality for arrays?](https://discourse.julialang.org/t/unit-test-equality-for-arrays/8138)

<div class="topic-metadata">

**Author:** [@fufjvnvnf](https://discourse.julialang.org/u/fufjvnvnf)\
**Replies:** 14\
**Last updated:** [April 22, 2021, 5:28pm UTC](https://discourse.julialang.org/t/unit-test-equality-for-arrays/8138 "2021-04-22T17:28:21Z")

</div>

I am trying to use unit test to test the equality of two arrays, wheres the following test: @test \[2.36248e-314, 2.36248e-314\] ≈ \[0.0, 0.0\] would fail. The two entries in the vector, if compared separately with the sam…

---

## [Allocations when splatting Triangle points](https://discourse.julialang.org/t/allocations-when-splatting-triangle-points/59792)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 3\
**Last updated:** [April 22, 2021, 2:32pm UTC](https://discourse.julialang.org/t/allocations-when-splatting-triangle-points/59792 "2021-04-22T14:32:06Z")

</div>

I’m (finally) adding some distance functions to GeometryBasics.jl and I’m having a problem avoiding allocations when splatting to get the points of a triangle using GeometryBasics using BenchmarkTools vect\_to\_center(p,a…

---

## [Why does this vector shows elements multiple times?](https://discourse.julialang.org/t/why-does-this-vector-shows-elements-multiple-times/59807)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [April 22, 2021, 2:27pm UTC](https://discourse.julialang.org/t/why-does-this-vector-shows-elements-multiple-times/59807 "2021-04-22T14:27:34Z")

</div>

Hi, Is it normal that show has this behavior or I should report a bug ? julia\> struct Foo x end julia\> Base.show(io::IO, f::Foo) = print("Foo",f.x) julia\> foos = \[Foo(1)\] 1-element Vector{Foo}: Foo1 Foo1…

---

## [Error in Pkg EEG](https://discourse.julialang.org/t/error-in-pkg-eeg/59799)

<div class="topic-metadata">

**Author:** [@Xzarx](https://discourse.julialang.org/u/Xzarx)\
**Replies:** 4\
**Last updated:** [April 22, 2021, 12:55pm UTC](https://discourse.julialang.org/t/error-in-pkg-eeg/59799 "2021-04-22T12:55:48Z")

</div>

I tries to use the package EGG, but, when I run the command: Pkg.add(“EEG”) (@v1.5) pkg\> Pkg.checkout(“EEG”) ERROR: Could not determine command julia\> Pkg.checkout(“EEG”) ERROR: UndefVarError: checkout not defined S…

---

## [Going backward in random number generation](https://discourse.julialang.org/t/going-backward-in-random-number-generation/24257)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 17\
**Last updated:** [April 22, 2021, 11:49am UTC](https://discourse.julialang.org/t/going-backward-in-random-number-generation/24257 "2021-04-22T11:49:34Z")

</div>

Hi, I have a function sample() that generate trajectories from random numbers. Before calling this function, I would do Random.seed!(1) My problem is that I call rand() one more time than necessary in sample() given t…

---

## [OLS with collinearity and weights using GLM.jl](https://discourse.julialang.org/t/ols-with-collinearity-and-weights-using-glm-jl/59787)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 3\
**Last updated:** [April 22, 2021, 11:49am UTC](https://discourse.julialang.org/t/ols-with-collinearity-and-weights-using-glm-jl/59787 "2021-04-22T11:49:26Z")

</div>

I am having a problem fitting an OLS model with weights and collinearity using GLM.jl. Here is a simple example y = rand(10) x = rand(10, 2) x = hcat(x,x) lm(x,y) # correctly removes last two columns lm(x, y, wts = one…

---

## [Annotations not showing on log scale](https://discourse.julialang.org/t/annotations-not-showing-on-log-scale/59767)

<div class="topic-metadata">

**Author:** [@AshtonSBradley](https://discourse.julialang.org/u/AshtonSBradley)\
**Replies:** 3\
**Last updated:** [April 22, 2021, 11:07am UTC](https://discourse.julialang.org/t/annotations-not-showing-on-log-scale/59767 "2021-04-22T11:07:38Z")

</div>

When I do fig = Figure() at = Axis(fig\[1,1\],yscale=log10,xscale=log10) lines!(at,1..10,exp) annotations!(at,\["testing"\],\[Point2f0(2,100)\]) fig the annotation doesn’t show up: What am I doing wrong? (seems to work o…

---

## [Communicate with external process through pipe](https://discourse.julialang.org/t/communicate-with-external-process-through-pipe/59759)

<div class="topic-metadata">

**Author:** [@lambdakappatheta](https://discourse.julialang.org/u/lambdakappatheta)\
**Replies:** 2\
**Last updated:** [April 22, 2021, 10:54am UTC](https://discourse.julialang.org/t/communicate-with-external-process-through-pipe/59759 "2021-04-22T10:54:28Z")

</div>

I am trying to create a pipe (a pair of file descriptors), find the file descriptor number of the writing end of the pipe, pass it to an external command and read from the reading end of the pipe from my Julia script. In…

---

## [Troubles with solving Korteweg-de Vries equation](https://discourse.julialang.org/t/troubles-with-solving-korteweg-de-vries-equation/59406)

<div class="topic-metadata">

**Author:** [@Stepan\_Shcherbinin](https://discourse.julialang.org/u/Stepan_Shcherbinin)\
**Replies:** 1\
**Last updated:** [April 22, 2021, 7:40am UTC](https://discourse.julialang.org/t/troubles-with-solving-korteweg-de-vries-equation/59406 "2021-04-22T07:40:14Z")

</div>

Hi everybody, I am a new Julia user. I try to solve KdV equation with the aid of DifferentialEquations.jl. Here is my code: using DifferentialEquations, DiffEqOperators using Plots a = 1 u\_analytic(x) = 3\*a\*a/cosh(a\*0…

---

## [Julia vs SciPy - Performance comparison and benchmark help](https://discourse.julialang.org/t/julia-vs-scipy-performance-comparison-and-benchmark-help/59758)

<div class="topic-metadata">

**Author:** [@miguelraz](https://discourse.julialang.org/u/miguelraz)\
**Replies:** 15\
**Last updated:** [April 22, 2021, 6:35am UTC](https://discourse.julialang.org/t/julia-vs-scipy-performance-comparison-and-benchmark-help/59758 "2021-04-22T06:35:10Z")

</div>

Hello all! I’m dusting off a one-function package I made a while ago, but I want to confirm that the benchmarks are honest. There’s some calls to scipy objects, and I would like to know if I’m measuring any sort of unfa…

---

## [Using vs import? Would switching names make more sense?](https://discourse.julialang.org/t/using-vs-import-would-switching-names-make-more-sense/59775)

<div class="topic-metadata">

**Author:** [@AA\_julia](https://discourse.julialang.org/u/AA_julia)\
**Replies:** 2\
**Last updated:** [April 22, 2021, 5:53am UTC](https://discourse.julialang.org/t/using-vs-import-would-switching-names-make-more-sense/59775 "2021-04-22T05:53:13Z")

</div>

Hi, I know this seems too late and people already used to use both “using” and “import” as they have already defined, but I’m just wondering if it does make more sense to rename “using” as “import”, and vice versa? The …

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

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