# General Usage

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

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

**Page:** 912

---

## [Setting up tests: problems with \`using myModule\`](https://discourse.julialang.org/t/setting-up-tests-problems-with-using-mymodule/18495)

<div class="topic-metadata">

**Author:** [@natemcintosh](https://discourse.julialang.org/u/natemcintosh)\
**Replies:** 3\
**Last updated:** [December 9, 2018, 8:28pm UTC](https://discourse.julialang.org/t/setting-up-tests-problems-with-using-mymodule/18495 "2018-12-09T20:28:48Z")

</div>

I’m attempting to create my own module (for the purpose of educating myself) and write tests for it. However, when attempting to call using myOpti in my test, I keep running into the error ERROR: LoadError: ArgumentErro…

---

## [Check the changing of GPU memory in time](https://discourse.julialang.org/t/check-the-changing-of-gpu-memory-in-time/17643)

<div class="topic-metadata">

**Author:** [@lannisite110](https://discourse.julialang.org/u/lannisite110)\
**Replies:** 1\
**Last updated:** [December 9, 2018, 5:17pm UTC](https://discourse.julialang.org/t/check-the-changing-of-gpu-memory-in-time/17643 "2018-12-09T17:17:20Z")

</div>

Does any one knows how to check the changing of gpu memory in time

---

## [Redundant blocks: flatten an iterator?](https://discourse.julialang.org/t/redundant-blocks-flatten-an-iterator/18493)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 0\
**Last updated:** [December 9, 2018, 4:00pm UTC](https://discourse.julialang.org/t/redundant-blocks-flatten-an-iterator/18493 "2018-12-09T16:00:28Z")

</div>

Hi, There’s a minor metaprogramming annoyance I’m working through, hoping someone can help me understand the best idiomatic Julia (“Julianic”?) way to do this. I’m seeing a lot of redundant blocks coming from the MetaT…

---

## [Extending the standard library](https://discourse.julialang.org/t/extending-the-standard-library/18480)

<div class="topic-metadata">

**Author:** [@jtfrederico](https://discourse.julialang.org/u/jtfrederico)\
**Replies:** 4\
**Last updated:** [December 9, 2018, 1:08pm UTC](https://discourse.julialang.org/t/extending-the-standard-library/18480 "2018-12-09T13:08:29Z")

</div>

I have a question: I can extend the standard library by inserting methods into other namespaces. E.g.: struct Fun end function Base.close(fun::Fun) print("Fun can't be closed") end Is it generally a good idea or a…

---

## [Head/tail pattern with NamedTuple](https://discourse.julialang.org/t/head-tail-pattern-with-namedtuple/17554)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [December 9, 2018, 6:59am UTC](https://discourse.julialang.org/t/head-tail-pattern-with-namedtuple/17554 "2018-12-09T06:59:57Z")

</div>

I want to create NamedTuples from a parametric type where the parameter is the desired type. Fields are computed using fieldtypes (in the MWE below, makezero). From reading code in Base, I came up with the following solu…

---

## [Converting PyObject to a Julia array](https://discourse.julialang.org/t/converting-pyobject-to-a-julia-array/18445)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 6\
**Last updated:** [December 9, 2018, 1:36am UTC](https://discourse.julialang.org/t/converting-pyobject-to-a-julia-array/18445 "2018-12-09T01:36:46Z")

</div>

How to convert PyObject into a Julia array import PyCall tf = PyCall.pyimport("tensorflow") o = tf\[:random\_normal\]((3,3)) PyObject \<tf.Tensor: id=27, shape=(3, 3), dtype=float32, numpy= array(\[\[0.02705349, 0.3173014 , 0…

---

## [Type parameter transformation, StaticArray with blade indexing](https://discourse.julialang.org/t/type-parameter-transformation-staticarray-with-blade-indexing/18371)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 8\
**Last updated:** [December 8, 2018, 10:29pm UTC](https://discourse.julialang.org/t/type-parameter-transformation-staticarray-with-blade-indexing/18371 "2018-12-08T22:29:10Z")

</div>

My goal is to create a new type, let’s say MultiVector which contains an MVector{2^N,T} with 2^N elements, but I am going to define an unusual type of indexing on MultiVector using multivector blades. With standard arra…

---

## [Right way to "static" allocate vectors in a function](https://discourse.julialang.org/t/right-way-to-static-allocate-vectors-in-a-function/18469)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 2\
**Last updated:** [December 8, 2018, 8:18pm UTC](https://discourse.julialang.org/t/right-way-to-static-allocate-vectors-in-a-function/18469 "2018-12-08T20:18:47Z")

</div>

Hi guys! I have some functions that were called to fill a 2000 x 2000 matrix. Some functions need to allocate 2000x1 vectors to do the computations. However, those functions are called like 2000x2000 times :sweat\_smile: …

---

## [How to create an OffsetArray from an existing array?](https://discourse.julialang.org/t/how-to-create-an-offsetarray-from-an-existing-array/18461)

<div class="topic-metadata">

**Author:** [@SZJX](https://discourse.julialang.org/u/SZJX)\
**Replies:** 1\
**Last updated:** [December 8, 2018, 8:08pm UTC](https://discourse.julialang.org/t/how-to-create-an-offsetarray-from-an-existing-array/18461 "2018-12-08T20:08:20Z")

</div>

Sorry if the answer is obvious. I just couldn’t find a solution in the source code or via Googling. Basically my use case is like this: v = Vector{Char}("asdf") # Doesn't work offset\_v = OffsetVector{Char}("asdf", 0:3…

---

## [Project instantiation](https://discourse.julialang.org/t/project-instantiation/18408)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 2\
**Last updated:** [December 8, 2018, 1:24pm UTC](https://discourse.julialang.org/t/project-instantiation/18408 "2018-12-08T13:24:11Z")

</div>

I’ve started using projects to work collaboratively and I’d would like my coworkers to be able to get the identical git commits for the custom projects we’re working on, as listed in Manifest.toml Say they are in the pr…

---

## [Julia exceptions in C](https://discourse.julialang.org/t/julia-exceptions-in-c/18387)

<div class="topic-metadata">

**Author:** [@vitreo12](https://discourse.julialang.org/u/vitreo12)\
**Replies:** 10\
**Last updated:** [December 8, 2018, 10:47am UTC](https://discourse.julialang.org/t/julia-exceptions-in-c/18387 "2018-12-08T10:47:20Z")

</div>

Hi everyone, is there a convenient way of retrieving Julia exceptions in the C interface so that they appear the same way that they do on the Julia REPL? Considering a call to an undefined\_function(), on the REPL the ou…

---

## [Constant propagation outside functions](https://discourse.julialang.org/t/constant-propagation-outside-functions/18457)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [December 8, 2018, 10:23am UTC](https://discourse.julialang.org/t/constant-propagation-outside-functions/18457 "2018-12-08T10:23:35Z")

</div>

I am confused about the rules of constant propagation in expressions which are outside functions. Specifically, my use case would be exploratory data analysis using building blocks of the DataFrames API, such as groupby …

---

## [Std() throwing a methodError](https://discourse.julialang.org/t/std-throwing-a-methoderror/18407)

<div class="topic-metadata">

**Author:** [@Daniel.malonebuoy](https://discourse.julialang.org/u/Daniel.malonebuoy)\
**Replies:** 2\
**Last updated:** [December 8, 2018, 9:27am UTC](https://discourse.julialang.org/t/std-throwing-a-methoderror/18407 "2018-12-08T09:27:00Z")

</div>

I am trying to calculate the standard deviation of the array waiting\_Time. But, i get the error “MethodError: objects of type Float64 are not callable”. What am I doing wrong? Here is my code: using Distributions fun…

---

## [Pool(w) cannot deal 5 dims data](https://discourse.julialang.org/t/pool-w-cannot-deal-5-dims-data/18199)

<div class="topic-metadata">

**Author:** [@lannisite110](https://discourse.julialang.org/u/lannisite110)\
**Replies:** 2\
**Last updated:** [December 8, 2018, 7:46am UTC](https://discourse.julialang.org/t/pool-w-cannot-deal-5-dims-data/18199 "2018-12-08T07:46:11Z")

</div>

julia\>using Knet julia\> dims=(3, 3, 3, 1, 64) (3, 3, 3, 1, 64) julia\> w=gaussian(dims) 3×3×3×1×64 Array{Float64,5}: julia\> pool(w) ERROR: MethodError: no method matching pool(::Array{Float64,5}) Closest candidates…

---

## [Error installing Hydrogen in Juno](https://discourse.julialang.org/t/error-installing-hydrogen-in-juno/18452)

<div class="topic-metadata">

**Author:** [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Replies:** 0\
**Last updated:** [December 8, 2018, 4:47am UTC](https://discourse.julialang.org/t/error-installing-hydrogen-in-juno/18452 "2018-12-08T04:47:40Z")

</div>

Win 10 Atom 1.33 Julia1.0.2 Installing “Hydrogen@2.6.0” failed.Hide output… npm ERR! code Z\_BUF\_ERROR npm ERR! errno -5 npm ERR! zlib: unexpected end of file npm ERR! A complete log of this run can be found in: npm …

---

## [JUNO Atom on the Mac, autocompletion strange behaviour](https://discourse.julialang.org/t/juno-atom-on-the-mac-autocompletion-strange-behaviour/18441)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 2\
**Last updated:** [December 8, 2018, 2:35am UTC](https://discourse.julialang.org/t/juno-atom-on-the-mac-autocompletion-strange-behaviour/18441 "2018-12-08T02:35:47Z")

</div>

The autocompletion is not working on my JUNO Atom on my Mac I stop Julia console (REPL panel) on Atom uninstall latex-completions 0.3.6 install latex-completions 0.3.6 now at this point the auto completion works agai…

---

## [Cannot compare some time periods](https://discourse.julialang.org/t/cannot-compare-some-time-periods/18417)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 5\
**Last updated:** [December 7, 2018, 3:21pm UTC](https://discourse.julialang.org/t/cannot-compare-some-time-periods/18417 "2018-12-07T15:21:42Z")

</div>

Some periods of time, e.g. Millisecond vs Month, behave as incomparable: using Dates Millisecond(2) \< Week(2) # true Millisecond(2) \< Month(2) # error The reason for this error is unclear for me. Even the error trace…

---

## [How can you know a package works in Julia 1.0 (or 0.6); e.g Sodium.jl. What's a good heuristic to know old Julia code is up-to-date?](https://discourse.julialang.org/t/how-can-you-know-a-package-works-in-julia-1-0-or-0-6-e-g-sodium-jl-whats-a-good-heuristic-to-know-old-julia-code-is-up-to-date/18415)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [December 7, 2018, 11:22am UTC](https://discourse.julialang.org/t/how-can-you-know-a-package-works-in-julia-1-0-or-0-6-e-g-sodium-jl-whats-a-good-heuristic-to-know-old-julia-code-is-up-to-date/18415 "2018-12-07T11:22:17Z")

</div>

\[I’ve yet to make a package, I believe the procedure autogenerates a REQUIRE file, anyone remembers for what version of Julia that got added?\] I mean code without a REQUIRE file (I know how to read those). \[To answer my…

---

## [Segfaulting with mutually recursive linked lists](https://discourse.julialang.org/t/segfaulting-with-mutually-recursive-linked-lists/18413)

<div class="topic-metadata">

**Author:** [@richardreeve](https://discourse.julialang.org/u/richardreeve)\
**Replies:** 0\
**Last updated:** [December 7, 2018, 10:37am UTC](https://discourse.julialang.org/t/segfaulting-with-mutually-recursive-linked-lists/18413 "2018-12-07T10:37:09Z")

</div>

I’ve been building a new phylogenetic tree representation in Julia which uses mutually recursive linked lists to store a tree as linked nodes and branches. I know about handle mutually-circular type declarations · Issue …

---

## [Gc and resize!](https://discourse.julialang.org/t/gc-and-resize/18374)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 12\
**Last updated:** [December 7, 2018, 9:59am UTC](https://discourse.julialang.org/t/gc-and-resize/18374 "2018-12-07T09:59:25Z")

</div>

I have a stream of values, from which I collect blocks of values depending on some criterion which is calculated online, so I don’t know the size of a block until the last element. Then I process each block. Since I kno…

---

## [Dispatch on constrained value type parameters](https://discourse.julialang.org/t/dispatch-on-constrained-value-type-parameters/18349)

<div class="topic-metadata">

**Author:** [@vlc](https://discourse.julialang.org/u/vlc)\
**Replies:** 12\
**Last updated:** [December 7, 2018, 9:24am UTC](https://discourse.julialang.org/t/dispatch-on-constrained-value-type-parameters/18349 "2018-12-07T09:24:12Z")

</div>

Hello, I’m working with AbstractArrays, and I would like to execute a method foo that takes two AbstractArrays when the number of dimensions of the first arrays is twice that of the first’s. An error should be thrown ot…

---

## [Eigenvalues of symmetric matrix in packed format (upper triangular entries stacked in vector)](https://discourse.julialang.org/t/eigenvalues-of-symmetric-matrix-in-packed-format-upper-triangular-entries-stacked-in-vector/18323)

<div class="topic-metadata">

**Author:** [@migarstka](https://discourse.julialang.org/u/migarstka)\
**Replies:** 0\
**Last updated:** [December 5, 2018, 2:46pm UTC](https://discourse.julialang.org/t/eigenvalues-of-symmetric-matrix-in-packed-format-upper-triangular-entries-stacked-in-vector/18323 "2018-12-05T14:46:20Z")

</div>

I am trying to compute the eigenvalues of a symmetric matrix in packed format, i.e. you stack the upper triangular entries in a vector (Packed Storage ) It seems like there exists a LAPACK function for that, e.g. spev. …

---

## [Why do the packages folders get dirty/broken so easily?](https://discourse.julialang.org/t/why-do-the-packages-folders-get-dirty-broken-so-easily/18375)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 7\
**Last updated:** [December 7, 2018, 7:13am UTC](https://discourse.julialang.org/t/why-do-the-packages-folders-get-dirty-broken-so-easily/18375 "2018-12-07T07:13:35Z")

</div>

Many times I install new packages I end up needing to delete the clones folder or cleaning the git repository in some way. Is there any way to avoid this problems?

---

## [Not able to construct the doc string](https://discourse.julialang.org/t/not-able-to-construct-the-doc-string/18396)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 4\
**Last updated:** [December 6, 2018, 11:53pm UTC](https://discourse.julialang.org/t/not-able-to-construct-the-doc-string/18396 "2018-12-06T23:53:39Z")

</div>

How does one do this? This is supposed to be a doc string with a code block which should include a string literal in triple quotes ( for obvious reasons I can’t quote this with triple \`'s): “”" bar(x) \`\`\` bar(“”“My …

---

## [Receiving unix socket ancillary data (like fd's)](https://discourse.julialang.org/t/receiving-unix-socket-ancillary-data-like-fds/18246)

<div class="topic-metadata">

**Author:** [@Deuxis](https://discourse.julialang.org/u/Deuxis)\
**Replies:** 17\
**Last updated:** [December 6, 2018, 10:47pm UTC](https://discourse.julialang.org/t/receiving-unix-socket-ancillary-data-like-fds/18246 "2018-12-06T22:47:03Z")

</div>

The format of the protocol I’m trying to develop for specifies that when sending a file descriptor, “The file descriptor is not stored in the message buffer, but in the ancillary data of the UNIX domain socket message (m…

---

## [Developing and using my own code](https://discourse.julialang.org/t/developing-and-using-my-own-code/18372)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 2\
**Last updated:** [December 6, 2018, 7:58pm UTC](https://discourse.julialang.org/t/developing-and-using-my-own-code/18372 "2018-12-06T19:58:52Z")

</div>

Hello, Since julia 1.0 I am completely lost with how the packaging system works in terms of dealing with my own code. I’ve read Pkg · The Julia Language over and over again, and I just don’t get it. Suppose I have som…

---

## [Pmap with complex structs](https://discourse.julialang.org/t/pmap-with-complex-structs/18289)

<div class="topic-metadata">

**Author:** [@squaregoldfish](https://discourse.julialang.org/u/squaregoldfish)\
**Replies:** 7\
**Last updated:** [December 6, 2018, 5:59pm UTC](https://discourse.julialang.org/t/pmap-with-complex-structs/18289 "2018-12-06T17:59:04Z")

</div>

I have a large array of a complex mutable struct type. The whole array is processed iteratively, but each element can be processed independently of the others in a given iteration. The number of iterations required to co…

---

## [When shouldn't we use @simd?](https://discourse.julialang.org/t/when-shouldnt-we-use-simd/18276)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 13\
**Last updated:** [December 6, 2018, 3:55pm UTC](https://discourse.julialang.org/t/when-shouldnt-we-use-simd/18276 "2018-12-06T15:55:40Z")

</div>

Hello. @simd documentations say: Warning: Incorrect use of the @simd macro may cause unexpected results. \* You are asserting it is safe to execute iterations in arbitrary or overlapping order, with special consider…

---

## [PyCall installation failure in Julia's official docker image](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 4\
**Last updated:** [December 6, 2018, 3:00pm UTC](https://discourse.julialang.org/t/pycall-installation-failure-in-julias-official-docker-image/13693 "2018-12-06T15:00:22Z")

</div>

I am new to docker and I want to use Julia’s official docker image to run GitLab CI. I need to install PyPlot.jl into the Julia docker image. But, since PyCall.jl is not installed properly, the job is failed. Below are t…

---

## [PyPlot label\_position Y-axis in Julia](https://discourse.julialang.org/t/pyplot-label-position-y-axis-in-julia/18354)

<div class="topic-metadata">

**Author:** [@Romero\_Azzalini](https://discourse.julialang.org/u/Romero_Azzalini)\
**Replies:** 1\
**Last updated:** [December 6, 2018, 2:25pm UTC](https://discourse.julialang.org/t/pyplot-label-position-y-axis-in-julia/18354 "2018-12-06T14:25:42Z")

</div>

I basically want the Y label (using PyPlot) on the right side with it’s ticks. For Python I found the comand ax.yaxis.set\_label\_position("right") . But if I do ax=gca() ax.yaxis.set\_label\_position("right") or ax\[:ya…

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

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