# General Usage

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

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

**Page:** 982

---

## [eig bug in Juno for JuliaPro0.6.2.2 REPL? ](https://discourse.julialang.org/t/eig-bug-in-juno-for-juliapro0-6-2-2-repl/10560)

<div class="topic-metadata">

**Author:** [@Baicai\_Xiao](https://discourse.julialang.org/u/Baicai_Xiao)\
**Replies:** 3\
**Last updated:** [April 27, 2018, 2:22pm UTC](https://discourse.julialang.org/t/eig-bug-in-juno-for-juliapro0-6-2-2-repl/10560 "2018-04-27T14:22:22Z")

</div>

Hello, I used eig functions to get the eigenvalue of some matrix. However, it looks like there will be random possibilities that the eig function give me wrong answer if I repeat the calculation multiple times. Does an…

---

## [Using pmap on Amazon EC2?](https://discourse.julialang.org/t/using-pmap-on-amazon-ec2/10569)

<div class="topic-metadata">

**Author:** [@vvmisic](https://discourse.julialang.org/u/vvmisic)\
**Replies:** 0\
**Last updated:** [April 26, 2018, 9:57pm UTC](https://discourse.julialang.org/t/using-pmap-on-amazon-ec2/10569 "2018-04-26T21:57:38Z")

</div>

Hi everyone - - I have some questions about using pmap. I’m trying to use pmap to run some embarrassingly parallel code on Amazon EC2. I’ve been running into a problem where it seems each worker keeps using up more and m…

---

## [Ifelse type result](https://discourse.julialang.org/t/ifelse-type-result/10460)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 3\
**Last updated:** [April 26, 2018, 2:31pm UTC](https://discourse.julialang.org/t/ifelse-type-result/10460 "2018-04-26T14:31:17Z")

</div>

Dear J wizard—I want to code my own basic recode (without CategoricalArrays, which has very deep dependencies, via DataStream into … ). easy me thinks. julia\> recode( v::Vector, p::Pair )= ( T= Vector{Union{typeof(p\[…

---

## [Add.update() fails](https://discourse.julialang.org/t/add-update-fails/10553)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 0\
**Last updated:** [April 26, 2018, 11:50am UTC](https://discourse.julialang.org/t/add-update-fails/10553 "2018-04-26T11:50:49Z")

</div>

I have been using Julia actively for a while now, including updating packages. But today seems to be a day without: GIT certificate? What is this about? Regards Philippe INFO: Use Pkg.update() to get the latest ve…

---

## [Apparent inconsistency importing modules](https://discourse.julialang.org/t/apparent-inconsistency-importing-modules/10532)

<div class="topic-metadata">

**Author:** [@phrmoy](https://discourse.julialang.org/u/phrmoy)\
**Replies:** 12\
**Last updated:** [April 25, 2018, 8:41pm UTC](https://discourse.julialang.org/t/apparent-inconsistency-importing-modules/10532 "2018-04-25T20:41:34Z")

</div>

Hi there, I am new to Julia but I have written a few lines of Julia and I am still juggling with this, and it feels like I still don’t get it or I am not doing something right. So start off, when I want to import a modu…

---

## [Best way to download data from a remote URL directly into JuliaDB](https://discourse.julialang.org/t/best-way-to-download-data-from-a-remote-url-directly-into-juliadb/10467)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 2\
**Last updated:** [April 25, 2018, 6:19pm UTC](https://discourse.julialang.org/t/best-way-to-download-data-from-a-remote-url-directly-into-juliadb/10467 "2018-04-25T18:19:06Z")

</div>

I am trying to download a time series from a remote URL (the European Central Bank Statistical Data Warehouse) into JuliaDB. Would like to simply pass the URL to a loadtable function. I am able to load ttime-series into …

---

## [Strange Allocation in \`@generated\`](https://discourse.julialang.org/t/strange-allocation-in-generated/10521)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 3\
**Last updated:** [April 25, 2018, 5:41pm UTC](https://discourse.julialang.org/t/strange-allocation-in-generated/10521 "2018-04-25T17:41:15Z")

</div>

I use a generated function for fast evaluation of monomials and their gradients. The following example could be easily rewritten without a generated function, but I don’t see how to easily implement its gradient without @…

---

## [Broadcast and Map on Set have inconsistent behaviors](https://discourse.julialang.org/t/broadcast-and-map-on-set-have-inconsistent-behaviors/10522)

<div class="topic-metadata">

**Author:** [@babaq](https://discourse.julialang.org/u/babaq)\
**Replies:** 3\
**Last updated:** [April 25, 2018, 5:34pm UTC](https://discourse.julialang.org/t/broadcast-and-map-on-set-have-inconsistent-behaviors/10522 "2018-04-25T17:34:10Z")

</div>

x,y,z=1,2,3 a=Set() b=Set() push!(a,:x,:y,:z) push!(b,1,2,3) log.(b) # error map(log,b) # work map(string,a) # work, gives Set(String\["x", "z", "y"\]) string.(a) # no error, but gives a string "Set(Any\[:y, :z, :x\])" I …

---

## [Sorting inhomogeneous tuples on 0.62](https://discourse.julialang.org/t/sorting-inhomogeneous-tuples-on-0-62/10539)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 2\
**Last updated:** [April 25, 2018, 4:49pm UTC](https://discourse.julialang.org/t/sorting-inhomogeneous-tuples-on-0-62/10539 "2018-04-25T16:49:32Z")

</div>

I need to sort arrays of inhomogeneous tuples. On julia 0.62, something is bad, performance wise, which was luckily fixed in 0.7. I wanted to ask whether anyone knows workarounds on 0.6. Sample code below: rr = \[(rand(…

---

## [Redefining an integer makes computing time blow up](https://discourse.julialang.org/t/redefining-an-integer-makes-computing-time-blow-up/10535)

<div class="topic-metadata">

**Author:** [@plapplop](https://discourse.julialang.org/u/plapplop)\
**Replies:** 5\
**Last updated:** [April 25, 2018, 4:28pm UTC](https://discourse.julialang.org/t/redefining-an-integer-makes-computing-time-blow-up/10535 "2018-04-25T16:28:06Z")

</div>

This topic is a follow-up of this one: Improve performance of matrix computation where @foobar\_lv2 proposed an improved version for the computation of a matrix given some three other matrices x, \\mu and \\sigma of respect…

---

## [Improve performance of matrix computation](https://discourse.julialang.org/t/improve-performance-of-matrix-computation/10503)

<div class="topic-metadata">

**Author:** [@plapplop](https://discourse.julialang.org/u/plapplop)\
**Replies:** 10\
**Last updated:** [April 25, 2018, 11:35am UTC](https://discourse.julialang.org/t/improve-performance-of-matrix-computation/10503 "2018-04-25T11:35:37Z")

</div>

I’m implementing a clustering algorithm where N is the number of samples, D the number of features and K the number of clusters. For each cluster 1 \\leq k \\leq K, I have to compute a probability that an individual belong…

---

## [From generator (with Channel) to iterator](https://discourse.julialang.org/t/from-generator-with-channel-to-iterator/10277)

<div class="topic-metadata">

**Author:** [@FemtoTrader](https://discourse.julialang.org/u/FemtoTrader)\
**Replies:** 6\
**Last updated:** [April 24, 2018, 11:01pm UTC](https://discourse.julialang.org/t/from-generator-with-channel-to-iterator/10277 "2018-04-24T23:01:16Z")

</div>

Hello, PyGen - python style generators - #17 by nsmith and Creating Generators introduce how to mimics Python generator with Julia Channel. With Python, a generator can be used like an iterator with next function (or \_…

---

## [Vector{SVector} equivalent for large SVector?](https://discourse.julialang.org/t/vector-svector-equivalent-for-large-svector/10514)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 4\
**Last updated:** [April 24, 2018, 9:16pm UTC](https://discourse.julialang.org/t/vector-svector-equivalent-for-large-svector/10514 "2018-04-24T21:16:43Z")

</div>

I have to deal with a vector (really a list) of data points. Often, this can be written as Matrix{Float64} of size (D,N), where each data-point lives in D-dimensional space and I have N of these guys (D much smaller tha…

---

## [Nested functions with  SubArray argument](https://discourse.julialang.org/t/nested-functions-with-subarray-argument/10502)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 5\
**Last updated:** [April 24, 2018, 6:21pm UTC](https://discourse.julialang.org/t/nested-functions-with-subarray-argument/10502 "2018-04-24T18:21:33Z")

</div>

Hi, I compare the performances of 3 functions implementing X.+=1 where X is a 2D Array of float. shift2D\_1D! splits the 2D loop in two nested functions. shift2DLoop! uses a single function with a 2D loop nest, s…

---

## [Performance of logarithm calculation (when not to use the dot operator?)](https://discourse.julialang.org/t/performance-of-logarithm-calculation-when-not-to-use-the-dot-operator/10504)

<div class="topic-metadata">

**Author:** [@lwabeke](https://discourse.julialang.org/u/lwabeke)\
**Replies:** 3\
**Last updated:** [April 24, 2018, 1:05pm UTC](https://discourse.julialang.org/t/performance-of-logarithm-calculation-when-not-to-use-the-dot-operator/10504 "2018-04-24T13:05:41Z")

</div>

Edits for improved clarify in italics I realised last week just how slow the log() function really is, as an example, comparing log() to fft(), it turns out log() is about 2 times slower, even though it is working on in…

---

## [Binding vectors to array](https://discourse.julialang.org/t/binding-vectors-to-array/10483)

<div class="topic-metadata">

**Author:** [@economyboy](https://discourse.julialang.org/u/economyboy)\
**Replies:** 7\
**Last updated:** [April 23, 2018, 7:32am UTC](https://discourse.julialang.org/t/binding-vectors-to-array/10483 "2018-04-23T07:32:45Z")

</div>

Hey, I’m new to Julia and not sure about some issues regarding arrays. One of these is this one: I just want to bind several vectors with zeros to an array. Their length is given in another array like that: length = \[1…

---

## [Performance differences when using a mutable struct that contains an array](https://discourse.julialang.org/t/performance-differences-when-using-a-mutable-struct-that-contains-an-array/10494)

<div class="topic-metadata">

**Author:** [@Bernd\_Blasius](https://discourse.julialang.org/u/Bernd_Blasius)\
**Replies:** 5\
**Last updated:** [April 24, 2018, 10:05am UTC](https://discourse.julialang.org/t/performance-differences-when-using-a-mutable-struct-that-contains-an-array/10494 "2018-04-24T10:05:11Z")

</div>

Hi, I found some strange performance issues in a simple code, using a mutable struct that contains an array and an index to the array as fields. In the simplified example below I compare four different function that fil…

---

## [Porting a CAS to Julia](https://discourse.julialang.org/t/porting-a-cas-to-julia/9924)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 21\
**Last updated:** [April 24, 2018, 1:29am UTC](https://discourse.julialang.org/t/porting-a-cas-to-julia/9924 "2018-04-24T01:29:17Z")

</div>

I am trying to port the Chevie package of Gap3 and the Gap3 functions needed to make it work. If you are curious look at J.Michel, The development version of the Chevie package of Gap3 Journal of Algebra 435 (2015) 308…

---

## [How to reinterpret existing array in to a StaticArray](https://discourse.julialang.org/t/how-to-reinterpret-existing-array-in-to-a-staticarray/10492)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 1\
**Last updated:** [April 23, 2018, 4:15pm UTC](https://discourse.julialang.org/t/how-to-reinterpret-existing-array-in-to-a-staticarray/10492 "2018-04-23T16:15:27Z")

</div>

Continuing the discussion from Reinterpret 3D array into array of SMatrices: I asked a similar question before, but the solution doesn’t work any longer. I used to be able to do this but now it throws an error that I do…

---

## [Broadcast call for closures vs callabe objects](https://discourse.julialang.org/t/broadcast-call-for-closures-vs-callabe-objects/10461)

<div class="topic-metadata">

**Author:** [@spalato](https://discourse.julialang.org/u/spalato)\
**Replies:** 3\
**Last updated:** [April 23, 2018, 3:32pm UTC](https://discourse.julialang.org/t/broadcast-call-for-closures-vs-callabe-objects/10461 "2018-04-23T15:32:03Z")

</div>

Hi, I’ve got a problem that can be nicely solved with closures. I’ve explored the alternative, which is to make a custom callable object. I would like to dispatch them both as a function, so I’ve also tried making that …

---

## [Type stability of \`quadgk\`](https://discourse.julialang.org/t/type-stability-of-quadgk/10006)

<div class="topic-metadata">

**Author:** [@kaslusimoes](https://discourse.julialang.org/u/kaslusimoes)\
**Replies:** 3\
**Last updated:** [April 23, 2018, 2:48pm UTC](https://discourse.julialang.org/t/type-stability-of-quadgk/10006 "2018-04-23T14:48:35Z")

</div>

Hi, I am doing several calculations using QuadGK inside functions and I’m trying to optimize the performance of my code. Not sure if it is the correct procedure but I started looking for type instabilities in my functio…

---

## [Avoiding branching in loops with macros](https://discourse.julialang.org/t/avoiding-branching-in-loops-with-macros/10453)

<div class="topic-metadata">

**Author:** [@vilim](https://discourse.julialang.org/u/vilim)\
**Replies:** 6\
**Last updated:** [April 23, 2018, 11:21am UTC](https://discourse.julialang.org/t/avoiding-branching-in-loops-with-macros/10453 "2018-04-23T11:21:50Z")

</div>

Is there a common pattern in Julia (perhaps with some kind of a macro) for the following case? I have a function that runs a model through several thousands of time steps, and I want to have two versions: one where ea…

---

## [How to set rc setting in PyPlot in Plots](https://discourse.julialang.org/t/how-to-set-rc-setting-in-pyplot-in-plots/10466)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 1\
**Last updated:** [April 22, 2018, 5:46pm UTC](https://discourse.julialang.org/t/how-to-set-rc-setting-in-pyplot-in-plots/10466 "2018-04-22T17:46:40Z")

</div>

I want to set rc in PyPlot in Plots. I can set it like: import PyPlot PyPlot.rc("text", usetex=true) in PyPlot but how can I set it from Plots.jl?

---

## [Is there any backsolve function in JULIA (for triangual matrices)?](https://discourse.julialang.org/t/is-there-any-backsolve-function-in-julia-for-triangual-matrices/10470)

<div class="topic-metadata">

**Author:** [@dpanigo](https://discourse.julialang.org/u/dpanigo)\
**Replies:** 4\
**Last updated:** [April 22, 2018, 3:26pm UTC](https://discourse.julialang.org/t/is-there-any-backsolve-function-in-julia-for-triangual-matrices/10470 "2018-04-22T15:26:35Z")

</div>

Dear Julia users (and developers): We are using the QR decomposition to obtain standard deviations of our beta coefficients (in an OLS linear model) through the “standard way”: Obtaining the variance-covariance matrix…

---

## [Mapslices and cumsum](https://discourse.julialang.org/t/mapslices-and-cumsum/10422)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 2\
**Last updated:** [April 22, 2018, 10:03am UTC](https://discourse.julialang.org/t/mapslices-and-cumsum/10422 "2018-04-22T10:03:13Z")

</div>

I’m finding that the following code grinds my machine to a halt: n=10^6; X = randn(1,n); function V(x) return 0.5 \* dot(x,x); end avgX = cumsum(mapslices(V,X,1))./(1:n); And by halt, I mean, I had to do a hard rese…

---

## [Purging utf-8 bad characters](https://discourse.julialang.org/t/purging-utf-8-bad-characters/10445)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 10\
**Last updated:** [April 21, 2018, 11:53pm UTC](https://discourse.julialang.org/t/purging-utf-8-bad-characters/10445 "2018-04-21T23:53:27Z")

</div>

I need to parse some data out of pdf files that have been converted (ocr) to text. Unfortunately, the app generates bad utf-8. I will go back and see if I can get it to output ascii encoding which could solve my proble…

---

## [Stripping type parameters](https://discourse.julialang.org/t/stripping-type-parameters/10462)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 7\
**Last updated:** [April 21, 2018, 8:43pm UTC](https://discourse.julialang.org/t/stripping-type-parameters/10462 "2018-04-21T20:43:58Z")

</div>

Is there a way to strip type parameters from a type. I have in mind something like this: f(x::T{U}) where T where U = T

---

## [Pointer (Julia) not modified after ccall to C function which uses another C function](https://discourse.julialang.org/t/pointer-julia-not-modified-after-ccall-to-c-function-which-uses-another-c-function/10455)

<div class="topic-metadata">

**Author:** [@pedrohnv](https://discourse.julialang.org/u/pedrohnv)\
**Replies:** 16\
**Last updated:** [April 21, 2018, 11:39am UTC](https://discourse.julialang.org/t/pointer-julia-not-modified-after-ccall-to-c-function-which-uses-another-c-function/10455 "2018-04-21T11:39:37Z")

</div>

I am trying to call a C function from Julia which expects pointers that will be modified. That function is a pre and pro-processing one. Those pointers are modified inside another C function (hcubature, in my case). The …

---

## [Dividing matrix into sections](https://discourse.julialang.org/t/dividing-matrix-into-sections/10428)

<div class="topic-metadata">

**Author:** [@abshej](https://discourse.julialang.org/u/abshej)\
**Replies:** 12\
**Last updated:** [April 21, 2018, 6:01am UTC](https://discourse.julialang.org/t/dividing-matrix-into-sections/10428 "2018-04-21T06:01:55Z")

</div>

How to divide a matrix like m x n or an Array like m x n x 1 into topographic sections? Imagine dividing a square into smaller squares. And operating individually on those sections. Edit: The actual problem is that I w…

---

## [Alternative for showing Union{T, Missings.Missing}?](https://discourse.julialang.org/t/alternative-for-showing-union-t-missings-missing/10465)

<div class="topic-metadata">

**Author:** [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Replies:** 1\
**Last updated:** [April 20, 2018, 11:56pm UTC](https://discourse.julialang.org/t/alternative-for-showing-union-t-missings-missing/10465 "2018-04-20T23:56:07Z")

</div>

Like others I’m somewhat bothered by the long type signatures caused by missing data. julia\> using Missings julia\> A = \[0.0+0im, missing\] 2-element Array{Union{Complex{Float64}, Missings.Missing},1}: 0.0+0.0im m…

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

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