# General Usage

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

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

**Page:** 1066

---

## [Sparse matrix multiplication: SparseMatrixCSC can be ~100x slower than Base.SparseArrays.CHOLMOD.Sparse](https://discourse.julialang.org/t/sparse-matrix-multiplication-sparsematrixcsc-can-be-100x-slower-than-base-sparsearrays-cholmod-sparse/1831)

<div class="topic-metadata">

**Author:** [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Replies:** 4\
**Last updated:** [February 6, 2017, 2:42pm UTC](https://discourse.julialang.org/t/sparse-matrix-multiplication-sparsematrixcsc-can-be-100x-slower-than-base-sparsearrays-cholmod-sparse/1831 "2017-02-06T14:42:29Z")

</div>

I want to multiply a sparse matrix and its transpose. The sparse matrix is generated by the code sparse\_diff.jl (available at http://modb.oce.ulg.ac.be/mediawiki/upload/Alex/Julia/sparse\_diff.jl). The following sparse m…

---

## [Problem with "cd" and "include" (bug?)](https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870)

<div class="topic-metadata">

**Author:** [@lucabrugnolini](https://discourse.julialang.org/u/lucabrugnolini)\
**Replies:** 3\
**Last updated:** [February 6, 2017, 2:26pm UTC](https://discourse.julialang.org/t/problem-with-cd-and-include-bug/1870 "2017-02-06T14:26:14Z")

</div>

Hello, When I select the wd using cd and use include to load some functions, it happens that the pwd is not the one I’ve chosen using cd. More precisely, writing pwd() you get the directory you’ve chosen with cd but usi…

---

## [Crash loading packages](https://discourse.julialang.org/t/crash-loading-packages/1934)

<div class="topic-metadata">

**Author:** [@lucabrugnolini](https://discourse.julialang.org/u/lucabrugnolini)\
**Replies:** 5\
**Last updated:** [February 6, 2017, 1:19pm UTC](https://discourse.julialang.org/t/crash-loading-packages/1934 "2017-02-06T13:19:35Z")

</div>

Hello, After loading packages I get Julia client stop working. I am currently working on julia 0.5.1, atom 1.11.2, ubuntu 16.04. Here is the errors as reported in the atom console: signal (11): Segmentation fault wh…

---

## [ERROR: BoundsError](https://discourse.julialang.org/t/error-boundserror/1906)

<div class="topic-metadata">

**Author:** [@ravismula](https://discourse.julialang.org/u/ravismula)\
**Replies:** 1\
**Last updated:** [February 6, 2017, 5:07am UTC](https://discourse.julialang.org/t/error-boundserror/1906 "2017-02-06T05:07:54Z")

</div>

Hi, I was trying to implement HybridNB so that i can save the model for further computing. Below is the code I’m trying to execute. using NaiveBayes using DataFrames using Requests url = "https://archive.ics.uci.edu/m…

---

## [BinDeps not working on v0.6](https://discourse.julialang.org/t/bindeps-not-working-on-v0-6/1922)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 2\
**Last updated:** [February 5, 2017, 6:07pm UTC](https://discourse.julialang.org/t/bindeps-not-working-on-v0-6/1922 "2017-02-05T18:07:27Z")

</div>

As v0.6 release beta gets closer and closer, I’ve been trying to make sure that the packages we use work in v0.6. Trying to build ICU.jl fails in v0.6 (and gets lots of deprecation warnings) because of BinDeps.jl. I se…

---

## [Computing array elements on call](https://discourse.julialang.org/t/computing-array-elements-on-call/1918)

<div class="topic-metadata">

**Author:** [@andremanoel](https://discourse.julialang.org/u/andremanoel)\
**Replies:** 7\
**Last updated:** [February 5, 2017, 4:49pm UTC](https://discourse.julialang.org/t/computing-array-elements-on-call/1918 "2017-02-05T16:49:14Z")

</div>

Hello, I’d like to have an array which elements A\[i, j\] are computed from a given function f(i, j) (say f(i, j) = i + j) only when that element is used, i.e. I would not like to build the whole matrix beforehand. I was…

---

## [Julia memory overhead](https://discourse.julialang.org/t/julia-memory-overhead/1861)

<div class="topic-metadata">

**Author:** [@andyferris](https://discourse.julialang.org/u/andyferris)\
**Replies:** 5\
**Last updated:** [February 5, 2017, 1:01pm UTC](https://discourse.julialang.org/t/julia-memory-overhead/1861 "2017-02-05T13:01:50Z")

</div>

I have received some queries from coworkers about Julia’s memory overhead. Members of our HPC team have expressed concern that Julia seems to eat about 160-200MB of RAM per Julia session (our current deployment model is …

---

## [Checkout previous version of a package](https://discourse.julialang.org/t/checkout-previous-version-of-a-package/1898)

<div class="topic-metadata">

**Author:** [@boolewinkle](https://discourse.julialang.org/u/boolewinkle)\
**Replies:** 3\
**Last updated:** [February 4, 2017, 6:25pm UTC](https://discourse.julialang.org/t/checkout-previous-version-of-a-package/1898 "2017-02-04T18:25:26Z")

</div>

Hello, I suspect that something small is broken in the latest version (0.8.1) of a package. I want to try running with the previous version of the package to see if this is so. I cloned the package repo, and there is a…

---

## [Size of immutables](https://discourse.julialang.org/t/size-of-immutables/1855)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 8\
**Last updated:** [February 4, 2017, 12:59pm UTC](https://discourse.julialang.org/t/size-of-immutables/1855 "2017-02-04T12:59:17Z")

</div>

Why is sizeof(M.C) larger than the others? Tested with 0.5.0, 0.4.7 and 0.6.0-dev.2525. julia\> module M immutable A e::UInt32 a::UInt32 b::UInt64 end immutable B …

---

## [@edit on Windows](https://discourse.julialang.org/t/edit-on-windows/1695)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 6\
**Last updated:** [February 4, 2017, 6:06am UTC](https://discourse.julialang.org/t/edit-on-windows/1695 "2017-02-04T06:06:09Z")

</div>

I often use @which but would also like to use @edit. On Windows @edit doesn’t seem to work for me by default, so I did some investigating and managed to get something that works. Sharing here in case it helps any other…

---

## [Ccall and cconvert for Ptr{T}](https://discourse.julialang.org/t/ccall-and-cconvert-for-ptr-t/1874)

<div class="topic-metadata">

**Author:** [@thofma](https://discourse.julialang.org/u/thofma)\
**Replies:** 5\
**Last updated:** [February 3, 2017, 6:14pm UTC](https://discourse.julialang.org/t/ccall-and-cconvert-for-ptr-t/1874 "2017-02-03T18:14:25Z")

</div>

Just a quick question about ccall and cconvert. From the manual I know that ccall((:foo, "libfoo"), Void, (A, ), x) will result in a call to ccall((:foo, "libfoo"), Void, (A, ), unsafe\_convert(A, cconvert(A, x))) But…

---

## [Interface to c++ code](https://discourse.julialang.org/t/interface-to-c-code/1865)

<div class="topic-metadata">

**Author:** [@ndbecker](https://discourse.julialang.org/u/ndbecker)\
**Replies:** 6\
**Last updated:** [February 3, 2017, 6:05pm UTC](https://discourse.julialang.org/t/interface-to-c-code/1865 "2017-02-03T18:05:04Z")

</div>

I know that perhaps in the future I could use cxx, but for now that doesn’t seem an option because it requires a non-standard build of julia. So I’m playing with ccall interface. I want to use code that represents mult…

---

## [\`Where\` questions](https://discourse.julialang.org/t/where-questions/1797)

<div class="topic-metadata">

**Author:** [@yurivish](https://discourse.julialang.org/u/yurivish)\
**Replies:** 17\
**Last updated:** [February 3, 2017, 4:29pm UTC](https://discourse.julialang.org/t/where-questions/1797 "2017-02-03T16:29:12Z")

</div>

Where questions Hi! I spent some time today reading the upcoming 0.6 documentation and had a few questions while trying to understand the upcoming new syntax for parametric types. What is the difference, if any, betwe…

---

## [Generated functions and world age](https://discourse.julialang.org/t/generated-functions-and-world-age/1867)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 1\
**Last updated:** [February 3, 2017, 2:44pm UTC](https://discourse.julialang.org/t/generated-functions-and-world-age/1867 "2017-02-03T14:44:20Z")

</div>

The following used to work, but doesn’t anymore: julia\> @generated f()=g() f (generic function with 1 method) julia\> g() = 2 g (generic function with 1 method) julia\> f() ERROR: MethodError: no method matching g() The…

---

## [About the \`Array{\<:Number, 2}\` syntax](https://discourse.julialang.org/t/about-the-array-number-2-syntax/1845)

<div class="topic-metadata">

**Author:** [@o314](https://discourse.julialang.org/u/o314)\
**Replies:** 4\
**Last updated:** [February 3, 2017, 2:07pm UTC](https://discourse.julialang.org/t/about-the-array-number-2-syntax/1845 "2017-02-03T14:07:26Z")

</div>

Hi every julia linguist, I am trying to find some info about the Array{\<:Number, 2} syntax for matrix, tensor as mentioned in the slide “about Julia 1.0” given by Stefan KARPINSKI / JuliaCon 2016 (goto 3…

---

## [Redefined functions do not pass correctly as arguments](https://discourse.julialang.org/t/redefined-functions-do-not-pass-correctly-as-arguments/1852)

<div class="topic-metadata">

**Author:** [@mago876](https://discourse.julialang.org/u/mago876)\
**Replies:** 5\
**Last updated:** [February 3, 2017, 9:48am UTC](https://discourse.julialang.org/t/redefined-functions-do-not-pass-correctly-as-arguments/1852 "2017-02-03T09:48:06Z")

</div>

Hi. I’m having trouble with passing redefined functions as arguments of other functions (in my case, constantly redefined objetive functions to a minimizing method). The following behavior is observed in kernels 0.5.0 a…

---

## [Convolving more than two distributions](https://discourse.julialang.org/t/convolving-more-than-two-distributions/1787)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 3\
**Last updated:** [February 2, 2017, 11:07pm UTC](https://discourse.julialang.org/t/convolving-more-than-two-distributions/1787 "2017-02-02T23:07:59Z")

</div>

Hi all- I was wondering how to convolve more than two distributions in Julia. R has the convpow function in the distr library. Does Julia have something similar? Thanks

---

## [Typeof() gives unexpected answer](https://discourse.julialang.org/t/typeof-gives-unexpected-answer/1766)

<div class="topic-metadata">

**Author:** [@phillefjonk](https://discourse.julialang.org/u/phillefjonk)\
**Replies:** 14\
**Last updated:** [February 2, 2017, 9:23pm UTC](https://discourse.julialang.org/t/typeof-gives-unexpected-answer/1766 "2017-02-02T21:23:05Z")

</div>

I specify the type of a variable and directly check its type. I get an unexpected answer julia\> epoch\_state =Array{Array{Float64,1},1} Array{Array{Float64,1},1} julia\> typeof(epoch\_state) DataType Shouldn’t typeof(epo…

---

## [Gadfly Plots show up in black and white in Juno](https://discourse.julialang.org/t/gadfly-plots-show-up-in-black-and-white-in-juno/1853)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 0\
**Last updated:** [February 2, 2017, 7:54pm UTC](https://discourse.julialang.org/t/gadfly-plots-show-up-in-black-and-white-in-juno/1853 "2017-02-02T19:54:03Z")

</div>

Hi all- Gadfly plots show up in black and white in Juno. It seems to have happened after updating Gadfly but I’m not positive. Does anyone have any solutions? Thanks, Chris

---

## [OOP in Julia, inherit from parametric composite type](https://discourse.julialang.org/t/oop-in-julia-inherit-from-parametric-composite-type/1841)

<div class="topic-metadata">

**Author:** [@kkmann](https://discourse.julialang.org/u/kkmann)\
**Replies:** 4\
**Last updated:** [February 2, 2017, 6:13pm UTC](https://discourse.julialang.org/t/oop-in-julia-inherit-from-parametric-composite-type/1841 "2017-02-02T18:13:37Z")

</div>

Hey, so this might be a rather vague question but anyway here it is. I am really having a hard time getting to grasp with OOP in Julia. I am developing a package for specific clinical trial designs and these designs can…

---

## [Ccall issue - totally stumped](https://discourse.julialang.org/t/ccall-issue-totally-stumped/1842)

<div class="topic-metadata">

**Author:** [@ndbecker](https://discourse.julialang.org/u/ndbecker)\
**Replies:** 3\
**Last updated:** [February 2, 2017, 3:48pm UTC](https://discourse.julialang.org/t/ccall-issue-totally-stumped/1842 "2017-02-02T15:48:54Z")

</div>

I’m calling c++ code - to do this I added a C wrapper. One of the arguments (extrinsic) is an Array, which is passed as a Ptr. When the C code gets the pointer, it points to nonexistent memory. Other arguments are pas…

---

## [Brew install julia linker command failed](https://discourse.julialang.org/t/brew-install-julia-linker-command-failed/1843)

<div class="topic-metadata">

**Author:** [@smores](https://discourse.julialang.org/u/smores)\
**Replies:** 2\
**Last updated:** [February 2, 2017, 3:14pm UTC](https://discourse.julialang.org/t/brew-install-julia-linker-command-failed/1843 "2017-02-02T15:14:33Z")

</div>

brew install --HEAD julia generates an error as follows Downloading https://gist.githubusercontent.com/timxzl/c6f474fa387382267723/raw/2ecb0270d83f0a167358ff2a396cd6004e1b02a ##########################################…

---

## [Segmentation fault trying to create a large string on v0.6.0-dev.2486](https://discourse.julialang.org/t/segmentation-fault-trying-to-create-a-large-string-on-v0-6-0-dev-2486/1807)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 3\
**Last updated:** [February 2, 2017, 3:04pm UTC](https://discourse.julialang.org/t/segmentation-fault-trying-to-create-a-large-string-on-v0-6-0-dev-2486/1807 "2017-02-02T15:04:46Z")

</div>

Ran into this when I tried to get one of my packages to 100% coverage, where I only support storing strings up to typemax(UInt32) size. To test that the error is actually thrown, i tried the following: v = String(Vecto…

---

## [Vector\*matrix in 0.6](https://discourse.julialang.org/t/vector-matrix-in-0-6/1838)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 16\
**Last updated:** [February 2, 2017, 1:20pm UTC](https://discourse.julialang.org/t/vector-matrix-in-0-6/1838 "2017-02-02T13:20:58Z")

</div>

This caught me by surprise: julia\> ones(10)\*ones(1,10) ERROR: DimensionMismatch("Cannot left-multiply a matrix by a vector") Stacktrace: \[1\] \*(::Array{Float64,1}, ::Array{Float64,2}) at ./linalg/rowvector.jl:157 Is th…

---

## [Dict from 2d arrays and 1d arrays as keys](https://discourse.julialang.org/t/dict-from-2d-arrays-and-1d-arrays-as-keys/1836)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [February 2, 2017, 10:03am UTC](https://discourse.julialang.org/t/dict-from-2d-arrays-and-1d-arrays-as-keys/1836 "2017-02-02T10:03:08Z")

</div>

I am trying to create a (touple) → value dictionary out of a 2d arrays table of values and a 1d array of keys. This code (not mine) works… using DataArrays, DataFrames # This works.... orig = \["Epinal", "Bordeaux", "…

---

## [Pkg.dir() difference between v0.5 and v0.6](https://discourse.julialang.org/t/pkg-dir-difference-between-v0-5-and-v0-6/1815)

<div class="topic-metadata">

**Author:** [@josefsachs](https://discourse.julialang.org/u/josefsachs)\
**Replies:** 1\
**Last updated:** [February 1, 2017, 5:33pm UTC](https://discourse.julialang.org/t/pkg-dir-difference-between-v0-5-and-v0-6/1815 "2017-02-01T17:33:44Z")

</div>

What explains this difference? I don’t see anything in NEWS.md. Environment is Cygwin running under Windows 7. JOSEFSACHS7548$ usr/bin/julia.exe \_ \_ \_ \_(\_)\_ | A fresh approach to technical…

---

## [ERROR: LoadError: DomainError: in quaternion(::Array{Float64,2})](https://discourse.julialang.org/t/error-loaderror-domainerror-in-quaternion-array-float64-2/1822)

<div class="topic-metadata">

**Author:** [@phillefjonk](https://discourse.julialang.org/u/phillefjonk)\
**Replies:** 2\
**Last updated:** [February 1, 2017, 4:22pm UTC](https://discourse.julialang.org/t/error-loaderror-domainerror-in-quaternion-array-float64-2/1822 "2017-02-01T16:22:33Z")

</div>

I get the error message ERROR: LoadError: DomainError: in quaternion(::Array{Float64,2}) when I run the the following script (test5.jl): function quaternion(m) q = \[0.0,0.0,0.0,0.0\] …

---

## [Whay operator "&" on two (the same?) bool vectors give others result?](https://discourse.julialang.org/t/whay-operator-on-two-the-same-bool-vectors-give-others-result/1821)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 2\
**Last updated:** [February 1, 2017, 3:08pm UTC](https://discourse.julialang.org/t/whay-operator-on-two-the-same-bool-vectors-give-others-result/1821 "2017-02-01T15:08:47Z")

</div>

julia\> x=dni.==1; julia\> y=id\_HH.==uid\_HH\[1\]; julia\> length(x) 334189 julia\> length(y) 334189 julia\> eltype(x) Bool julia\> eltype(y) Bool julia\> size(y) (334189,) julia\> size(x) (334189,) Now please see on first record …

---

## [Ho read as Date.Time ? Date? this string : 2016-01-17 01:00:25](https://discourse.julialang.org/t/ho-read-as-date-time-date-this-string-2016-01-17-01-00-25/1806)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 6\
**Last updated:** [February 1, 2017, 2:22pm UTC](https://discourse.julialang.org/t/ho-read-as-date-time-date-this-string-2016-01-17-01-00-25/1806 "2017-02-01T14:22:20Z")

</div>

Ho read as Date.Time ? Date? this string : 2016-01-17 01:00:25 Paul

---

## [abs2(Float64) takes longer than abs2(Complex64)?](https://discourse.julialang.org/t/abs2-float64-takes-longer-than-abs2-complex64/1819)

<div class="topic-metadata">

**Author:** [@ndbecker](https://discourse.julialang.org/u/ndbecker)\
**Replies:** 2\
**Last updated:** [February 1, 2017, 1:58pm UTC](https://discourse.julialang.org/t/abs2-float64-takes-longer-than-abs2-complex64/1819 "2017-02-01T13:58:56Z")

</div>

function test1(u,N) for \_ in 1:N abs2(u) end end u = ones(Complex64, 1000000) v = ones(1000000) @time test1(u, 1000) @time test1(v, 1000) julia\> @time test1(u,1000) 1.428069 seconds (4.00 k allocation…

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

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