# General Usage

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

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

**Page:** 984

---

## [Julia calls the old method after method is redefined](https://discourse.julialang.org/t/julia-calls-the-old-method-after-method-is-redefined/10327)

<div class="topic-metadata">

**Author:** [@s-broda](https://discourse.julialang.org/u/s-broda)\
**Replies:** 8\
**Last updated:** [April 16, 2018, 8:46pm UTC](https://discourse.julialang.org/t/julia-calls-the-old-method-after-method-is-redefined/10327 "2018-04-16T20:46:06Z")

</div>

Hi all. I’m not sure if this is a bug or if I’m missing something. Essentially, Julia keeps calling the old method after I have redefined it. I have a vague feeling that this may have to do with issue 265 or its fix, and…

---

## [How to precompile all modules?](https://discourse.julialang.org/t/how-to-precompile-all-modules/4802)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 5\
**Last updated:** [April 16, 2018, 3:30am UTC](https://discourse.julialang.org/t/how-to-precompile-all-modules/4802 "2018-04-16T03:30:16Z")

</div>

Hello. How can I precompile all modules in Julia from my first session instead of waiting for a while everytime Julia uses a new module? Is there any fast way to install all Julia available packages or the most common …

---

## [ReverseDiff function type specification](https://discourse.julialang.org/t/reversediff-function-type-specification/10350)

<div class="topic-metadata">

**Author:** [@mopg](https://discourse.julialang.org/u/mopg)\
**Replies:** 6\
**Last updated:** [April 16, 2018, 12:19am UTC](https://discourse.julialang.org/t/reversediff-function-type-specification/10350 "2018-04-16T00:19:12Z")

</div>

I’m using ReverseDiff in my project, but am wondering how to speed up my implementation. Specifically, I cannot specify the type of my inputs to the function I want to get the gradient of, which slows other parts of the …

---

## [Why is this malformed? / Julia v0.7](https://discourse.julialang.org/t/why-is-this-malformed-julia-v0-7/10354)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [April 15, 2018, 10:28pm UTC](https://discourse.julialang.org/t/why-is-this-malformed-julia-v0-7/10354 "2018-04-15T22:28:51Z")

</div>

Hi fellows I am having the following problem. Can you point out why? julia\> if\_st($(Expr(:copyast, :($(QuoteNode(:(y \> 6)))))), $(Expr(:copyast, :($(QuoteNode(:(y += 3)))))), $(Expr(:copyast, :($(QuoteNode(:(y -= 2)))…

---

## [How to avoid space removal in docstrings?](https://discourse.julialang.org/t/how-to-avoid-space-removal-in-docstrings/10353)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 2\
**Last updated:** [April 15, 2018, 5:53pm UTC](https://discourse.julialang.org/t/how-to-avoid-space-removal-in-docstrings/10353 "2018-04-15T17:53:50Z")

</div>

I am trying to add the following docstring to a function, but when I call help, all the spaces get removed and the art collapses, any idea how to get this right? """ ///++++++++++++++++++++++++++++++++++ ///+ …

---

## [Problem using PyCall with Parallel Computing on Julia 0.6.2](https://discourse.julialang.org/t/problem-using-pycall-with-parallel-computing-on-julia-0-6-2/9745)

<div class="topic-metadata">

**Author:** [@dompas](https://discourse.julialang.org/u/dompas)\
**Replies:** 14\
**Last updated:** [April 15, 2018, 2:56pm UTC](https://discourse.julialang.org/t/problem-using-pycall-with-parallel-computing-on-julia-0-6-2/9745 "2018-04-15T14:56:02Z")

</div>

Hi, I had developed a program using Julia 0.6.0 and it was working just fine, but then I updated my Julia to 0.6.2 my program started to crash. After trouble shooting and seeing some solutions on the internet my program…

---

## [Sum(abs2, v) slow for complex vector](https://discourse.julialang.org/t/sum-abs2-v-slow-for-complex-vector/10348)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 3\
**Last updated:** [April 15, 2018, 8:19am UTC](https://discourse.julialang.org/t/sum-abs2-v-slow-for-complex-vector/10348 "2018-04-15T08:19:59Z")

</div>

I have been thinking that sum(abs2, v) is a more efficient way to calculate the sum of the absolute squares of the entries of a vector v than v⋅v. It is indeed a case for a real vector: julia\> VERSION v"0.6.3-pre.0" j…

---

## [How to create JuliaDB table from DataFrame?](https://discourse.julialang.org/t/how-to-create-juliadb-table-from-dataframe/10334)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 2\
**Last updated:** [April 15, 2018, 6:31am UTC](https://discourse.julialang.org/t/how-to-create-juliadb-table-from-dataframe/10334 "2018-04-15T06:31:39Z")

</div>

I thought it would be easy but… julia\> df = DataFrame(x = \[1,2,3\], y = \[4,5,6\]) 3×2 DataFrames.DataFrame │ Row │ x │ y │ ├─────┼───┼───┤ │ 1 │ 1 │ 4 │ │ 2 │ 2 │ 5 │ │ 3 │ 3 │ 6 │ julia\> t = table(df) ERROR: Argum…

---

## [Global variable declaration](https://discourse.julialang.org/t/global-variable-declaration/10347)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [April 15, 2018, 2:10am UTC](https://discourse.julialang.org/t/global-variable-declaration/10347 "2018-04-15T02:10:28Z")

</div>

Hi, I am having following problem, I don’t understand why though. Can anybody help julia\> let global d1, d2=3, d3::Int, d4::AbstractString = "ddd" end ERROR: syntax: invalid assignment location "3"

---

## [Default constructor for parametric types in 0.7](https://discourse.julialang.org/t/default-constructor-for-parametric-types-in-0-7/10344)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 2\
**Last updated:** [April 15, 2018, 12:57am UTC](https://discourse.julialang.org/t/default-constructor-for-parametric-types-in-0-7/10344 "2018-04-15T00:57:02Z")

</div>

Hi, this no longer works in v 0.7 what is the proper way to do this? julia\> struct XDD{T} x::T XDD() = new{T}() end julia\> a= XDD{Int}() ERROR: MethodError: no method matching XDD{Int64…

---

## [Baffling ERROR: LoadError: type DataType has no field contents](https://discourse.julialang.org/t/baffling-error-loaderror-type-datatype-has-no-field-contents/10333)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 1\
**Last updated:** [April 14, 2018, 7:39pm UTC](https://discourse.julialang.org/t/baffling-error-loaderror-type-datatype-has-no-field-contents/10333 "2018-04-14T19:39:41Z")

</div>

the following is not at all important. I know it works if the Point initializer method is outside the function. this is pure curiosity. why would the following not work? mutable struct Point; x::Float64; end#struct …

---

## [Why is Vector{Float64} much faster than Vector{Float32}?](https://discourse.julialang.org/t/why-is-vector-float64-much-faster-than-vector-float32/10328)

<div class="topic-metadata">

**Author:** [@jinliangwei](https://discourse.julialang.org/u/jinliangwei)\
**Replies:** 5\
**Last updated:** [April 14, 2018, 5:52pm UTC](https://discourse.julialang.org/t/why-is-vector-float64-much-faster-than-vector-float32/10328 "2018-04-14T17:52:19Z")

</div>

I have two programs that are almost identical except that in one program I used Float32 vectors or arrays while in the other one I used Float64. The Float64 program (named prog\_f64.jl) is about 5x faster than the Float32…

---

## [Construct object of type whose type is UnionAll](https://discourse.julialang.org/t/construct-object-of-type-whose-type-is-unionall/10332)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 5\
**Last updated:** [April 14, 2018, 5:37pm UTC](https://discourse.julialang.org/t/construct-object-of-type-whose-type-is-unionall/10332 "2018-04-14T17:37:31Z")

</div>

The following does what I want julia\> (Dict{T,V} where {T,V})() Dict{Any,Any} with 0 entries It seems reasonable that this julia\> (Dict{T,Int} where T)() ERROR: MethodError: no method matching Dict{T,Int64} where T()…

---

## [Content Copy (.= Operator) for Composite Types (structs)?](https://discourse.julialang.org/t/content-copy-operator-for-composite-types-structs/10330)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 3\
**Last updated:** [April 14, 2018, 4:04pm UTC](https://discourse.julialang.org/t/content-copy-operator-for-composite-types-structs/10330 "2018-04-14T16:04:17Z")

</div>

For arrays, we have a beautiful new .= operator that copies the contents of the right to the left. For structs, this is not working: julia\> mutable struct Point; x; y; end#struct julia\> p= Point(2,3) Point(2, 3) juli…

---

## [Possibility of a generically sized vector of 1s and 0s similar to the UniformScalingOperator in Juila v0.7](https://discourse.julialang.org/t/possibility-of-a-generically-sized-vector-of-1s-and-0s-similar-to-the-uniformscalingoperator-in-juila-v0-7/10297)

<div class="topic-metadata">

**Author:** [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Replies:** 17\
**Last updated:** [April 14, 2018, 4:44am UTC](https://discourse.julialang.org/t/possibility-of-a-generically-sized-vector-of-1s-and-0s-similar-to-the-uniformscalingoperator-in-juila-v0-7/10297 "2018-04-14T04:44:17Z")

</div>

I love the generically sized I as the UniformScaling operator in Julia. It makes linear algebra code elegant (and I suspect either efficient now or in the future) Another common element that comes up in linear algebra …

---

## [QR decomposition in julia 2x slower than octave](https://discourse.julialang.org/t/qr-decomposition-in-julia-2x-slower-than-octave/10043)

<div class="topic-metadata">

**Author:** [@mrcinv](https://discourse.julialang.org/u/mrcinv)\
**Replies:** 17\
**Last updated:** [April 14, 2018, 2:34am UTC](https://discourse.julialang.org/t/qr-decomposition-in-julia-2x-slower-than-octave/10043 "2018-04-14T02:34:48Z")

</div>

I noticed that QR decomposition is 2x slower in julia than octave. For example on my computer I get julia\> A = rand(5000, 5000); @time qr(A); 27.075522 seconds (37 allocations: 765.687 MiB, 0.83% gc time) and \>\> A=ra…

---

## [Nightly builds from copr missing a dependency on Fedora / CentOS / RHEL etc](https://discourse.julialang.org/t/nightly-builds-from-copr-missing-a-dependency-on-fedora-centos-rhel-etc/9857)

<div class="topic-metadata">

**Author:** [@nsmith](https://discourse.julialang.org/u/nsmith)\
**Replies:** 5\
**Last updated:** [April 13, 2018, 9:38pm UTC](https://discourse.julialang.org/t/nightly-builds-from-copr-missing-a-dependency-on-fedora-centos-rhel-etc/9857 "2018-04-13T21:38:25Z")

</div>

The copr repository for nightly julia builds seems to be missing a dependency. Error: Error during initialization of module CHOLMOD │ exception = │ could not load library "libcholmod" │ libcholmod.so: cannot op…

---

## [Adding unregistered packages to JuliaRegistries/Uncurrated](https://discourse.julialang.org/t/adding-unregistered-packages-to-juliaregistries-uncurrated/10312)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 5\
**Last updated:** [April 13, 2018, 2:10pm UTC](https://discourse.julialang.org/t/adding-unregistered-packages-to-juliaregistries-uncurrated/10312 "2018-04-13T14:10:41Z")

</div>

I’d like to add the rest of the packages in the JuliaString org (besides ICU.jl, which is now the registered version since the previous one was not being maintained and is already in the new structure) to the Uncurrated …

---

## [What is the "NULL" function?](https://discourse.julialang.org/t/what-is-the-null-function/10313)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 4\
**Last updated:** [April 13, 2018, 1:30pm UTC](https://discourse.julialang.org/t/what-is-the-null-function/10313 "2018-04-13T13:30:47Z")

</div>

dear julia wizards: What is the equivalent of the NULL function to use as a default assignment when typing a function as an argument? by analogy, consider this first: julia\> work(x::Float64=NaN)= ( println("entering")…

---

## [Feature request: type assertion for compiler-known type](https://discourse.julialang.org/t/feature-request-type-assertion-for-compiler-known-type/10305)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 21\
**Last updated:** [April 13, 2018, 1:17pm UTC](https://discourse.julialang.org/t/feature-request-type-assertion-for-compiler-known-type/10305 "2018-04-13T13:17:57Z")

</div>

Suppose I have an assignment statement like this: a = Complex{typeof(b)}(b+1.) Suppose furthermore that I think that the compiler ought to be able to deduce the exact type of a (for type stability). But how can I …

---

## [Automating backward or forward elimination of features for a multiple linear regression problem](https://discourse.julialang.org/t/automating-backward-or-forward-elimination-of-features-for-a-multiple-linear-regression-problem/10323)

<div class="topic-metadata">

**Author:** [@fdabhi](https://discourse.julialang.org/u/fdabhi)\
**Replies:** 0\
**Last updated:** [April 13, 2018, 12:33pm UTC](https://discourse.julialang.org/t/automating-backward-or-forward-elimination-of-features-for-a-multiple-linear-regression-problem/10323 "2018-04-13T12:33:55Z")

</div>

Trying to replicate the code in python found here and here Using GLM package to fit the model Was able to store the P values inside a variable by using the method described here Question is how do you access the colum…

---

## [Examples of Multiple Linear Regression using Tensorflow in Julia](https://discourse.julialang.org/t/examples-of-multiple-linear-regression-using-tensorflow-in-julia/10322)

<div class="topic-metadata">

**Author:** [@fdabhi](https://discourse.julialang.org/u/fdabhi)\
**Replies:** 0\
**Last updated:** [April 13, 2018, 12:33pm UTC](https://discourse.julialang.org/t/examples-of-multiple-linear-regression-using-tensorflow-in-julia/10322 "2018-04-13T12:33:44Z")

</div>

i am new to Julia. I cannot find any example of Multiple Linear Regression using Tensorflow in Julia. There is a logistic regression example here which is a bit complicated to me. Can someone point out if there is an …

---

## [Iterate for previous and current elements](https://discourse.julialang.org/t/iterate-for-previous-and-current-elements/10321)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 1\
**Last updated:** [April 13, 2018, 11:05am UTC](https://discourse.julialang.org/t/iterate-for-previous-and-current-elements/10321 "2018-04-13T11:05:11Z")

</div>

I’m getting greedy here, but you might have a better way to do this. Say I want to go through some collection (e.g. a = 1:5) but retrieve the current element and the previous one as well. There are two ways I can think …

---

## [Reading lots of variables and passing them to JuMP model's variables and constraints automatically](https://discourse.julialang.org/t/reading-lots-of-variables-and-passing-them-to-jump-models-variables-and-constraints-automatically/10301)

<div class="topic-metadata">

**Author:** [@jakub](https://discourse.julialang.org/u/jakub)\
**Replies:** 1\
**Last updated:** [April 13, 2018, 7:52am UTC](https://discourse.julialang.org/t/reading-lots-of-variables-and-passing-them-to-jump-models-variables-and-constraints-automatically/10301 "2018-04-13T07:52:49Z")

</div>

Hi! Let’s say that I have a dataframe (created from CSV) that looks like this but has a hundreds of variables: And I want to create a set of variables and equations for JuMP in a way that model that look like that (a…

---

## [Pkg.update fails on windows 7 with private repository](https://discourse.julialang.org/t/pkg-update-fails-on-windows-7-with-private-repository/10282)

<div class="topic-metadata">

**Author:** [@spuhlerd](https://discourse.julialang.org/u/spuhlerd)\
**Replies:** 3\
**Last updated:** [April 13, 2018, 7:32am UTC](https://discourse.julialang.org/t/pkg-update-fails-on-windows-7-with-private-repository/10282 "2018-04-13T07:32:43Z")

</div>

Hi everyone, I’m have a private package on GitLab. When I run Pkg.update() Julia is asking for the credentials of this repository. This works fine on Linux and Windows 10, however causes Julia to crash on Windows 7 Ente…

---

## [Emacs Julia Ess with C-\` for next-error](https://discourse.julialang.org/t/emacs-julia-ess-with-c-for-next-error/10296)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 4\
**Last updated:** [April 13, 2018, 12:40am UTC](https://discourse.julialang.org/t/emacs-julia-ess-with-c-for-next-error/10296 "2018-04-13T00:40:00Z")

</div>

dear julia experts—I believe I am running the correct emacs ess for julia, on emacs 24.5.1, macOS. nice julia syntax highlighting and indenting. alas, the c-x \` (next error) does not work. instead of going to the erro…

---

## [Terminal emacs woes: paste julia output gives char-or-string-p error, \\u2502 displays, etc](https://discourse.julialang.org/t/terminal-emacs-woes-paste-julia-output-gives-char-or-string-p-error-u2502-displays-etc/8981)

<div class="topic-metadata">

**Author:** [@ivo\_welch](https://discourse.julialang.org/u/ivo_welch)\
**Replies:** 6\
**Last updated:** [April 12, 2018, 5:10am UTC](https://discourse.julialang.org/t/terminal-emacs-woes-paste-julia-output-gives-char-or-string-p-error-u2502-displays-etc/8981 "2018-04-12T05:10:26Z")

</div>

this is not a julia problem, but an emacs (utf8) problem using julia, but I was hoping someone had an answer for this. I use macos, iterm2 and terminal. Copy the output of d= DataFrame( x=1:3 ) 10×1 DataFrames.DataFra…

---

## [Are non-keyword, non-optional, function arguments guaranteed to be evaluated left-to-right?](https://discourse.julialang.org/t/are-non-keyword-non-optional-function-arguments-guaranteed-to-be-evaluated-left-to-right/10293)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 2\
**Last updated:** [April 12, 2018, 4:21am UTC](https://discourse.julialang.org/t/are-non-keyword-non-optional-function-arguments-guaranteed-to-be-evaluated-left-to-right/10293 "2018-04-12T04:21:26Z")

</div>

The section of the docs that deals with optional function arguments states (by my reading) that for any optional argument, all arguments to the left are guaranteed to be evaluated first and that optional argument default…

---

## [Multiple dispatch: Force to use some certain method](https://discourse.julialang.org/t/multiple-dispatch-force-to-use-some-certain-method/10274)

<div class="topic-metadata">

**Author:** [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)\
**Replies:** 2\
**Last updated:** [April 11, 2018, 9:38pm UTC](https://discourse.julialang.org/t/multiple-dispatch-force-to-use-some-certain-method/10274 "2018-04-11T21:38:20Z")

</div>

Is there any way to force the multiple dispatch system to use certain method instead of the less ambiguous one? Here is a naive example abstract type MyAbstract end struct MyType1 \<: MyAbstract x::Int end struct…

---

## [Atom julia-client fails to install](https://discourse.julialang.org/t/atom-julia-client-fails-to-install/10289)

<div class="topic-metadata">

**Author:** [@n.schur](https://discourse.julialang.org/u/n.schur)\
**Replies:** 0\
**Last updated:** [April 11, 2018, 8:43pm UTC](https://discourse.julialang.org/t/atom-julia-client-fails-to-install/10289 "2018-04-11T20:43:32Z")

</div>

Hi, I would love to try out the Julia language for some image registration problem that I have. In order to write Julia scripts I would like to use the Atom editor/IDE, however I am running into problems on my linux mac…

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

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