# General Usage

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

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

**Page:** 1065

---

## [Pkg.update() fails](https://discourse.julialang.org/t/pkg-update-fails/2056)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [February 12, 2017, 7:29pm UTC](https://discourse.julialang.org/t/pkg-update-fails/2056 "2017-02-12T19:29:13Z")

</div>

Hello, since a few days Pkg.update() fails on one of my machines: julia\> Pkg.update() INFO: Updating METADATA... INFO: Updating GR master... INFO: Updating QML master... INFO: Updating RadauBVP master... INFO: Updating…

---

## [Partial Specialization of Code](https://discourse.julialang.org/t/partial-specialization-of-code/2045)

<div class="topic-metadata">

**Author:** [@JaredCrean2](https://discourse.julialang.org/u/JaredCrean2)\
**Replies:** 3\
**Last updated:** [February 12, 2017, 4:50pm UTC](https://discourse.julialang.org/t/partial-specialization-of-code/2045 "2017-02-12T16:50:59Z")

</div>

Does julia optimize code where the types of some variables are known approximately but not exactly? For example, this issue makes the return type of slicedim either an n or n+1 dimensional array. Are there performance b…

---

## [Accessing C Array in Julia](https://discourse.julialang.org/t/accessing-c-array-in-julia/1976)

<div class="topic-metadata">

**Author:** [@ravismula](https://discourse.julialang.org/u/ravismula)\
**Replies:** 1\
**Last updated:** [February 12, 2017, 4:06am UTC](https://discourse.julialang.org/t/accessing-c-array-in-julia/1976 "2017-02-12T04:06:51Z")

</div>

How do I access Array of Strings from C in Julia? Here is the C Code int main(int argc, char \*argv\[\]){ compute\_sum(argv\[1\], argv\[2\]); return 1; } void compute\_sum(char\* val1, char\* val2){ jl\_init(JULIA\_INIT\_DIR); …

---

## [Proper way to hook into REPL display of type](https://discourse.julialang.org/t/proper-way-to-hook-into-repl-display-of-type/2046)

<div class="topic-metadata">

**Author:** [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Replies:** 1\
**Last updated:** [February 12, 2017, 12:50am UTC](https://discourse.julialang.org/t/proper-way-to-hook-into-repl-display-of-type/2046 "2017-02-12T00:50:30Z")

</div>

I want to overwrite how a particular type is displayed if my package is loaded, but only in the interactive REPL. I found that I can overload display(d::Base.REPL.REPLDisplay, ...), but now I am a bit stuck without digg…

---

## [Documenting abstract types & Documenter.jl](https://discourse.julialang.org/t/documenting-abstract-types-documenter-jl/2022)

<div class="topic-metadata">

**Author:** [@stustd](https://discourse.julialang.org/u/stustd)\
**Replies:** 8\
**Last updated:** [February 11, 2017, 9:49pm UTC](https://discourse.julialang.org/t/documenting-abstract-types-documenter-jl/2022 "2017-02-11T21:49:07Z")

</div>

I have problems documenting an abstract type hierarchy when subtyping multiple multiple abstract type. I’m using Documenter.jl’s native :html generation (i.e. don’t use mkdocs). Example in case: "Doc A" abstract A "Doc…

---

## [Best way to write a binary search tree](https://discourse.julialang.org/t/best-way-to-write-a-binary-search-tree/2026)

<div class="topic-metadata">

**Author:** [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Replies:** 2\
**Last updated:** [February 11, 2017, 2:33am UTC](https://discourse.julialang.org/t/best-way-to-write-a-binary-search-tree/2026 "2017-02-11T02:33:17Z")

</div>

What is the best (i.e. simple and fast) way to code a binary search tree in Julia nowadays? (E.g. does it use Nullables? Or self-links from a node to itself to represent a missing child?) This question has come up a fe…

---

## [Bitstype homonyms?](https://discourse.julialang.org/t/bitstype-homonyms/2027)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 2\
**Last updated:** [February 10, 2017, 3:34pm UTC](https://discourse.julialang.org/t/bitstype-homonyms/2027 "2017-02-10T15:34:05Z")

</div>

I have a 64-bit bitstype that is bit-equivalent to Float64 and does math as Float64 does. I can reinterpret one to the other. I would like to do something reinterpret-like with vectors and matricies (maybe StaticArrays)…

---

## [Creating AbstractStrings](https://discourse.julialang.org/t/creating-abstractstrings/1982)

<div class="topic-metadata">

**Author:** [@Iagoba\_Apellaniz](https://discourse.julialang.org/u/Iagoba_Apellaniz)\
**Replies:** 2\
**Last updated:** [February 11, 2017, 12:24am UTC](https://discourse.julialang.org/t/creating-abstractstrings/1982 "2017-02-11T00:24:22Z")

</div>

Hello, I face a problem when creating an AbstractString type. Maybe is not the best implementation. Nevertheless, I want to give it a try. Here is my toy-model which fails of course, because, it is not finished. I don’t…

---

## [Base.runtests() fails after make install](https://discourse.julialang.org/t/base-runtests-fails-after-make-install/2032)

<div class="topic-metadata">

**Author:** [@jlodder](https://discourse.julialang.org/u/jlodder)\
**Replies:** 1\
**Last updated:** [February 10, 2017, 9:21pm UTC](https://discourse.julialang.org/t/base-runtests-fails-after-make-install/2032 "2017-02-10T21:21:00Z")

</div>

Base.runtests() appears to fail when run from an account other than the one that ran ‘make install’. I have reproduced the issue on RHEL 7.3 with release 0.5.0 (compiled from source with stock gcc) and on CentOS 6.7 with…

---

## [Type inference with threads](https://discourse.julialang.org/t/type-inference-with-threads/2004)

<div class="topic-metadata">

**Author:** [@austinbean](https://discourse.julialang.org/u/austinbean)\
**Replies:** 2\
**Last updated:** [February 10, 2017, 6:44pm UTC](https://discourse.julialang.org/t/type-inference-with-threads/2004 "2017-02-10T18:44:31Z")

</div>

I’m wondering if there is something I’m doing wrong that’s preventing the compiler from figuring out the type of an array I am trying to return with multi-threading. I have a small example here: function testtype(x::…

---

## [Performance of closures](https://discourse.julialang.org/t/performance-of-closures/1983)

<div class="topic-metadata">

**Author:** [@BenLauwens](https://discourse.julialang.org/u/BenLauwens)\
**Replies:** 6\
**Last updated:** [February 10, 2017, 9:44am UTC](https://discourse.julialang.org/t/performance-of-closures/1983 "2017-02-10T09:44:29Z")

</div>

Hi As closures are interesting constructs to build functions with state, I am trying to use them to build automatically finite-state machines. I compared the performance of 10000 calls to a closure with a hand-made vers…

---

## [Broadcasting like a Number](https://discourse.julialang.org/t/broadcasting-like-a-number/1425)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 7\
**Last updated:** [February 10, 2017, 2:13pm UTC](https://discourse.julialang.org/t/broadcasting-like-a-number/1425 "2017-02-10T14:13:36Z")

</div>

I’m trying to create a Type that broadcasts like a Number without being \<: Number, see example code below. I tried the following, but broadcasting is returning a zero-dimensional array where Numbers return a Number. I…

---

## [Review: pth matrix roots](https://discourse.julialang.org/t/review-pth-matrix-roots/1866)

<div class="topic-metadata">

**Author:** [@felix](https://discourse.julialang.org/u/felix)\
**Replies:** 4\
**Last updated:** [February 10, 2017, 2:18am UTC](https://discourse.julialang.org/t/review-pth-matrix-roots/1866 "2017-02-10T02:18:58Z")

</div>

Hello, to test the accuracy of the Schur-Pade approximation of A^r for A a matrix and r a real number, I implemented a method rootm to calculate A^(1/q), q::Int. This is a direct generalisation of sqrtm = A^(1/2) (PR202…

---

## [How to effectively keep the MAC address as int64?](https://discourse.julialang.org/t/how-to-effectively-keep-the-mac-address-as-int64/1965)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 3\
**Last updated:** [February 9, 2017, 9:14pm UTC](https://discourse.julialang.org/t/how-to-effectively-keep-the-mac-address-as-int64/1965 "2017-02-09T21:14:42Z")

</div>

How to effectively keep the MAC address as int64 not as a string ? A have a lot of strings … are to hevy . Paul

---

## [Dot product and norm for arrays of arrays](https://discourse.julialang.org/t/dot-product-and-norm-for-arrays-of-arrays/1990)

<div class="topic-metadata">

**Author:** [@lostella](https://discourse.julialang.org/u/lostella)\
**Replies:** 0\
**Last updated:** [February 8, 2017, 8:43pm UTC](https://discourse.julialang.org/t/dot-product-and-norm-for-arrays-of-arrays/1990 "2017-02-08T20:43:27Z")

</div>

Hi all, I just realized that one can use dot and norm (and vecdot and vecnorm) on objects of type Array{Array{T, N}, 1}. However, their behaviour it’s not clear to me, and I would like to know whether it’s the intended …

---

## [Is v\[1:3\] .= sin.(v\[1:3\]) efficient?](https://discourse.julialang.org/t/is-v-1-3-sin-v-1-3-efficient/1972)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 9\
**Last updated:** [February 9, 2017, 10:15am UTC](https://discourse.julialang.org/t/is-v-1-3-sin-v-1-3-efficient/1972 "2017-02-09T10:15:02Z")

</div>

This is a question about how to use the dot-syntax for in-place assignment for sub-arrays. Let v = \[1., 2., 3., 4., 5., 6.\]. I want to apply sin(...) in place to some elements. Specifically, I want to do: v\[1:3\] .= si…

---

## [\[Solved\] Debugging an apparent memory leak](https://discourse.julialang.org/t/solved-debugging-an-apparent-memory-leak/1828)

<div class="topic-metadata">

**Author:** [@Michael\_Eastwood](https://discourse.julialang.org/u/Michael_Eastwood)\
**Replies:** 1\
**Last updated:** [February 9, 2017, 2:28am UTC](https://discourse.julialang.org/t/solved-debugging-an-apparent-memory-leak/1828 "2017-02-09T02:28:08Z")

</div>

Hello all, I have a problem on Julia v0.5 that I need some advice on how to debug. The essential problem is that I have a script that takes several hours to run. As the script is running, the memory usage of each worker…

---

## [Why does the REPL work in Main?](https://discourse.julialang.org/t/why-does-the-repl-work-in-main/1949)

<div class="topic-metadata">

**Author:** [@fengyang.wang](https://discourse.julialang.org/u/fengyang.wang)\
**Replies:** 10\
**Last updated:** [February 8, 2017, 5:12pm UTC](https://discourse.julialang.org/t/why-does-the-repl-work-in-main/1949 "2017-02-08T17:12:05Z")

</div>

This is really just a question for my curiosity. Why does the Julia REPL work in the Main module, the same module that packages are loaded in, instead of a separate module? Is it because of the convenience of accessing m…

---

## [Can I invoke Julia's built-in type inference on a subarray{Any}?](https://discourse.julialang.org/t/can-i-invoke-julias-built-in-type-inference-on-a-subarray-any/1985)

<div class="topic-metadata">

**Author:** [@NickNack](https://discourse.julialang.org/u/NickNack)\
**Replies:** 3\
**Last updated:** [February 8, 2017, 3:34pm UTC](https://discourse.julialang.org/t/can-i-invoke-julias-built-in-type-inference-on-a-subarray-any/1985 "2017-02-08T15:34:43Z")

</div>

Given this: julia\> mat = \[1 2; 3.0 4.0; 5 6.0; "seven" "eight"; :nine :ten\] 4×2 Array{Any,2}: 1 2 3.0 4.0 5 6.0 "seven" "eight" :nine :ten julia\> typeof(mat\[1,1\]) Int64 julia\> typeof(mat\[2,…

---

## [Summing matrices of different dimensions in a type stable way?](https://discourse.julialang.org/t/summing-matrices-of-different-dimensions-in-a-type-stable-way/1952)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 8\
**Last updated:** [February 8, 2017, 6:05am UTC](https://discourse.julialang.org/t/summing-matrices-of-different-dimensions-in-a-type-stable-way/1952 "2017-02-08T06:05:38Z")

</div>

I want to have a type (or maybe another container) that contains matrices of different dimensions and be able to do operations (like summing them), but I’m having trouble doing this in a type stable way. Something like: …

---

## [Convert and parametric types](https://discourse.julialang.org/t/convert-and-parametric-types/1936)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [February 7, 2017, 9:18pm UTC](https://discourse.julialang.org/t/convert-and-parametric-types/1936 "2017-02-07T21:18:33Z")

</div>

I have a type MyObject{S} which basically wraps a vector of S \<: AbstractArray{T,N} elements, with a few bells and whistles. I would like to define a method for convert which basically concatenates these, giving an Arra…

---

## [Crash when using GR](https://discourse.julialang.org/t/crash-when-using-gr/1910)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 9\
**Last updated:** [February 7, 2017, 8:31pm UTC](https://discourse.julialang.org/t/crash-when-using-gr/1910 "2017-02-07T20:31:39Z")

</div>

I want to use GR.jl (with Plots.jl), but after installing it, using GR crashes the program. So fast, that I can’t read the error message. I use 0.5.0 on win10. Couldn’t find any useful info. I’m also new to Julia and cou…

---

## [Weird notation](https://discourse.julialang.org/t/weird-notation/1962)

<div class="topic-metadata">

**Author:** [@Emerson\_Vitor\_Castel](https://discourse.julialang.org/u/Emerson_Vitor_Castel)\
**Replies:** 2\
**Last updated:** [February 7, 2017, 7:40pm UTC](https://discourse.julialang.org/t/weird-notation/1962 "2017-02-07T19:40:26Z")

</div>

Traditionally, | v |=max(|v\_i|). But in Julia we have: julia\> v=\[1.0 2.0 -5.0\] 1×3 Array{Float64,2}: 1.0 2.0 -5.0 julia\> norm(v) 5.477225575051661 julia\> norm(v,2) 5.477225575051661 julia\> norm(v,Inf) 8.0 jul…

---

## [Success() does not give same result as running in terminal](https://discourse.julialang.org/t/success-does-not-give-same-result-as-running-in-terminal/1958)

<div class="topic-metadata">

**Author:** [@tawheeler](https://discourse.julialang.org/u/tawheeler)\
**Replies:** 1\
**Last updated:** [February 7, 2017, 5:36pm UTC](https://discourse.julialang.org/t/success-does-not-give-same-result-as-running-in-terminal/1958 "2017-02-07T17:36:15Z")

</div>

If I run type ls in a bash terminal I get: ls is aliased to \`ls --color=auto’ If I run success(type ls) in Julia I get: ERROR: could not spawn type ls: no such file or directory (ENOENT) Am I doing something wrong?

---

## [Any library for syntax highlight of julia code for web sites?](https://discourse.julialang.org/t/any-library-for-syntax-highlight-of-julia-code-for-web-sites/1871)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 6\
**Last updated:** [February 7, 2017, 1:19pm UTC](https://discourse.julialang.org/t/any-library-for-syntax-highlight-of-julia-code-for-web-sites/1871 "2017-02-07T13:19:38Z")

</div>

Hello, I use DokuWiki on my website, that in turns use the GeSHi Generic Syntax Highlighter. The problem is that Julia is not supported on that library. Do you know of syntax highlighting libraries for the web with Juli…

---

## [Unable to automate Travis from command line](https://discourse.julialang.org/t/unable-to-automate-travis-from-command-line/1926)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 11\
**Last updated:** [February 7, 2017, 9:10am UTC](https://discourse.julialang.org/t/unable-to-automate-travis-from-command-line/1926 "2017-02-07T09:10:25Z")

</div>

Hi, I’m trying to automate some travis/github stuff in Julia. I’m running into some problems. When I try to run travis login from the command line it works just fine, but if I try to run from within julia, I run into pr…

---

## [Error with Pkg.add() (with packages using Documenter?)](https://discourse.julialang.org/t/error-with-pkg-add-with-packages-using-documenter/1946)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 2\
**Last updated:** [February 7, 2017, 8:18am UTC](https://discourse.julialang.org/t/error-with-pkg-add-with-packages-using-documenter/1946 "2017-02-07T08:18:56Z")

</div>

On Julia v0.5.0, Windows, I get the following error when trying to Pkg.add("AxisArrays"). Similar error when trying to Pkg.add("Compose"). I suspect both of these packages use Documenter. julia\> Pkg.add("AxisArrays") …

---

## [Restriction on field names in a user-defined composite type?](https://discourse.julialang.org/t/restriction-on-field-names-in-a-user-defined-composite-type/1944)

<div class="topic-metadata">

**Author:** [@BVPs](https://discourse.julialang.org/u/BVPs)\
**Replies:** 11\
**Last updated:** [February 7, 2017, 2:12am UTC](https://discourse.julialang.org/t/restriction-on-field-names-in-a-user-defined-composite-type/1944 "2017-02-07T02:12:02Z")

</div>

Hello! I want to define my own composite type for my dataset, e.g., the following is a simpler version of what I want to define: type MyData data::Matrix{Float64} length::Int64 size::Tuple{Int64,Int64} end When I w…

---

## [Examining an older and simpler version of Julia](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142)

<div class="topic-metadata">

**Author:** [@pitao](https://discourse.julialang.org/u/pitao)\
**Replies:** 7\
**Last updated:** [February 6, 2017, 9:50pm UTC](https://discourse.julialang.org/t/examining-an-older-and-simpler-version-of-julia/1142 "2017-02-06T21:50:28Z")

</div>

I would like to gain a source-code level understanding of how Julia works. (I understand it’s going to be a lot of work!) With Github one can examine each moment of Julia’s history. There must be points at which the so…

---

## [My first tutorial about julia: julia and mixed continuous/discrete control systems](https://discourse.julialang.org/t/my-first-tutorial-about-julia-julia-and-mixed-continuous-discrete-control-systems/1940)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 2\
**Last updated:** [February 6, 2017, 8:13pm UTC](https://discourse.julialang.org/t/my-first-tutorial-about-julia-julia-and-mixed-continuous-discrete-control-systems/1940 "2017-02-06T20:13:24Z")

</div>

Hi guys! Yesterday I wrote my first tutorial about julia. It is a very simple one, but describe a very big problem that I was having for quite sometime. Every time I needed to simulate a control system in which the cont…

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

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