# General Usage

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

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

**Page:** 963

---

## [Weak key IdDict? (Or other “metadata” solutions?)](https://discourse.julialang.org/t/weak-key-iddict-or-other-metadata-solutions/12377)

<div class="topic-metadata">

**Author:** [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Replies:** 7\
**Last updated:** [July 20, 2018, 2:03pm UTC](https://discourse.julialang.org/t/weak-key-iddict-or-other-metadata-solutions/12377 "2018-07-20T14:03:48Z")

</div>

I’d like for one piece of my code to be able to associate data with individual objects in another part – metadata or the like, that’s not part of the original type definition. I could write wrappers/decorators, but I’d l…

---

## [What is unescape in v0.7?](https://discourse.julialang.org/t/what-is-unescape-in-v0-7/12530)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 3\
**Last updated:** [July 20, 2018, 12:29pm UTC](https://discourse.julialang.org/t/what-is-unescape-in-v0-7/12530 "2018-07-20T12:29:08Z")

</div>

I was looking into the doc system, but I’m quite confused with the v0.7’s doc macro: # docsystem basics const unescape = Symbol("hygienic-scope") macro doc(x...) docex = atdoc(\_\_source\_\_, \_\_module\_\_, x...) isa(d…

---

## [Installing JuliaFin on mac error](https://discourse.julialang.org/t/installing-juliafin-on-mac-error/12531)

<div class="topic-metadata">

**Author:** [@haakhtar](https://discourse.julialang.org/u/haakhtar)\
**Replies:** 0\
**Last updated:** [July 20, 2018, 12:25pm UTC](https://discourse.julialang.org/t/installing-juliafin-on-mac-error/12531 "2018-07-20T12:25:39Z")

</div>

Hi, I have tried to install JuliaFin on y macbook however when I run the ./DeployJuliaFinBundle.sh JuliaFin-0.6.3.1.tgz “0.6.3.1” “/Applications/JuliaPro- 0.6.3.1.app” command, it gives me the following error “./DeployJu…

---

## [Getting the return type of a function call without actually running it](https://discourse.julialang.org/t/getting-the-return-type-of-a-function-call-without-actually-running-it/12515)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 4\
**Last updated:** [July 20, 2018, 11:41am UTC](https://discourse.julialang.org/t/getting-the-return-type-of-a-function-call-without-actually-running-it/12515 "2018-07-20T11:41:31Z")

</div>

Hi fellows, I am working on a way to dispatch according to the return type of a function call. I asked a similar question here: I am asking it again in case something in julia may have changed.

---

## [Access the name and value by using a symbol](https://discourse.julialang.org/t/access-the-name-and-value-by-using-a-symbol/12523)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 7\
**Last updated:** [July 20, 2018, 8:40am UTC](https://discourse.julialang.org/t/access-the-name-and-value-by-using-a-symbol/12523 "2018-07-20T08:40:12Z")

</div>

I wonder if it is possible to get the value and the name by using a symbol. I mean something like this (which does not work): julia\> x = 1 y = :x println("$y is equal to $(getvalue(y))") x is equal to 1 …

---

## [The cost of size() in for-loops](https://discourse.julialang.org/t/the-cost-of-size-in-for-loops/12491)

<div class="topic-metadata">

**Author:** [@ckoe-bccms](https://discourse.julialang.org/u/ckoe-bccms)\
**Replies:** 11\
**Last updated:** [July 20, 2018, 8:28am UTC](https://discourse.julialang.org/t/the-cost-of-size-in-for-loops/12491 "2018-07-20T08:28:58Z")

</div>

Hello everybody, I have a performance question which I hope has not been asked to death before. I will provide a minimal working example below. First, let me give some context. The type of code shown below gets called …

---

## [Detailed Information About A Module About what it imports](https://discourse.julialang.org/t/detailed-information-about-a-module-about-what-it-imports/12522)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 0\
**Last updated:** [July 20, 2018, 5:12am UTC](https://discourse.julialang.org/t/detailed-information-about-a-module-about-what-it-imports/12522 "2018-07-20T05:12:29Z")

</div>

Hi, I am looking for a way to what symbols are being employed in a module by “using X.Y.Z” here is an example module A export ff,aa function ff() "FF" end function aa() "AA" end end module B using B export…

---

## [Save memory of a translational symmetric matrix](https://discourse.julialang.org/t/save-memory-of-a-translational-symmetric-matrix/12433)

<div class="topic-metadata">

**Author:** [@shipengcheng1230](https://discourse.julialang.org/u/shipengcheng1230)\
**Replies:** 4\
**Last updated:** [July 20, 2018, 4:57am UTC](https://discourse.julialang.org/t/save-memory-of-a-translational-symmetric-matrix/12433 "2018-07-20T04:57:36Z")

</div>

I have a mult-dimension matrix (or perhaps tensor more appropriately), for example: a = rand(5, 5, 5, 5). It satisfies translational symmetry, i.e. a\[i, j, k, l\] = a\[i - k, j, l\]. In such case, how could I save the mem…

---

## [Arrays of NamedTuples with Arrays in Julia 0.7](https://discourse.julialang.org/t/arrays-of-namedtuples-with-arrays-in-julia-0-7/12508)

<div class="topic-metadata">

**Author:** [@jdlara-berkeley](https://discourse.julialang.org/u/jdlara-berkeley)\
**Replies:** 3\
**Last updated:** [July 19, 2018, 9:24pm UTC](https://discourse.julialang.org/t/arrays-of-namedtuples-with-arrays-in-julia-0-7/12508 "2018-07-19T21:24:17Z")

</div>

I am trying to create an Array with named tuples inside where one of the fields is an array. In 0.6 this is possible a = @NT(t = 10, x = \[1,2\]) b = @NT(t = 1, x = \[23,3\]) m = \[a,b\] However, in Julia 0.7 I get this erro…

---

## [When is it safe to use Base.OneTo?](https://discourse.julialang.org/t/when-is-it-safe-to-use-base-oneto/12512)

<div class="topic-metadata">

**Author:** [@favba](https://discourse.julialang.org/u/favba)\
**Replies:** 0\
**Last updated:** [July 19, 2018, 8:45pm UTC](https://discourse.julialang.org/t/when-is-it-safe-to-use-base-oneto/12512 "2018-07-19T20:45:46Z")

</div>

Since Base.OneTo is not exported I am suspicious that there might be some gotchas with it. I implemented a padded array interface to perform in-place r2c and c2r fft transformations. For that I have to create views tha…

---

## [Printing typemax as Inf](https://discourse.julialang.org/t/printing-typemax-as-inf/12509)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 2\
**Last updated:** [July 19, 2018, 7:37pm UTC](https://discourse.julialang.org/t/printing-typemax-as-inf/12509 "2018-07-19T19:37:53Z")

</div>

I’d like add something to a Base method. In particular, I’d like to override Base.print for a particular type but still need to call the original function in most cases. The problem is that the original function is los…

---

## [Use keyword in the upcomming keywords](https://discourse.julialang.org/t/use-keyword-in-the-upcomming-keywords/12497)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 6\
**Last updated:** [July 19, 2018, 3:47pm UTC](https://discourse.julialang.org/t/use-keyword-in-the-upcomming-keywords/12497 "2018-07-19T15:47:14Z")

</div>

Hello, I know that it is allowed to use keyword arguments to define later arguments like, e. g., this: f(;a=1, b="$a") = b Now calling f() f(;a=2) works fine. However I cannot write this one: f(;a=3, b="$a") which…

---

## [Use of Phonetics library](https://discourse.julialang.org/t/use-of-phonetics-library/12489)

<div class="topic-metadata">

**Author:** [@Samudra](https://discourse.julialang.org/u/Samudra)\
**Replies:** 1\
**Last updated:** [July 19, 2018, 1:06pm UTC](https://discourse.julialang.org/t/use-of-phonetics-library/12489 "2018-07-19T13:06:00Z")

</div>

Hi, I was trying to use Phonetics library and it gives me a load error as below. I am using Julia 0.6, and as I can see the package is up-todate. Any thoughts?

---

## [Julia 0.7 package development workflow - where are Git repositories of packages?](https://discourse.julialang.org/t/julia-0-7-package-development-workflow-where-are-git-repositories-of-packages/12455)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 9\
**Last updated:** [July 19, 2018, 11:16am UTC](https://discourse.julialang.org/t/julia-0-7-package-development-workflow-where-are-git-repositories-of-packages/12455 "2018-07-19T11:16:59Z")

</div>

Hello, I’m trying today Julia 0.7 but a package which was written for Julia 0.6 is not compatible. To install it I did using Pkg Pkg.add("ThisBrokenPackage") I tried to use it using using ThisBrokenPackage but enco…

---

## [Distributions.jl in 0.7.0-beta](https://discourse.julialang.org/t/distributions-jl-in-0-7-0-beta/12466)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 2\
**Last updated:** [July 19, 2018, 10:18am UTC](https://discourse.julialang.org/t/distributions-jl-in-0-7-0-beta/12466 "2018-07-19T10:18:51Z")

</div>

Hi, I’m trying to use julia-0.7.0-beta and port my packages for release. My package depends on Distributions.jl. I tried to install it using new Pkg interface but is getting this error: (v0.7) pkg\> add Distributions …

---

## [Type stability and array of matrices](https://discourse.julialang.org/t/type-stability-and-array-of-matrices/12483)

<div class="topic-metadata">

**Author:** [@jarl](https://discourse.julialang.org/u/jarl)\
**Replies:** 5\
**Last updated:** [July 19, 2018, 9:45am UTC](https://discourse.julialang.org/t/type-stability-and-array-of-matrices/12483 "2018-07-19T09:45:53Z")

</div>

I am having some trouble getting a deeper understanding of inference / type stability. I have a struct with an array of matrices and a function. I want to extract something from a matrix in the array, say the size of the…

---

## [Looks like a bug and flies like a bug, is it a bug?](https://discourse.julialang.org/t/looks-like-a-bug-and-flies-like-a-bug-is-it-a-bug/12485)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 1\
**Last updated:** [July 19, 2018, 9:24am UTC](https://discourse.julialang.org/t/looks-like-a-bug-and-flies-like-a-bug-is-it-a-bug/12485 "2018-07-19T09:24:41Z")

</div>

julia\> struct T end julia\> (t::TT)(x) where {TT\<:T} = x ERROR: function type in method definition is not a type Stacktrace: \[1\] top-level scope at none:0

---

## [Commercial codes using Julia - code obfuscation?](https://discourse.julialang.org/t/commercial-codes-using-julia-code-obfuscation/12429)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 6\
**Last updated:** [July 18, 2018, 4:58am UTC](https://discourse.julialang.org/t/commercial-codes-using-julia-code-obfuscation/12429 "2018-07-18T04:58:35Z")

</div>

Forking from the discussion on static compilation in Julia. One of the arguments for static compilation seems to be the commercial code and obfuscation argument. When shipping a commerical and paid for code the company…

---

## [Is there a way to make an annotation for time series axis in Gadfly?](https://discourse.julialang.org/t/is-there-a-way-to-make-an-annotation-for-time-series-axis-in-gadfly/12478)

<div class="topic-metadata">

**Author:** [@YongHee-Kim](https://discourse.julialang.org/u/YongHee-Kim)\
**Replies:** 2\
**Last updated:** [July 19, 2018, 5:30am UTC](https://discourse.julialang.org/t/is-there-a-way-to-make-an-annotation-for-time-series-axis-in-gadfly/12478 "2018-07-19T05:30:18Z")

</div>

I’m trying to draw a line on X-axis with time series dataset Here is a minimal working example using Gadfly, Compose y = broadcast(i -\> i^2, 1:30) line\_anno = compose(context(), stroke("red"), Shape.line(\[(10, 0), (10…

---

## [Dot broadcast macro not working as expected](https://discourse.julialang.org/t/dot-broadcast-macro-not-working-as-expected/12472)

<div class="topic-metadata">

**Author:** [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Replies:** 4\
**Last updated:** [July 18, 2018, 10:19pm UTC](https://discourse.julialang.org/t/dot-broadcast-macro-not-working-as-expected/12472 "2018-07-18T22:19:58Z")

</div>

I’m not sure if this is a bug in my understanding or an issue with the macro: I’m creating a complex array and then scrambling the phases. Here rand(N) is the only vector-valued thing, so I’d expect all the rest of the …

---

## [Bug in 0.7 or not?](https://discourse.julialang.org/t/bug-in-0-7-or-not/12474)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 1\
**Last updated:** [July 18, 2018, 8:41pm UTC](https://discourse.julialang.org/t/bug-in-0-7-or-not/12474 "2018-07-18T20:41:28Z")

</div>

I have a piece of code which is fine in 0.6.4 and gives a syntax error on 0.7.beta2: ERROR: LoadError: syntax: extra token "T" after end of expression here is an MWE: struct bar{T\<:Integer} d::Vector{T} end impo…

---

## [Code readability after fixing deprecation warnings](https://discourse.julialang.org/t/code-readability-after-fixing-deprecation-warnings/12471)

<div class="topic-metadata">

**Author:** [@krcools](https://discourse.julialang.org/u/krcools)\
**Replies:** 1\
**Last updated:** [July 18, 2018, 4:47pm UTC](https://discourse.julialang.org/t/code-readability-after-fixing-deprecation-warnings/12471 "2018-07-18T16:47:15Z")

</div>

I understand a lot of discussion preceded this release but I just wanted to supply some real life examples of changes in code. I received deprecation warnings like the ones below: ┌ Warning: \`findfirst(A, v)\` is depreca…

---

## [Allocations in construction of composite type with StaticArray field](https://discourse.julialang.org/t/allocations-in-construction-of-composite-type-with-staticarray-field/12461)

<div class="topic-metadata">

**Author:** [@vlc](https://discourse.julialang.org/u/vlc)\
**Replies:** 2\
**Last updated:** [July 18, 2018, 2:13pm UTC](https://discourse.julialang.org/t/allocations-in-construction-of-composite-type-with-staticarray-field/12461 "2018-07-18T14:13:40Z")

</div>

Hello, I’m tracking down allocations in a performance critical part of a code, where I use composite types with StaticArrays fields. I’ve noticed that initializing instances of such types triggers some allocations that …

---

## [List my own packages](https://discourse.julialang.org/t/list-my-own-packages/12462)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 2\
**Last updated:** [July 18, 2018, 12:40pm UTC](https://discourse.julialang.org/t/list-my-own-packages/12462 "2018-07-18T12:40:12Z")

</div>

I’ve PkgDev.generated quite a few packages through the years, and now I would like to see a list of all the packages that are “mine”. Because I have 299 installed packages I was wondering how to list the ones that were g…

---

## [Specific methods for symmetric matrices](https://discourse.julialang.org/t/specific-methods-for-symmetric-matrices/12445)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 4\
**Last updated:** [July 18, 2018, 10:07am UTC](https://discourse.julialang.org/t/specific-methods-for-symmetric-matrices/12445 "2018-07-18T10:07:10Z")

</div>

I’m defining a function f(m) that operates on a big matrix m that may be or not be symmetric. If it is symmetric, the algorithm can by optimized by only working on the upper triangle. I know that the symmetry of m can b…

---

## [Performance regression with indexing a \`reinterpret\`ed array in v0.7](https://discourse.julialang.org/t/performance-regression-with-indexing-a-reinterpret-ed-array-in-v0-7/12443)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 2\
**Last updated:** [July 17, 2018, 9:37pm UTC](https://discourse.julialang.org/t/performance-regression-with-indexing-a-reinterpret-ed-array-in-v0-7/12443 "2018-07-17T21:37:35Z")

</div>

Hi, while updating a package of mine I stumbled into what I think is a regression associated to indexing a reinterpreted array. Basically I have a custom array-like type as struct MyArray{T\<:Real, V1\<:AbstractArray{Com…

---

## [Profiling on beta2](https://discourse.julialang.org/t/profiling-on-beta2/12435)

<div class="topic-metadata">

**Author:** [@krcools](https://discourse.julialang.org/u/krcools)\
**Replies:** 4\
**Last updated:** [July 17, 2018, 3:51pm UTC](https://discourse.julialang.org/t/profiling-on-beta2/12435 "2018-07-17T15:51:53Z")

</div>

My boundary element assembly code is two times slower on 0.7-beta2 than on 0.6.4. Execution hangs when I try to @profile the relevant method. CPU usage in task manager is negligible. It this a know problem in the beta r…

---

## [Slower indexing on custom type for \`Complex{64}\`?](https://discourse.julialang.org/t/slower-indexing-on-custom-type-for-complex-64/5131)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 12\
**Last updated:** [July 17, 2018, 1:15pm UTC](https://discourse.julialang.org/t/slower-indexing-on-custom-type-for-complex-64/5131 "2018-07-17T13:15:06Z")

</div>

Hi, I have a custom type, wrapping a matrix, for which I have defined the indexing behaviour. The interesting fact is that indexing on the custom type is slower by 50% than indexing on the underlying matrix directly on…

---

## [\`\]add\`ing a package depending on an unregistered package](https://discourse.julialang.org/t/add-ing-a-package-depending-on-an-unregistered-package/12432)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 6\
**Last updated:** [July 17, 2018, 1:06pm UTC](https://discourse.julialang.org/t/add-ing-a-package-depending-on-an-unregistered-package/12432 "2018-07-17T13:06:34Z")

</div>

I have a registered package Preconditioners.jl which depends on an unregistered one IncompleteSelectedInversion.jl. And I want to have this dependency in a v0.7 compatible way. Previously when I asked the same question …

---

## [Binary data reader 200x+ slower on 0.7 ](https://discourse.julialang.org/t/binary-data-reader-200x-slower-on-0-7/12424)

<div class="topic-metadata">

**Author:** [@mgcth](https://discourse.julialang.org/u/mgcth)\
**Replies:** 8\
**Last updated:** [July 17, 2018, 11:04am UTC](https://discourse.julialang.org/t/binary-data-reader-200x-slower-on-0-7/12424 "2018-07-17T11:04:06Z")

</div>

I read binary data into a sparse matrix. Basically I populate a row and data vector with append! and put them into a sparse matrix using SparseMatrixCSC. It was very fast on 0.6, but is 200x+ slower on 0.7. I haven’t cha…

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

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