# General Usage

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

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

**Page:** 1053

---

## [Problem using IJulia](https://discourse.julialang.org/t/problem-using-ijulia/3360)

<div class="topic-metadata">

**Author:** [@SourishSinha](https://discourse.julialang.org/u/SourishSinha)\
**Replies:** 2\
**Last updated:** [April 25, 2017, 12:56pm UTC](https://discourse.julialang.org/t/problem-using-ijulia/3360 "2017-04-25T12:56:34Z")

</div>

I keep getting this error when I try running Pkg.build(“IJulia”). I’ve already tried uninstalling and reinstalling Julia - both 0.5.0 and 0.5.1 - (including deleting the Julia folder), using Pkg.checkout(“IJulia”), and i…

---

## [BLAS headers](https://discourse.julialang.org/t/blas-headers/3141)

<div class="topic-metadata">

**Author:** [@blegat](https://discourse.julialang.org/u/blegat)\
**Replies:** 5\
**Last updated:** [April 25, 2017, 3:30pm UTC](https://discourse.julialang.org/t/blas-headers/3141 "2017-04-25T15:30:50Z")

</div>

I am currently implementing a SDPA wrapper. I use the BLAS/LAPACK libraries used by Julia which can be obtained by Libdl.dlpath(BLAS.libblas). The value is typically /usr/lib/julia/libopenblas64\_.so. As Julia adds a 64\_ …

---

## [Module Inheritance Doubts](https://discourse.julialang.org/t/module-inheritance-doubts/3358)

<div class="topic-metadata">

**Author:** [@filipebraida](https://discourse.julialang.org/u/filipebraida)\
**Replies:** 3\
**Last updated:** [April 25, 2017, 2:08pm UTC](https://discourse.julialang.org/t/module-inheritance-doubts/3358 "2017-04-25T14:08:25Z")

</div>

I’m doing a framework for recommendation systems called Persa.jl (https://github.com/filipebraida/Persa.jl). My idea is that the core is a module and it’s possible to extend this framework to solve a Collaborative Filter…

---

## [\[Embedding\] Windows Binaries](https://discourse.julialang.org/t/embedding-windows-binaries/3352)

<div class="topic-metadata">

**Author:** [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Replies:** 22\
**Last updated:** [April 25, 2017, 1:05pm UTC](https://discourse.julialang.org/t/embedding-windows-binaries/3352 "2017-04-25T13:05:30Z")

</div>

I am embedding Julia in a C++ project. This work fine on Unix platform, but I am having some trouble with the windows build available for download on julialang.org The main blocker is that while a LLVM.dll shared libr…

---

## [Function static parameter names not unique ? parametric type problem](https://discourse.julialang.org/t/function-static-parameter-names-not-unique-parametric-type-problem/3365)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 2\
**Last updated:** [April 25, 2017, 6:54am UTC](https://discourse.julialang.org/t/function-static-parameter-names-not-unique-parametric-type-problem/3365 "2017-04-25T06:54:51Z")

</div>

error: ERROR: LoadError: syntax: function static parameter names not unique I’ve been reading some of the posts about parametric types and inner constructors but I can’t quite seem to get what I’m trying to do to work. …

---

## [Enums for array indexing](https://discourse.julialang.org/t/enums-for-array-indexing/669)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [April 24, 2017, 10:25pm UTC](https://discourse.julialang.org/t/enums-for-array-indexing/669 "2017-04-24T22:25:39Z")

</div>

I am building up a stochastic transition matrix, and I want to use constants for the indices of various states to avoid errors, eg P\[state\_A, state\_B\] = some\_probability P\[state\_A, sink\] = death\_probability ... I can d…

---

## [Question about use of generated functions](https://discourse.julialang.org/t/question-about-use-of-generated-functions/3355)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 9\
**Last updated:** [April 24, 2017, 3:32pm UTC](https://discourse.julialang.org/t/question-about-use-of-generated-functions/3355 "2017-04-24T15:32:18Z")

</div>

In a package of mines I need to often create an empty Dict to which I later add elements. In order to avoid always allocating a new empty Dict, I thought about exploiting generated functions in this way: @generated foo…

---

## [Multidimensional arrays with 0-based indices](https://discourse.julialang.org/t/multidimensional-arrays-with-0-based-indices/3325)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 7\
**Last updated:** [April 24, 2017, 10:14am UTC](https://discourse.julialang.org/t/multidimensional-arrays-with-0-based-indices/3325 "2017-04-24T10:14:45Z")

</div>

Hi, I’m trying to create an array view (for data from C++) that uses 0-based indices. I got most of it working, except for the use of end as an index into a multidimensional error. The following code mimics what I want …

---

## [Parametric inner constructor with \`where {T}\` of non-parametric type](https://discourse.julialang.org/t/parametric-inner-constructor-with-where-t-of-non-parametric-type/3353)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 2\
**Last updated:** [April 24, 2017, 3:05am UTC](https://discourse.julialang.org/t/parametric-inner-constructor-with-where-t-of-non-parametric-type/3353 "2017-04-24T03:05:13Z")

</div>

Consider the following type definition attempt, which tries to define a type that stores arrays of x- and y-locations of points: julia\> struct PointVector{T\<:Real} x::Vector{T} y::Vector{T} …

---

## [Variable integer type parameter](https://discourse.julialang.org/t/variable-integer-type-parameter/3345)

<div class="topic-metadata">

**Author:** [@mobius-eng](https://discourse.julialang.org/u/mobius-eng)\
**Replies:** 2\
**Last updated:** [April 23, 2017, 6:05pm UTC](https://discourse.julialang.org/t/variable-integer-type-parameter/3345 "2017-04-23T18:05:40Z")

</div>

Consider the definition of the geometrical domain in N-dimensional space, meshed into sub-domains. And if we want to keep its boundary mesh (e.g. for boundary conditions) we would want to write something like this: type…

---

## [Error while installing NetworkLayout](https://discourse.julialang.org/t/error-while-installing-networklayout/3315)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 2\
**Last updated:** [April 22, 2017, 7:33am UTC](https://discourse.julialang.org/t/error-while-installing-networklayout/3315 "2017-04-22T07:33:19Z")

</div>

I’m trying to install NetworkLayout and is getting the following error. julia\> Pkg.add( "NetworkLayout" ) ERROR: fixed packages introduce conflicting requirements for Plots: StatPlots requires versions \[0.10.0…

---

## [Updating a vector inside a for loop crashes the script](https://discourse.julialang.org/t/updating-a-vector-inside-a-for-loop-crashes-the-script/3331)

<div class="topic-metadata">

**Author:** [@DWSchulze](https://discourse.julialang.org/u/DWSchulze)\
**Replies:** 3\
**Last updated:** [April 22, 2017, 5:28am UTC](https://discourse.julialang.org/t/updating-a-vector-inside-a-for-loop-crashes-the-script/3331 "2017-04-22T05:28:43Z")

</div>

I converted this .m file into Julia. When a vector gets updated inside a for loop and Julia crashes with this (incorrect) error message: ERROR: LoadError: MethodError: no method matching diagm(::Array{Float64,2}) Cl…

---

## [DifferentialEquations Pkg won't be added](https://discourse.julialang.org/t/differentialequations-pkg-wont-be-added/3194)

<div class="topic-metadata">

**Author:** [@leejm516](https://discourse.julialang.org/u/leejm516)\
**Replies:** 45\
**Last updated:** [April 22, 2017, 1:14am UTC](https://discourse.julialang.org/t/differentialequations-pkg-wont-be-added/3194 "2017-04-22T01:14:07Z")

</div>

julia\> versioninfo() Julia Version 0.5.1 Commit 6445c82 (2017-03-05 13:25 UTC) Platform Info: OS: Linux (x86\_64-pc-linux-gnu) CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz WORD\_SIZE: 64 BLAS: libopenblas (USE64B…

---

## [Passing a github API token to LibGit2.push for authentication](https://discourse.julialang.org/t/passing-a-github-api-token-to-libgit2-push-for-authentication/3330)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 0\
**Last updated:** [April 21, 2017, 5:16pm UTC](https://discourse.julialang.org/t/passing-a-github-api-token-to-libgit2-push-for-authentication/3330 "2017-04-21T17:16:50Z")

</div>

Is it possible?\_\_\_\_\_

---

## [Getting complex solutions from solve in SymPy.jl](https://discourse.julialang.org/t/getting-complex-solutions-from-solve-in-sympy-jl/3292)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [April 21, 2017, 4:22pm UTC](https://discourse.julialang.org/t/getting-complex-solutions-from-solve-in-sympy-jl/3292 "2017-04-21T16:22:36Z")

</div>

Paraphrased from SymPy Issue #150. Description: I’m trying to get a real solution from 4 complex solutions that encircle it. What I’m trying to do is take the norm of the 4 solutions and scale it. However the scaling …

---

## [Why is a manual in-place addition so much faster than += and .+= on range-indexed arrays?](https://discourse.julialang.org/t/why-is-a-manual-in-place-addition-so-much-faster-than-and-on-range-indexed-arrays/3302)

<div class="topic-metadata">

**Author:** [@rleegates](https://discourse.julialang.org/u/rleegates)\
**Replies:** 3\
**Last updated:** [April 21, 2017, 11:48am UTC](https://discourse.julialang.org/t/why-is-a-manual-in-place-addition-so-much-faster-than-and-on-range-indexed-arrays/3302 "2017-04-21T11:48:23Z")

</div>

On Julia v0.5 and v0.6 we observe the following timings: function add1!{T}(A::Matrix{T}, subA::Matrix{T}, I::UnitRange{Int}, J::UnitRange{Int}) size\_subA = size(subA) checkbounds(A,I.stop,J.stop) checkbounds(su…

---

## [Any shorter form of \`\`zip(1:2, cycle(3))''?](https://discourse.julialang.org/t/any-shorter-form-of-zip-1-2-cycle-3/3309)

<div class="topic-metadata">

**Author:** [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Replies:** 3\
**Last updated:** [April 21, 2017, 11:42am UTC](https://discourse.julialang.org/t/any-shorter-form-of-zip-1-2-cycle-3/3309 "2017-04-21T11:42:51Z")

</div>

Normally zip will stop if any component reaches end. e.g., julia\> for (a,b) in zip(1:2,3) println("$a,$b") end 1,3 If I want it to align with the longest component (the shorter components just repeat), th…

---

## [Callback thread safety in 0.6?](https://discourse.julialang.org/t/callback-thread-safety-in-0-6/1291)

<div class="topic-metadata">

**Author:** [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Replies:** 7\
**Last updated:** [April 21, 2017, 12:12am UTC](https://discourse.julialang.org/t/callback-thread-safety-in-0-6/1291 "2017-04-21T00:12:28Z")

</div>

Does anything in the recent threading development affect this section of the manual? What I’m most interested in is whether we can pass more complex Julia functions to C libraries that might call them from a different co…

---

## [Ccall mkl shared library helmholtz solver : problems with gc() safety](https://discourse.julialang.org/t/ccall-mkl-shared-library-helmholtz-solver-problems-with-gc-safety/3283)

<div class="topic-metadata">

**Author:** [@larssp](https://discourse.julialang.org/u/larssp)\
**Replies:** 2\
**Last updated:** [April 20, 2017, 2:51pm UTC](https://discourse.julialang.org/t/ccall-mkl-shared-library-helmholtz-solver-problems-with-gc-safety/3283 "2017-04-20T14:51:30Z")

</div>

Hello julia users, I am trying to ccall the 2D helmholtz solver from the Intel MKL shared library “mkl\_rt” (I think it is fortran code) and need some help. The Intel MKL solver is separated into four functions, which a…

---

## [Is there any way I can get the playing time of a movie file?](https://discourse.julialang.org/t/is-there-any-way-i-can-get-the-playing-time-of-a-movie-file/2894)

<div class="topic-metadata">

**Author:** [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Replies:** 4\
**Last updated:** [April 20, 2017, 2:05pm UTC](https://discourse.julialang.org/t/is-there-any-way-i-can-get-the-playing-time-of-a-movie-file/2894 "2017-04-20T14:05:35Z")

</div>

The filesystem function stat() does not provide the length of a movie file in terms of playing time. Is there any other function that provides that information? Thanks

---

## [StaticArrays SArray typealias](https://discourse.julialang.org/t/staticarrays-sarray-typealias/3297)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 11\
**Last updated:** [April 20, 2017, 12:06pm UTC](https://discourse.julialang.org/t/staticarrays-sarray-typealias/3297 "2017-04-20T12:06:48Z")

</div>

This works: typealias MyMat{N} SMatrix{N, N, Float64} but this doesn’t: typealias MyTensor{N} SArray{(3, N, N), Float64} ERROR: TypeError: SArray: in parameter, expected Type{T}, got Tuple{Int64,TypeVar,TypeVar} I ha…

---

## [Loop unrolling, type param to macro, generated functions](https://discourse.julialang.org/t/loop-unrolling-type-param-to-macro-generated-functions/1911)

<div class="topic-metadata">

**Author:** [@pint](https://discourse.julialang.org/u/pint)\
**Replies:** 4\
**Last updated:** [April 20, 2017, 2:05am UTC](https://discourse.julialang.org/t/loop-unrolling-type-param-to-macro-generated-functions/1911 "2017-04-20T02:05:17Z")

</div>

yeah, i don’t seem to know what my question is. below you find 3. i have a type Mod{B, A} which just encapsulates an UInt64 array. and a naive function on it: @inline limbs(b) = cld(b, 31) mul!{B, A}(r::Mod{B, A}, a:…

---

## [Typeaware autocompletion](https://discourse.julialang.org/t/typeaware-autocompletion/3268)

<div class="topic-metadata">

**Author:** [@Ford](https://discourse.julialang.org/u/Ford)\
**Replies:** 9\
**Last updated:** [April 19, 2017, 9:41pm UTC](https://discourse.julialang.org/t/typeaware-autocompletion/3268 "2017-04-19T21:41:08Z")

</div>

Is somebody looking into typeaware completion? I think it would be really nice feature to have: array=\[1,2\] mean( #if you hit tab / ctrl+space now, 'array' shows between first candidates It would be also nice to have t…

---

## [Writing better / faster / more julia-ish code](https://discourse.julialang.org/t/writing-better-faster-more-julia-ish-code/3269)

<div class="topic-metadata">

**Author:** [@pyrex41](https://discourse.julialang.org/u/pyrex41)\
**Replies:** 6\
**Last updated:** [April 19, 2017, 9:47pm UTC](https://discourse.julialang.org/t/writing-better-faster-more-julia-ish-code/3269 "2017-04-19T21:47:44Z")

</div>

Using ReactiveBasics, I am using Signals to model time series events (extension of discussion here). I want to build a signal that gives the median value of the last 5 inputs to another signal. I have developed 2 approac…

---

## [Embedding: Ubuntu PPA library location](https://discourse.julialang.org/t/embedding-ubuntu-ppa-library-location/3270)

<div class="topic-metadata">

**Author:** [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Replies:** 5\
**Last updated:** [April 19, 2017, 5:30pm UTC](https://discourse.julialang.org/t/embedding-ubuntu-ppa-library-location/3270 "2017-04-19T17:30:17Z")

</div>

I am working on embedding the Julia interpreter as a library in a C++ application (in the context of testing julia bindings for a library). At the moment, I doing experiments with the build from the ubuntu PPA https://l…

---

## [Chaining of functions](https://discourse.julialang.org/t/chaining-of-functions/3276)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 4\
**Last updated:** [April 19, 2017, 1:47pm UTC](https://discourse.julialang.org/t/chaining-of-functions/3276 "2017-04-19T13:47:35Z")

</div>

It would be great if the chaining operator supported something like: my\_path |\> joinpath(\_, "my\_file.jld") so I can avoid my\_path |\> x -\> joinpath(x, "my\_file.jld") i think R supports this in the %\>% operator using . …

---

## [\[PyCall\] append!() returns PyError (:PyList\_Append) bad argument to internal function error](https://discourse.julialang.org/t/pycall-append-returns-pyerror-pylist-append-bad-argument-to-internal-function-error/3263)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 5\
**Last updated:** [April 19, 2017, 5:13am UTC](https://discourse.julialang.org/t/pycall-append-returns-pyerror-pylist-append-bad-argument-to-internal-function-error/3263 "2017-04-19T05:13:17Z")

</div>

I am trying to port in Julia the above python code: from ezodf import newdoc, Sheet ods = newdoc(doctype='ods', filename='spreadsheet.ods') sheet = Sheet('SHEET', size=(10, 10)) ods.sheets += sheet sheet\['A1'\].set\_valu…

---

## [Defining function from string with parse and eval failure in v0.6 master](https://discourse.julialang.org/t/defining-function-from-string-with-parse-and-eval-failure-in-v0-6-master/3249)

<div class="topic-metadata">

**Author:** [@JuhaHeiskala](https://discourse.julialang.org/u/JuhaHeiskala)\
**Replies:** 4\
**Last updated:** [April 18, 2017, 6:31pm UTC](https://discourse.julialang.org/t/defining-function-from-string-with-parse-and-eval-failure-in-v0-6-master/3249 "2017-04-18T18:31:23Z")

</div>

Hello, The following seems like a bug, but maybe there is something I am missing about eval and parse that is causing the failure. I define anonymous function and pass it as a parameter to another function. The code wo…

---

## [@code\_warntype: assigning variable to array](https://discourse.julialang.org/t/code-warntype-assigning-variable-to-array/3267)

<div class="topic-metadata">

**Author:** [@J-Revell](https://discourse.julialang.org/u/J-Revell)\
**Replies:** 1\
**Last updated:** [April 18, 2017, 2:46pm UTC](https://discourse.julialang.org/t/code-warntype-assigning-variable-to-array/3267 "2017-04-18T14:46:52Z")

</div>

Perhaps I’m being naive, but why is it for this simple example that @code\_warntype suggests the variable c is of type Any in Julia 0.6 (pre-beta & master), when it is able to infer the correct type on Julia 0.5.1? It se…

---

## [Using gensym properly](https://discourse.julialang.org/t/using-gensym-properly/3257)

<div class="topic-metadata">

**Author:** [@pyrex41](https://discourse.julialang.org/u/pyrex41)\
**Replies:** 6\
**Last updated:** [April 18, 2017, 12:23pm UTC](https://discourse.julialang.org/t/using-gensym-properly/3257 "2017-04-18T12:23:03Z")

</div>

Using ReactiveBasics.jl, I have been using signals to deal with event-driven time series event modeling. I find that using a reactive style approach is intuitive and improve the clarity of my code. My question, though, i…

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

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