# General Usage

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

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

**Page:** 962

---

## [Rescuing old Julia 0.5 Nullable{Date} type in 0.6](https://discourse.julialang.org/t/rescuing-old-julia-0-5-nullable-date-type-in-0-6/11818)

<div class="topic-metadata">

**Author:** [@acunningham](https://discourse.julialang.org/u/acunningham)\
**Replies:** 7\
**Last updated:** [July 23, 2018, 9:30pm UTC](https://discourse.julialang.org/t/rescuing-old-julia-0-5-nullable-date-type-in-0-6/11818 "2018-07-23T21:30:42Z")

</div>

Hi, I’m upgrading to from Julia 0.5 to Julia 0.6 but I’m having some problems reading old JLD files with Nullable{Date} field. Julia 0.5 type below: type foo5 id::Int64 rollup\_date::Nullable{Date} end Julia 0…

---

## [Error with installkernel() in IJulia](https://discourse.julialang.org/t/error-with-installkernel-in-ijulia/12618)

<div class="topic-metadata">

**Author:** [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Replies:** 0\
**Last updated:** [July 23, 2018, 9:21pm UTC](https://discourse.julialang.org/t/error-with-installkernel-in-ijulia/12618 "2018-07-23T21:21:55Z")

</div>

I want to create an IJulia notebook with a Julia kernel using 64 cores, so based on the IJulia documentation I ran this: julia\> IJulia.installkernel("Julia -p64", "-p64") INFO: Installing Julia -p64 kernelspec julia--p6…

---

## [Get default function arguments](https://discourse.julialang.org/t/get-default-function-arguments/12612)

<div class="topic-metadata">

**Author:** [@lewis500](https://discourse.julialang.org/u/lewis500)\
**Replies:** 3\
**Last updated:** [July 23, 2018, 7:54pm UTC](https://discourse.julialang.org/t/get-default-function-arguments/12612 "2018-07-23T19:54:32Z")

</div>

If I have a function with optional arguments like add(a=2;b=3)=a+b is it possible to find out what the defaults are?

---

## [Compat usage](https://discourse.julialang.org/t/compat-usage/12591)

<div class="topic-metadata">

**Author:** [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Replies:** 1\
**Last updated:** [July 23, 2018, 6:24pm UTC](https://discourse.julialang.org/t/compat-usage/12591 "2018-07-23T18:24:39Z")

</div>

How do I use Compat.jl to get this julia-0.7 code running on 0.6 as well? (the code’s from the Julia Microbenchmarks) function parseintperf(t) local n, m for i=1:t n = rand(UInt32) s = string(n, …

---

## [BoundsError in Bisection Algorithm using a while loop](https://discourse.julialang.org/t/boundserror-in-bisection-algorithm-using-a-while-loop/12605)

<div class="topic-metadata">

**Author:** [@Lippi](https://discourse.julialang.org/u/Lippi)\
**Replies:** 5\
**Last updated:** [July 23, 2018, 4:17pm UTC](https://discourse.julialang.org/t/boundserror-in-bisection-algorithm-using-a-while-loop/12605 "2018-07-23T16:17:58Z")

</div>

Hi all, I am programming a bisection search. My algorithm is supposed to do this: take a parameter value (a price) as input for an optimization, use outputs as input for a function whose roots I want to find (excess de…

---

## [How to adjust the position of each bar in Geom.bar(GadFly)](https://discourse.julialang.org/t/how-to-adjust-the-position-of-each-bar-in-geom-bar-gadfly/12536)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 2\
**Last updated:** [July 23, 2018, 12:42pm UTC](https://discourse.julialang.org/t/how-to-adjust-the-position-of-each-bar-in-geom-bar-gadfly/12536 "2018-07-23T12:42:53Z")

</div>

For design matter, I would like that axe-x of the plot bellow showed only 2018 and 2019 (and not 2017.5 etc). I have converted the column related to the year in string and I have succeed to get my goal but I was wonde…

---

## [Pkg3 question](https://discourse.julialang.org/t/pkg3-question/12587)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [July 22, 2018, 9:19pm UTC](https://discourse.julialang.org/t/pkg3-question/12587 "2018-07-22T21:19:43Z")

</div>

Hello, I have checked out a package with the command “develop” to make some changes. But now I want to use the official package version again, because the relevant pull request got merged. How can I tell Pkg3 to use th…

---

## [Shorthand for \[\[1,2\],\[3,4\]\] .+ 1](https://discourse.julialang.org/t/shorthand-for-1-2-3-4-1/12526)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 18\
**Last updated:** [July 22, 2018, 9:03pm UTC](https://discourse.julialang.org/t/shorthand-for-1-2-3-4-1/12526 "2018-07-22T21:03:36Z")

</div>

Is there a short alternative for \[\[1,2\],\[3,4\]\] .+ 1 now that +(::Vector,::Number) is deprecated: julia\> x = \[\[1,2\], \[3,4\]\] 2-element Array{Array{Int64,1},1}: \[1, 2\] \[3, 4\] julia\> x .+ 1 ┌ Warning: \`a::AbstractArray +…

---

## [Help with \`@generated\` with the Cartesian module](https://discourse.julialang.org/t/help-with-generated-with-the-cartesian-module/12586)

<div class="topic-metadata">

**Author:** [@mforets](https://discourse.julialang.org/u/mforets)\
**Replies:** 2\
**Last updated:** [July 22, 2018, 7:29pm UTC](https://discourse.julialang.org/t/help-with-generated-with-the-cartesian-module/12586 "2018-07-22T19:29:36Z")

</div>

Hi, I would like to ask for help generalizing the following construction that uses Base.Cartesian for automatic creation of loops. First, the particular case n=8: @macroexpand begin @inbounds for i\_8 in eachindex(v\[8\])…

---

## [.julia folder in another place for julia 0.7](https://discourse.julialang.org/t/julia-folder-in-another-place-for-julia-0-7/12579)

<div class="topic-metadata">

**Author:** [@abobroff](https://discourse.julialang.org/u/abobroff)\
**Replies:** 2\
**Last updated:** [July 22, 2018, 12:47pm UTC](https://discourse.julialang.org/t/julia-folder-in-another-place-for-julia-0-7/12579 "2018-07-22T12:47:59Z")

</div>

How to create a depot .julia in another directory and not in “C:\\Users\\user\\.julia”. I use Windows 8, 10.

---

## [Finding row of approximate values in array](https://discourse.julialang.org/t/finding-row-of-approximate-values-in-array/12550)

<div class="topic-metadata">

**Author:** [@jazzieman](https://discourse.julialang.org/u/jazzieman)\
**Replies:** 7\
**Last updated:** [July 22, 2018, 11:36am UTC](https://discourse.julialang.org/t/finding-row-of-approximate-values-in-array/12550 "2018-07-22T11:36:02Z")

</div>

I have a row vector ‘a’ with a given coordinate (x, y, z) and I need to obtain the row in a coordinates array (B) with the coordinates are closest to the row vector ‘a’. I’ve been using a function that I found on the w…

---

## [Type instability in complex schurfact](https://discourse.julialang.org/t/type-instability-in-complex-schurfact/12566)

<div class="topic-metadata">

**Author:** [@BenjaminBorn](https://discourse.julialang.org/u/BenjaminBorn)\
**Replies:** 4\
**Last updated:** [July 22, 2018, 11:27am UTC](https://discourse.julialang.org/t/type-instability-in-complex-schurfact/12566 "2018-07-22T11:27:27Z")

</div>

Hello everyone, I’m trying to use a complex Schur decomposition and retrieve the generalized eigenvalues. A very much simplified example is here: const A = complex(randn(10,10)) const B = complex(randn(10,10)) functio…

---

## [Size not supported for arrays with axes (-671:-1, -546:138)](https://discourse.julialang.org/t/size-not-supported-for-arrays-with-axes-671-1-546-138/12576)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 3\
**Last updated:** [July 22, 2018, 8:55am UTC](https://discourse.julialang.org/t/size-not-supported-for-arrays-with-axes-671-1-546-138/12576 "2018-07-22T08:55:50Z")

</div>

I am not sure what I am doing wrong. This is my code: subs(img, t) = img\[1:round(Int, t):end, :\]; delT = sqrt(2); n = 5; b = 72; t\_all = \[delT^i for i in 0:5\]; k = 2; t = 2; theta = k\*b/t; tfm = LinearMap(RotMatrix(thet…

---

## [How to run this external cmd: echo "test" \>\> "test.txt"](https://discourse.julialang.org/t/how-to-run-this-external-cmd-echo-test-test-txt/12533)

<div class="topic-metadata">

**Author:** [@oniter](https://discourse.julialang.org/u/oniter)\
**Replies:** 2\
**Last updated:** [July 21, 2018, 8:17pm UTC](https://discourse.julialang.org/t/how-to-run-this-external-cmd-echo-test-test-txt/12533 "2018-07-21T20:17:22Z")

</div>

How to run exactly this shell cmd in julia? echo “test” \>\> “test.txt” Only halfway down is to use run(pipeline(echo "test",“test.txt”)) because it does not append to “test.txt”. Your help is very welcome. Thx.

---

## [Metaprogramming function with keyword argument](https://discourse.julialang.org/t/metaprogramming-function-with-keyword-argument/12551)

<div class="topic-metadata">

**Author:** [@lewis500](https://discourse.julialang.org/u/lewis500)\
**Replies:** 2\
**Last updated:** [July 21, 2018, 7:18pm UTC](https://discourse.julialang.org/t/metaprogramming-function-with-keyword-argument/12551 "2018-07-21T19:18:09Z")

</div>

I am trying to make a macro that will call a function with certain keyword arguments. For example, add(a;b=10) = a+b Now I can write z = :(b=20) parse("add(10,$z)")|\>eval and get the right answer. But if I write z …

---

## [Is it possible to use Pkg3 with Julia 0.6?](https://discourse.julialang.org/t/is-it-possible-to-use-pkg3-with-julia-0-6/12568)

<div class="topic-metadata">

**Author:** [@ajd](https://discourse.julialang.org/u/ajd)\
**Replies:** 1\
**Last updated:** [July 21, 2018, 7:11pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-pkg3-with-julia-0-6/12568 "2018-07-21T19:11:09Z")

</div>

I am trying to use Julia on a cluster where all of my persistent directories are accessed over NFS. Thus the package manager is basically unusable due to the well-documented slowness of Pkg2 on NFS. Is it possible to in…

---

## [Julia's GC vs. Go's GC (and more). Good idea to compile Julia to Go?](https://discourse.julialang.org/t/julias-gc-vs-gos-gc-and-more-good-idea-to-compile-julia-to-go/12496)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 3\
**Last updated:** [July 21, 2018, 4:07pm UTC](https://discourse.julialang.org/t/julias-gc-vs-gos-gc-and-more-good-idea-to-compile-julia-to-go/12496 "2018-07-21T16:07:06Z")

</div>

From the interesting keynote from the International Symposium on Memory Management (ISMM) on June 18, 2018: Again we kept knocking off these O(heap size) stop the world processes. We are talking about an 18Gbyte heap…

---

## [BinaryBuilder.jl updating library version and downloading dependencies](https://discourse.julialang.org/t/binarybuilder-jl-updating-library-version-and-downloading-dependencies/12562)

<div class="topic-metadata">

**Author:** [@isuruf](https://discourse.julialang.org/u/isuruf)\
**Replies:** 0\
**Last updated:** [July 21, 2018, 2:52pm UTC](https://discourse.julialang.org/t/binarybuilder-jl-updating-library-version-and-downloading-dependencies/12562 "2018-07-21T14:52:08Z")

</div>

Hi, I’m looking at switching from BinDeps.jl to BinaryProvider.jl and I have 2 questions and possible solutions, but I’m not sure whether they are the best solutions. How do I download dependencies of the binary depe…

---

## [Painful compile time](https://discourse.julialang.org/t/painful-compile-time/12549)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 4\
**Last updated:** [July 21, 2018, 1:20pm UTC](https://discourse.julialang.org/t/painful-compile-time/12549 "2018-07-21T13:20:52Z")

</div>

I have developed a big simulation system with Python+PyQt, and is changing some time-consuming tasks to Julia as the plugins. ZMQ is used for the data exchange between Python and Julia. The system developed using Pytho…

---

## [Error while solving differential equation](https://discourse.julialang.org/t/error-while-solving-differential-equation/12488)

<div class="topic-metadata">

**Author:** [@Alex\_Johnson](https://discourse.julialang.org/u/Alex_Johnson)\
**Replies:** 7\
**Last updated:** [July 21, 2018, 11:22am UTC](https://discourse.julialang.org/t/error-while-solving-differential-equation/12488 "2018-07-21T11:22:41Z")

</div>

While solving differential equation encountered this error: MethodError: objects of type Float64 are not callable This error is returned while using the solve() function of “Differential equations” package. What can b…

---

## [1.0 adoption path?](https://discourse.julialang.org/t/1-0-adoption-path/7922)

<div class="topic-metadata">

**Author:** [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Replies:** 74\
**Last updated:** [July 21, 2018, 10:28am UTC](https://discourse.julialang.org/t/1-0-adoption-path/7922 "2018-07-21T10:28:19Z")

</div>

\[note: moderator moved this post to new thread. It was in response to the following\] Makes total sense. I know this has been discussed, but I can’t find a cohesive description of the official release strategy. This …

---

## [Strange performance of a loop](https://discourse.julialang.org/t/strange-performance-of-a-loop/12504)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 37\
**Last updated:** [July 21, 2018, 9:49am UTC](https://discourse.julialang.org/t/strange-performance-of-a-loop/12504 "2018-07-21T09:49:45Z")

</div>

I’m not sure if this is known and was discussed before, but I noticed a performance difference (20% loss) when using m = size(a,1) for i = 1:m do something a\[i,k\] end than when using the literal constant 3 instead: …

---

## [KernelFactors.gaussian](https://discourse.julialang.org/t/kernelfactors-gaussian/12553)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 2\
**Last updated:** [July 21, 2018, 7:12am UTC](https://discourse.julialang.org/t/kernelfactors-gaussian/12553 "2018-07-21T07:12:18Z")

</div>

I have a doubt. In KernelFactors.gaussian I am trying to create a 1D gaussian kernel to convolve an image in vertical direction only, i.e. I need the kernel to be horizontal. If I define the kernel as: imfilter(img\_ar…

---

## [Subsampling an image by a factor](https://discourse.julialang.org/t/subsampling-an-image-by-a-factor/12518)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 11\
**Last updated:** [July 20, 2018, 10:13pm UTC](https://discourse.julialang.org/t/subsampling-an-image-by-a-factor/12518 "2018-07-20T22:13:59Z")

</div>

Hi! I am trying to subsample an image only in the vertical direction by a factor t (value is a geometric progression with common ratio sqrt(2)). Is there any built-in function to subsample images? I was thinking of res…

---

## [Read small text file as a string](https://discourse.julialang.org/t/read-small-text-file-as-a-string/12543)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 7\
**Last updated:** [July 20, 2018, 9:04pm UTC](https://discourse.julialang.org/t/read-small-text-file-as-a-string/12543 "2018-07-20T21:04:56Z")

</div>

This works in a code file where fname is a string that is a path to a file: println(read(fname, String)) But, it doesn’t work in the REPL. Weird. Shouldn’t it be the same for both? I copy it from the code file and p…

---

## [Static arrays and type stability under map](https://discourse.julialang.org/t/static-arrays-and-type-stability-under-map/12538)

<div class="topic-metadata">

**Author:** [@vlc](https://discourse.julialang.org/u/vlc)\
**Replies:** 8\
**Last updated:** [July 20, 2018, 8:55pm UTC](https://discourse.julialang.org/t/static-arrays-and-type-stability-under-map/12538 "2018-07-20T20:55:38Z")

</div>

Hello, I’ve been surprised by the return type of the mapping of a type stable function on a couple of static arrays. Here is a minimal example, first with regular arrays julia\> n = 4; julia\> bool = rand(Bool, n); ju…

---

## [Type inference in closures](https://discourse.julialang.org/t/type-inference-in-closures/12544)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 6\
**Last updated:** [July 20, 2018, 8:48pm UTC](https://discourse.julialang.org/t/type-inference-in-closures/12544 "2018-07-20T20:48:46Z")

</div>

Is there any way to make Julia properly infer types in this code: function f() x = 0 l = Threads.SpinLock() Threads.@threads for i in 1:Threads.nthreads() Threads.lock(l) x = x + i T…

---

## [Subranges of general indexes](https://discourse.julialang.org/t/subranges-of-general-indexes/12534)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [July 20, 2018, 7:29pm UTC](https://discourse.julialang.org/t/subranges-of-general-indexes/12534 "2018-07-20T19:29:05Z")

</div>

This comes from a more general problem, but for an MWE, consider a function that returns the indices of a vector where one element is not equal to the previous one. I want it to work for general indexes, so I wrote it as …

---

## [Replace docstring for signatures like AbstractMatrix{\<:Real}](https://discourse.julialang.org/t/replace-docstring-for-signatures-like-abstractmatrix-real/12541)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 0\
**Last updated:** [July 20, 2018, 3:45pm UTC](https://discourse.julialang.org/t/replace-docstring-for-signatures-like-abstractmatrix-real/12541 "2018-07-20T15:45:05Z")

</div>

I would like to replace doc strings for i18n purpose. GitHub - Roger-luo/Localize.jl: Utils for localization of Julia documents However, the replace! function I used works for most of the functions, but I cannot replace…

---

## [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…

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

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