# General Usage

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

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

**Page:** 1064

---

## [Fail to set Gallium breakpoint at a specified line in a file](https://discourse.julialang.org/t/fail-to-set-gallium-breakpoint-at-a-specified-line-in-a-file/2149)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 4\
**Last updated:** [February 18, 2017, 10:54am UTC](https://discourse.julialang.org/t/fail-to-set-gallium-breakpoint-at-a-specified-line-in-a-file/2149 "2017-02-18T10:54:58Z")

</div>

I tried to set a breakpoint at a line in a file by first changing pwd to the folder where the file is and then call breakpoint as follows: julia\> breakpoint("my\_file.jl", 183) Locations (+: active, -: inactive, \*: sourc…

---

## [Nightlies tracking branch?](https://discourse.julialang.org/t/nightlies-tracking-branch/2113)

<div class="topic-metadata">

**Author:** [@fengyang.wang](https://discourse.julialang.org/u/fengyang.wang)\
**Replies:** 5\
**Last updated:** [February 18, 2017, 4:20am UTC](https://discourse.julialang.org/t/nightlies-tracking-branch/2113 "2017-02-18T04:20:13Z")

</div>

It seems that the Julia nightlies used for Travis CI are tracking https://github.com/JuliaLang/julia/commit/dc2459d186edd45202189fbe94ef78bec6322698 instead of master right now. Is anyone else having this issue?

---

## [Memory allocation in member extraction from a struct?](https://discourse.julialang.org/t/memory-allocation-in-member-extraction-from-a-struct/2158)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 7\
**Last updated:** [February 17, 2017, 11:37pm UTC](https://discourse.julialang.org/t/memory-allocation-in-member-extraction-from-a-struct/2158 "2017-02-17T23:37:28Z")

</div>

A common idiom for me when operating on a struct is to assign local names for members of the struct. That is, if the argument is A with members foo, bar, and baz I often begin a method with function myfunc(A) foo, …

---

## [Possibly incorrect \`displayable("text/html")\` in v0.6](https://discourse.julialang.org/t/possibly-incorrect-displayable-text-html-in-v0-6/2145)

<div class="topic-metadata">

**Author:** [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Replies:** 3\
**Last updated:** [February 17, 2017, 4:21pm UTC](https://discourse.julialang.org/t/possibly-incorrect-displayable-text-html-in-v0-6/2145 "2017-02-17T16:21:17Z")

</div>

This came up in the attempt to get Interact.jl working on v0.6-dev. It currently fails when trying to display some HTML. A MRE is: if displayable("text/html") display("text/html", """foo""") end In the REPL in Juli…

---

## [StaticArray broadcast error](https://discourse.julialang.org/t/staticarray-broadcast-error/2134)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 4\
**Last updated:** [February 17, 2017, 10:21am UTC](https://discourse.julialang.org/t/staticarray-broadcast-error/2134 "2017-02-17T10:21:25Z")

</div>

Hello, On julia 0.5.0, Win64, StaticArrays 0.2.1: I have 2 types defined as using StaticArrays immutable Node \<: FieldVector{Float64} x::Float64 y::Float64 z::Float64 end immutable Point3 \<: FieldVector{Fl…

---

## [Caching function values](https://discourse.julialang.org/t/caching-function-values/2092)

<div class="topic-metadata">

**Author:** [@lostella](https://discourse.julialang.org/u/lostella)\
**Replies:** 4\
**Last updated:** [February 17, 2017, 3:28am UTC](https://discourse.julialang.org/t/caching-function-values/2092 "2017-02-17T03:28:20Z")

</div>

Hello, This may be silly. I would like to understand whether this is a viable design pattern in Julia. I want to define a new type GraphPoint \<: AbstractArray that joins together a point and a function value at that poi…

---

## [Inplace multiplication by a square matrix](https://discourse.julialang.org/t/inplace-multiplication-by-a-square-matrix/1702)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 11\
**Last updated:** [February 17, 2017, 3:26am UTC](https://discourse.julialang.org/t/inplace-multiplication-by-a-square-matrix/1702 "2017-02-17T03:26:59Z")

</div>

I have a d \\times d matrix R and a n \\times d matrix X, I want to multiply R with X and store the result in X, is there a way in julia to to do this without making a copy of X?

---

## [Recursive-blocked matrix square root](https://discourse.julialang.org/t/recursive-blocked-matrix-square-root/2138)

<div class="topic-metadata">

**Author:** [@felix](https://discourse.julialang.org/u/felix)\
**Replies:** 1\
**Last updated:** [February 17, 2017, 2:19am UTC](https://discourse.julialang.org/t/recursive-blocked-matrix-square-root/2138 "2017-02-17T02:19:26Z")

</div>

Hello, this is about a recursive implementation of the sqrtm algorithm. The idea is that, instead of finding the solution X to X^2 = A on a pointwise basis, calculating each entry starting with the diagonal and working o…

---

## [Separate dispatch on Type{T} for subtypes](https://discourse.julialang.org/t/separate-dispatch-on-type-t-for-subtypes/2139)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 2\
**Last updated:** [February 16, 2017, 11:26pm UTC](https://discourse.julialang.org/t/separate-dispatch-on-type-t-for-subtypes/2139 "2017-02-16T23:26:25Z")

</div>

Consider the following: abstract A type B \<: A end type C \<: A end Base.show(io::IO, ::MIME"text/plain", ::Type{A}) = print(io, "I'm abstract type A") Base.show{T\<:A}(io::IO, ::MIME"text/plain", ::Type{T}) = print(io, …

---

## [JLD.jl stuck on an old version](https://discourse.julialang.org/t/jld-jl-stuck-on-an-old-version/2137)

<div class="topic-metadata">

**Author:** [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Replies:** 3\
**Last updated:** [February 16, 2017, 8:33pm UTC](https://discourse.julialang.org/t/jld-jl-stuck-on-an-old-version/2137 "2017-02-16T20:33:05Z")

</div>

I’m using julia v0.5, and while precompiling one of my packages I ran into a JLD.jl issue – one that seems to have been fixed months ago. I checked the installed version, and it was only v0.5.5 (the current latest versio…

---

## [Is there a way to indicate local parallelism?](https://discourse.julialang.org/t/is-there-a-way-to-indicate-local-parallelism/2128)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 2\
**Last updated:** [February 16, 2017, 6:35am UTC](https://discourse.julialang.org/t/is-there-a-way-to-indicate-local-parallelism/2128 "2017-02-16T06:35:22Z")

</div>

With a sorting network, I can sort 4 values using 5 comparisons in three sequential groups. The first two comparisons are internally independent, so ok to do in parallel. And so for the next two. Is there a way to let …

---

## [Gallium broken upon AbstractTrees upgrade to 0.1.0](https://discourse.julialang.org/t/gallium-broken-upon-abstracttrees-upgrade-to-0-1-0/2116)

<div class="topic-metadata">

**Author:** [@fp4code](https://discourse.julialang.org/u/fp4code)\
**Replies:** 1\
**Last updated:** [February 15, 2017, 3:28pm UTC](https://discourse.julialang.org/t/gallium-broken-upon-abstracttrees-upgrade-to-0-1-0/2116 "2017-02-15T15:28:54Z")

</div>

Gallium debugger is broken by recent upgrade https://github.com/JuliaLang/METADATA.jl/commit/b6342dd648587de74f8456e2df656ed57c2b8bc9 See https://github.com/Keno/AbstractTrees.jl/issues/11 Workaround Pkg.pin("Abstrac…

---

## [BLAS fails in Julia's multithreaded mode with too many threads](https://discourse.julialang.org/t/blas-fails-in-julias-multithreaded-mode-with-too-many-threads/2106)

<div class="topic-metadata">

**Author:** [@ay2718](https://discourse.julialang.org/u/ay2718)\
**Replies:** 4\
**Last updated:** [February 15, 2017, 12:15pm UTC](https://discourse.julialang.org/t/blas-fails-in-julias-multithreaded-mode-with-too-many-threads/2106 "2017-02-15T12:15:26Z")

</div>

I am using a supercomputer with 80 cores that is running Scientific Linux. If I start Julia in multithreaded mode with 17 or fewer threads and run the following code, everything works fine. However, if I use 18 or more…

---

## [(Parallel) Using pmap within modules](https://discourse.julialang.org/t/parallel-using-pmap-within-modules/2088)

<div class="topic-metadata">

**Author:** [@stustd](https://discourse.julialang.org/u/stustd)\
**Replies:** 3\
**Last updated:** [February 15, 2017, 4:56am UTC](https://discourse.julialang.org/t/parallel-using-pmap-within-modules/2088 "2017-02-15T04:56:25Z")

</div>

I cannot figure out how to use pmap from within a module. For instance the following code works: @everywhere module Work w(i) = myid() end module Sub using Work function go() p = pmap(Work.w, 1:10 ) println(p) …

---

## [Error :Pkg.add("WinRPM")](https://discourse.julialang.org/t/error-pkg-add-winrpm/1900)

<div class="topic-metadata">

**Author:** [@songroom2016](https://discourse.julialang.org/u/songroom2016)\
**Replies:** 6\
**Last updated:** [February 15, 2017, 3:17am UTC](https://discourse.julialang.org/t/error-pkg-add-winrpm/1900 "2017-02-15T03:17:21Z")

</div>

julia\> Pkg.add("WinRPM") INFO: Cloning cache of BinDeps from https://github.com/JuliaLang/BinDeps.jl.git INFO: Cloning cache of BufferedStreams from https://github.com/BioJulia/BufferedStreams.jl.git INFO: Cloning cache …

---

## [Immutable or bitstype?](https://discourse.julialang.org/t/immutable-or-bitstype/2093)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 4\
**Last updated:** [February 14, 2017, 11:22pm UTC](https://discourse.julialang.org/t/immutable-or-bitstype/2093 "2017-02-14T23:22:43Z")

</div>

I want to define a subtype (say MyInt) of Integer and be able to convert between MyInt and other Integers. I suppose I could use an immutable or a bitstype: immutable MyInt \<: supertype(Int) x::Int end Base.conver…

---

## [Package dir too large](https://discourse.julialang.org/t/package-dir-too-large/2104)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [February 14, 2017, 10:43pm UTC](https://discourse.julialang.org/t/package-dir-too-large/2104 "2017-02-14T22:43:51Z")

</div>

I think my Julia package dir is too large. When I tried to copy this directory to another PC, I noticed that the .git directories were taking too long because they contain a large number of files. In a typical package, …

---

## [How to make new inner constructor syntax compatible with 0.5?](https://discourse.julialang.org/t/how-to-make-new-inner-constructor-syntax-compatible-with-0-5/2094)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 2\
**Last updated:** [February 14, 2017, 10:21pm UTC](https://discourse.julialang.org/t/how-to-make-new-inner-constructor-syntax-compatible-with-0-5/2094 "2017-02-14T22:21:09Z")

</div>

How do I make the new inner constructor syntax immutable Foo{T} Foo{T}() where T = new() end compatible with 0.5? I tried @compat with no luck.

---

## [Weird ASTInterpreter output](https://discourse.julialang.org/t/weird-astinterpreter-output/2074)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 5\
**Last updated:** [February 14, 2017, 10:14pm UTC](https://discourse.julialang.org/t/weird-astinterpreter-output/2074 "2017-02-14T22:14:13Z")

</div>

I went over a massive package using ASTInterpreter (basically using commands n and s) and came across the following output. Why was such a long diagram printed and regular output omitted? Quite puzzled. 1|debug \> s Body…

---

## [Cannot precompile module Atom.jl](https://discourse.julialang.org/t/cannot-precompile-module-atom-jl/2090)

<div class="topic-metadata">

**Author:** [@pitao](https://discourse.julialang.org/u/pitao)\
**Replies:** 3\
**Last updated:** [February 14, 2017, 2:35am UTC](https://discourse.julialang.org/t/cannot-precompile-module-atom-jl/2090 "2017-02-14T02:35:59Z")

</div>

I’m trying (on OSX) master Julia + master Juno, which is probably asking for trouble. I’ve put the date in the topic as I can imagine the same question being asked frequently in the future whenever something goes wrong. …

---

## [LoadError: MethodError: Cannot \`convert\` an object](https://discourse.julialang.org/t/loaderror-methoderror-cannot-convert-an-object/1761)

<div class="topic-metadata">

**Author:** [@rushirg](https://discourse.julialang.org/u/rushirg)\
**Replies:** 4\
**Last updated:** [February 14, 2017, 6:17pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-cannot-convert-an-object/1761 "2017-02-14T18:17:46Z")

</div>

i am getting error like this: ERROR: LoadError: MethodError: Cannot convert an object of type DataArrays.DataArray{Any,1} to an object of type Int32 This may have arisen from a call to the constructor Int32(…), As, i …

---

## [Faster shuffle! for small arrays?](https://discourse.julialang.org/t/faster-shuffle-for-small-arrays/2100)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 2\
**Last updated:** [February 14, 2017, 3:59pm UTC](https://discourse.julialang.org/t/faster-shuffle-for-small-arrays/2100 "2017-02-14T15:59:39Z")

</div>

I have some simulation code that I’m trying to speed up. @code\_warntype didn’t suggest any type instability, so I turned to profiling. The core of the simulation code is essentially: function core\_of\_simulation() ch…

---

## [Change colours in contour plot](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953)

<div class="topic-metadata">

**Author:** [@Holy\_Monk](https://discourse.julialang.org/u/Holy_Monk)\
**Replies:** 4\
**Last updated:** [February 14, 2017, 3:31pm UTC](https://discourse.julialang.org/t/change-colours-in-contour-plot/1953 "2017-02-14T15:31:55Z")

</div>

I use the function contour (with fill = “true”) to make contour plots, for this I use Plots.jl. I would however like to change the colour scheme to gray-values, I found that you can do colormap(“Grays”) but this does not…

---

## [GitError - 'REQUIRE' does not exist](https://discourse.julialang.org/t/giterror-require-does-not-exist/2096)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 4\
**Last updated:** [February 14, 2017, 1:52pm UTC](https://discourse.julialang.org/t/giterror-require-does-not-exist/2096 "2017-02-14T13:52:56Z")

</div>

Using v0.6.0-dev.2635 (linux), I am getting this error when trying Pkg.add("pkg") or Pkg.checkout("pkg") with many packages. Is there a way to avoid it? julia\> Pkg.add(“Combinatorics”) ERROR: GitError(Code:ENOTFOUND, …

---

## [How to set breakpoint in Juno?](https://discourse.julialang.org/t/how-to-set-breakpoint-in-juno/2095)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 5\
**Last updated:** [February 14, 2017, 1:29pm UTC](https://discourse.julialang.org/t/how-to-set-breakpoint-in-juno/2095 "2017-02-14T13:29:57Z")

</div>

I installed the JuliaPro and can debug the function from Juno IDE line by line. But I do not found the button to set the breakpoint. I have not found the relative information from the JunliaPro JuliaPro Quick StartGuide. …

---

## [Code for simulating jump diffusion?](https://discourse.julialang.org/t/code-for-simulating-jump-diffusion/1154)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 21\
**Last updated:** [February 14, 2017, 7:15am UTC](https://discourse.julialang.org/t/code-for-simulating-jump-diffusion/1154 "2017-02-14T07:15:39Z")

</div>

I would like to simulate from a jump diffusion model. I have written C++ code for use with Octave (NeuralNetsForIndirectInference.jl/CTSVmodel.cc at master · mcreel/NeuralNetsForIndirectInference.jl · GitHub) and I could…

---

## [Skip version 0.5](https://discourse.julialang.org/t/skip-version-0-5/1595)

<div class="topic-metadata">

**Author:** [@turtle](https://discourse.julialang.org/u/turtle)\
**Replies:** 13\
**Last updated:** [February 13, 2017, 5:28pm UTC](https://discourse.julialang.org/t/skip-version-0-5/1595 "2017-02-13T17:28:38Z")

</div>

I am using Julia version 0.4.7 and wish to upgrade to 0.6 in due time. Is it possible to skip version 0.5, or I will miss important deprecation warnings?

---

## [Julia usage with tmux or screen on Mac](https://discourse.julialang.org/t/julia-usage-with-tmux-or-screen-on-mac/2076)

<div class="topic-metadata">

**Author:** [@peregrinrm](https://discourse.julialang.org/u/peregrinrm)\
**Replies:** 4\
**Last updated:** [February 13, 2017, 3:57pm UTC](https://discourse.julialang.org/t/julia-usage-with-tmux-or-screen-on-mac/2076 "2017-02-13T15:57:43Z")

</div>

Hi there. I want to run the repl in a tmux window but whenever I start julia, it starts on a new terminal window. This only happens for me on Mac OS (my actual version is 10.11.16). On a linux VM it works (julia command…

---

## [Speed comparison: Sparse matrix multiplication vs usual matrix multiplication](https://discourse.julialang.org/t/speed-comparison-sparse-matrix-multiplication-vs-usual-matrix-multiplication/2024)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 7\
**Last updated:** [February 13, 2017, 2:37pm UTC](https://discourse.julialang.org/t/speed-comparison-sparse-matrix-multiplication-vs-usual-matrix-multiplication/2024 "2017-02-13T14:37:27Z")

</div>

Why is sparse \* dense slower than dense \* dense? x = sprand(1000,1000,.1); fx = full(x); y = rand(1000,1000); @time x\*y; 0.925036 seconds (31.94 k allocations: 9.071 MB) @time x\*y; 0.885278 seconds (7 allocations:…

---

## [Receiving UDP packages](https://discourse.julialang.org/t/receiving-udp-packages/2073)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [February 13, 2017, 11:44am UTC](https://discourse.julialang.org/t/receiving-udp-packages/2073 "2017-02-13T11:44:11Z")

</div>

Hello, I am trying to receive UDP packages, containing ASCII data. The following code works fine in the REPL, but fails if executed as program. @async begin udpsock = UDPSocket() bind(udpsock,ip"127.…

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

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