# General Usage

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

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

**Page:** 1019

---

## [Detect corners of different scales](https://discourse.julialang.org/t/detect-corners-of-different-scales/6740)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [October 28, 2017, 12:11pm UTC](https://discourse.julialang.org/t/detect-corners-of-different-scales/6740 "2017-10-28T12:11:48Z")

</div>

Are there any settings in Images.imcorner that “tune” the scale or radius of the corners being detected? I tried setting blockSize here but I can’t get it to work… For example, I’d like to detect the corners of the larg…

---

## [IntSet crashes Julia 0.6.1](https://discourse.julialang.org/t/intset-crashes-julia-0-6-1/6727)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 7\
**Last updated:** [October 28, 2017, 7:22am UTC](https://discourse.julialang.org/t/intset-crashes-julia-0-6-1/6727 "2017-10-28T07:22:17Z")

</div>

Dearests, The following julia\> N=2^10; a= rand(UInt64,N); sa=IntSet(a); #gives an error ... which is fine ERROR: InexactError() .... julia\> a= rand(UInt32,N); sa=IntSet(a); #now the system crashes signal (11): Segmen…

---

## [Julia compile failing with 403 Forbidden](https://discourse.julialang.org/t/julia-compile-failing-with-403-forbidden/6714)

<div class="topic-metadata">

**Author:** [@Phil\_Tomson](https://discourse.julialang.org/u/Phil_Tomson)\
**Replies:** 3\
**Last updated:** [October 27, 2017, 10:30pm UTC](https://discourse.julialang.org/t/julia-compile-failing-with-403-forbidden/6714 "2017-10-27T22:30:11Z")

</div>

I was trying to build Julia from source on an Ubuntu 17.10 system and I’m seeing messages like the following when it tries to download various source packages: Resolving cache.julialang.org (cache.julialang.org)… 34.207…

---

## [How to reindex a linear array for cartesian usage?](https://discourse.julialang.org/t/how-to-reindex-a-linear-array-for-cartesian-usage/6723)

<div class="topic-metadata">

**Author:** [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)\
**Replies:** 2\
**Last updated:** [October 27, 2017, 4:20pm UTC](https://discourse.julialang.org/t/how-to-reindex-a-linear-array-for-cartesian-usage/6723 "2017-10-27T16:20:56Z")

</div>

Hello, I’d like to use a Package and the underlying arrays are 2-D. I’m hoping make a new type that uses these 2-D based types, but I’d like the usage of my types to be N-dimensional. I think I can do this with sub2in…

---

## [How to get Dates.Period without label?](https://discourse.julialang.org/t/how-to-get-dates-period-without-label/6718)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 8\
**Last updated:** [October 27, 2017, 2:13pm UTC](https://discourse.julialang.org/t/how-to-get-dates-period-without-label/6718 "2017-10-27T14:13:34Z")

</div>

Hot to get period like this : 16363320000 without label “milliseconds” ? Dates.period(t2-t1) not works… (Julia 5.0) julia\> Dates.Period(t2-t1) 16363320000 milliseconds julia\> Dates.period(t2-t1) ERROR: UndefVarErro…

---

## [How to save both command history and system outputs automatically?](https://discourse.julialang.org/t/how-to-save-both-command-history-and-system-outputs-automatically/6715)

<div class="topic-metadata">

**Author:** [@BVPs](https://discourse.julialang.org/u/BVPs)\
**Replies:** 0\
**Last updated:** [October 27, 2017, 12:30am UTC](https://discourse.julialang.org/t/how-to-save-both-command-history-and-system-outputs-automatically/6715 "2017-10-27T00:30:57Z")

</div>

We know that ~/.julia\_history file saves all the commands we entered in all of our julia sessions. However, it does not save the actual outputs returned from julia. I want to save the whole session sequence both input co…

---

## [Unexpected multiple dispatch behaviour](https://discourse.julialang.org/t/unexpected-multiple-dispatch-behaviour/6700)

<div class="topic-metadata">

**Author:** [@Jan\_Dolinsky](https://discourse.julialang.org/u/Jan_Dolinsky)\
**Replies:** 6\
**Last updated:** [October 26, 2017, 9:28pm UTC](https://discourse.julialang.org/t/unexpected-multiple-dispatch-behaviour/6700 "2017-10-26T21:28:26Z")

</div>

Hello, I define the following two methods: u = \[\[1,1,1,1\], \[5,5\]\] f(u::Vector{\<:Number}) = println("here!") f(u::Vector{Vector{\<:Number}}) = println("there!") Dispatching f() on a vector of numbers works. f(u\[1\]) he…

---

## [Programming paradigm for handles](https://discourse.julialang.org/t/programming-paradigm-for-handles/6706)

<div class="topic-metadata">

**Author:** [@sambitdash](https://discourse.julialang.org/u/sambitdash)\
**Replies:** 6\
**Last updated:** [October 26, 2017, 9:06pm UTC](https://discourse.julialang.org/t/programming-paradigm-for-handles/6706 "2017-10-26T21:06:27Z")

</div>

Many a times you provide opaque structures to objects which you do not expect the library user to understand nor modify. These are typically object oriented proxy pattern or similar structures. For example, in Windows al…

---

## [Relative path sanitization](https://discourse.julialang.org/t/relative-path-sanitization/6696)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [October 26, 2017, 12:02pm UTC](https://discourse.julialang.org/t/relative-path-sanitization/6696 "2017-10-26T12:02:33Z")

</div>

I am trying to write a function that resolves a path (provided by the user) relative to a directory, ensuring that the result is inside the directory. The one below seems to work, but I am counting on community eyeballs …

---

## [Macro to overload Base operators](https://discourse.julialang.org/t/macro-to-overload-base-operators/6698)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon](https://discourse.julialang.org/u/Philippe_Maincon)\
**Replies:** 4\
**Last updated:** [October 26, 2017, 11:18am UTC](https://discourse.julialang.org/t/macro-to-overload-base-operators/6698 "2017-10-26T11:18:04Z")

</div>

I wish to generate code like Base.:(\<)(a::∂ℝ{N},b::∂ℝ{N}) where{N} = \<(a.x,b.x) for all possible operators, and all sorts of combinations of input types. I need the “Base.” qualifier because I am in a module. I write …

---

## [Misleading error message when initializing Dict](https://discourse.julialang.org/t/misleading-error-message-when-initializing-dict/6695)

<div class="topic-metadata">

**Author:** [@klacru](https://discourse.julialang.org/u/klacru)\
**Replies:** 2\
**Last updated:** [October 26, 2017, 9:16am UTC](https://discourse.julialang.org/t/misleading-error-message-when-initializing-dict/6695 "2017-10-26T09:16:33Z")

</div>

The following ERROR seems to have a misleading text. Actually a , is missing before :B. Same for Version 0.7.0-DEV.2276 . Obviously the second colon is parsed as a binary operator. Wouldn’t it be a good idea to disall…

---

## [How to define a function that remembers values?](https://discourse.julialang.org/t/how-to-define-a-function-that-remembers-values/6667)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 5\
**Last updated:** [October 26, 2017, 8:39am UTC](https://discourse.julialang.org/t/how-to-define-a-function-that-remembers-values/6667 "2017-10-26T08:39:12Z")

</div>

I have a function that is very expensive to compute, fun(x). But I might be calling it on the same argument multiple times. Therefore it would be helpful if the function was able to store somehwere the result it obtained…

---

## [Memory leaking with threading](https://discourse.julialang.org/t/memory-leaking-with-threading/6677)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 1\
**Last updated:** [October 26, 2017, 8:33am UTC](https://discourse.julialang.org/t/memory-leaking-with-threading/6677 "2017-10-26T08:33:54Z")

</div>

Hi, I adapted Flux.jl to calculate gradinets using multiple threads. The approach is relatively simple, as I divide the minibatch in approximately equal sizes and let each thread calculate the gradient on the minibatch …

---

## [Misleading Module docs for using and importall](https://discourse.julialang.org/t/misleading-module-docs-for-using-and-importall/6688)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 2\
**Last updated:** [October 26, 2017, 7:30am UTC](https://discourse.julialang.org/t/misleading-module-docs-for-using-and-importall/6688 "2017-10-26T07:30:42Z")

</div>

I was looking at the examples from https://docs.julialang.org/en/stable/manual/modules/#Summary-of-module-usage-1 and the “What is brought into scope” info for “importall MyModule” doesn’t seem to be right (at least not …

---

## [Iterating on regressions using GLM](https://discourse.julialang.org/t/iterating-on-regressions-using-glm/6686)

<div class="topic-metadata">

**Author:** [@mathtd](https://discourse.julialang.org/u/mathtd)\
**Replies:** 4\
**Last updated:** [October 26, 2017, 12:29am UTC](https://discourse.julialang.org/t/iterating-on-regressions-using-glm/6686 "2017-10-26T00:29:24Z")

</div>

I have a large number of OLS regressions to run. I’m hoping to do this using the GLM package but I need to find a way to iterate over regressions easily. I’m hoping to do something like the following: for i=1:n reg\_…

---

## [Default constructor more strict for parametric type?](https://discourse.julialang.org/t/default-constructor-more-strict-for-parametric-type/6690)

<div class="topic-metadata">

**Author:** [@ggggggggg](https://discourse.julialang.org/u/ggggggggg)\
**Replies:** 1\
**Last updated:** [October 25, 2017, 11:30pm UTC](https://discourse.julialang.org/t/default-constructor-more-strict-for-parametric-type/6690 "2017-10-25T23:30:32Z")

</div>

Why can’t B accept two Int arguments, when A can? The answer is that a method A(a,b) exists, but a method B(a::T, b) where T\<:Real does not exist. Is there a good reason for that? I have some code where I have many membe…

---

## [Performing arithmetic operations in quadruple precision](https://discourse.julialang.org/t/performing-arithmetic-operations-in-quadruple-precision/4265)

<div class="topic-metadata">

**Author:** [@michakraus](https://discourse.julialang.org/u/michakraus)\
**Replies:** 12\
**Last updated:** [October 25, 2017, 8:40pm UTC](https://discourse.julialang.org/t/performing-arithmetic-operations-in-quadruple-precision/4265 "2017-10-25T20:40:17Z")

</div>

I need to compute simple arithmetic expressions with +,-,\*,/,√ in quadruple precision using DecFP where the various coefficients are hard-coded. In order to get an accurate result, all numbers have to be converted to De…

---

## [Dot product of two tuples](https://discourse.julialang.org/t/dot-product-of-two-tuples/6683)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 6\
**Last updated:** [October 25, 2017, 7:30pm UTC](https://discourse.julialang.org/t/dot-product-of-two-tuples/6683 "2017-10-25T19:30:08Z")

</div>

Any particular reason for the dot product of two tuples to be undefined (v0.6)? Similarly for norm, or cross. julia\> dot((1, 3, 2), (1, 3, 2)) ERROR: MethodError: no method matching dot(::Tuple{Int64,Int64}, ::Tuple{Int…

---

## [User defaults in a package](https://discourse.julialang.org/t/user-defaults-in-a-package/6596)

<div class="topic-metadata">

**Author:** [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Replies:** 6\
**Last updated:** [October 22, 2017, 6:31am UTC](https://discourse.julialang.org/t/user-defaults-in-a-package/6596 "2017-10-22T06:31:06Z")

</div>

I’m currently working on a package that makes dealing with various inputs and outputs of DFT calculations easier. Since the workflow of most people doing these calculations on a daily basis involve a number of default s…

---

## [The sorting of Tuples](https://discourse.julialang.org/t/the-sorting-of-tuples/6682)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 3\
**Last updated:** [October 25, 2017, 7:16pm UTC](https://discourse.julialang.org/t/the-sorting-of-tuples/6682 "2017-10-25T19:16:36Z")

</div>

If I have an array of tuples, all of type Tuple{Int, X, X} where X is any other type. When I sort them with julia’s sort! api, can I rely on it to sort them by the first Int (I want the first Int to be treated as a rank)…

---

## [Pass data structures across different versions of Julia?](https://discourse.julialang.org/t/pass-data-structures-across-different-versions-of-julia/6681)

<div class="topic-metadata">

**Author:** [@rwgardner](https://discourse.julialang.org/u/rwgardner)\
**Replies:** 1\
**Last updated:** [October 25, 2017, 5:42pm UTC](https://discourse.julialang.org/t/pass-data-structures-across-different-versions-of-julia/6681 "2017-10-25T17:42:36Z")

</div>

I have one piece of code I don’t control in Julia 0.3.12. I have another piece of code that I control that I would like to keep with roughly the latest julia. I need these pieces of code to exchange data fast. For exa…

---

## [BenchmarkTools: getting UndevVarError \`@\_\_MODULE\_\_\`](https://discourse.julialang.org/t/benchmarktools-getting-undevvarerror---module--/6680)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 3\
**Last updated:** [October 25, 2017, 3:45pm UTC](https://discourse.julialang.org/t/benchmarktools-getting-undevvarerror---module--/6680 "2017-10-25T15:45:29Z")

</div>

Whenever I call any macro from BenchmarkTools (latest tagged release) I get an UndefVarError for @\_\_MODULE\_\_. There is no stack trace. There doesn’t seem to be an issue on the github, so it seems something strange is g…

---

## [Why does \`similar(::SharedArray)\` create an \`Array\`?](https://discourse.julialang.org/t/why-does-similar-sharedarray-create-an-array/6673)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 2\
**Last updated:** [October 25, 2017, 8:48am UTC](https://discourse.julialang.org/t/why-does-similar-sharedarray-create-an-array/6673 "2017-10-25T08:48:45Z")

</div>

Consider the following example: julia\> u0 = SharedArray{Float64}(2,3) 2×3 SharedArray{Float64,2}: 0.0 0.0 0.0 0.0 0.0 0.0 julia\> u1 = copy(u0) 2×3 Array{Float64,2}: 0.0 0.0 0.0 0.0 0.0 0.0 I would have exp…

---

## [How to dispatch on non-vararg Tuple types](https://discourse.julialang.org/t/how-to-dispatch-on-non-vararg-tuple-types/6656)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [October 25, 2017, 8:36am UTC](https://discourse.julialang.org/t/how-to-dispatch-on-non-vararg-tuple-types/6656 "2017-10-25T08:36:37Z")

</div>

Is it possible? What should replace QUESTION in the code below? f(::Type{QUESTION}) = true f(Tuple{Int,Int}) # true f(Tuple{Float64,Vararg{Int}}) # should throw MethodError

---

## [Problem with github PR on Julia/METADATA](https://discourse.julialang.org/t/problem-with-github-pr-on-julia-metadata/6644)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 7\
**Last updated:** [October 25, 2017, 5:45am UTC](https://discourse.julialang.org/t/problem-with-github-pr-on-julia-metadata/6644 "2017-10-25T05:45:04Z")

</div>

First things first: I’m not great with github. The PR in question is here. So, I was attempting to tag and update a new version of my package DependentBootstrap that fixes all deprecation warnings for v0.6 (and hopefull…

---

## [Quit() takes a long time to run](https://discourse.julialang.org/t/quit-takes-a-long-time-to-run/6646)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 7\
**Last updated:** [October 24, 2017, 11:51pm UTC](https://discourse.julialang.org/t/quit-takes-a-long-time-to-run/6646 "2017-10-24T23:51:45Z")

</div>

Hi all, Julia v0.6 on Ubuntu 16.04 LTS. Does anyone know why quit() would take a long time to execute? By “long-time” I mean many minutes, with one CPU running at 100%. I haven’t been able to isolate a MWE yet, since …

---

## [Performance issues with Boolean dot operators](https://discourse.julialang.org/t/performance-issues-with-boolean-dot-operators/6665)

<div class="topic-metadata">

**Author:** [@rcnlee](https://discourse.julialang.org/u/rcnlee)\
**Replies:** 5\
**Last updated:** [October 24, 2017, 10:19pm UTC](https://discourse.julialang.org/t/performance-issues-with-boolean-dot-operators/6665 "2017-10-24T22:19:34Z")

</div>

I’m seeing poor performance in Boolean dot operators, such as .& and .!. Please see below. Any ideas why? Thanks! julia\> using BenchmarkTools julia\> x, y = rand(Bool,100), rand(Bool,100) (Bool\[false, true, true, tru…

---

## [Fortran to Julia structs with strings](https://discourse.julialang.org/t/fortran-to-julia-structs-with-strings/6662)

<div class="topic-metadata">

**Author:** [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Replies:** 2\
**Last updated:** [October 24, 2017, 9:22pm UTC](https://discourse.julialang.org/t/fortran-to-julia-structs-with-strings/6662 "2017-10-24T21:22:18Z")

</div>

Hello all, I am having trouble interfacing structs between Julia and Fortran. After reading around, I figured that the best way is to use iso\_c\_binding and that Fortran strings are not portable (is that true?), so I wen…

---

## [Why is this code so slow in julia compared to a numpy implementation?](https://discourse.julialang.org/t/why-is-this-code-so-slow-in-julia-compared-to-a-numpy-implementation/6660)

<div class="topic-metadata">

**Author:** [@ksmet1977](https://discourse.julialang.org/u/ksmet1977)\
**Replies:** 9\
**Last updated:** [October 24, 2017, 5:11pm UTC](https://discourse.julialang.org/t/why-is-this-code-so-slow-in-julia-compared-to-a-numpy-implementation/6660 "2017-10-24T17:11:36Z")

</div>

I have implemented some mathematical models in Python that require basic operation like scalar multiplication, summing, raising power, etc. of arrays (upto 3d) and scalars. I find that my Julia code is substantially slo…

---

## [Colored STDOUT in Juno?](https://discourse.julialang.org/t/colored-stdout-in-juno/6645)

<div class="topic-metadata">

**Author:** [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Replies:** 2\
**Last updated:** [October 24, 2017, 3:19pm UTC](https://discourse.julialang.org/t/colored-stdout-in-juno/6645 "2017-10-24T15:19:01Z")

</div>

I see that the atom-ink console can colorize ANSI codes, but I can’t figure out what setting to use to get Julia to print in color. I’ve tried setting color=yes as an argument in the preferences, and also tried adding ev…

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

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