# General Usage

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

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

**Page:** 943

---

## [Julia 1.0.0 on Windows 10 'using PyPlot can't load library expected at: .julia\\\\packages\\\\Conda\\\\m7vem\\\\deps\\\\usr\\\\python37\\](https://discourse.julialang.org/t/julia-1-0-0-on-windows-10-using-pyplot-cant-load-library-expected-at-julia-packages-conda-m7vem-deps-usr-python37/14682)

<div class="topic-metadata">

**Author:** [@douglaskbell](https://discourse.julialang.org/u/douglaskbell)\
**Replies:** 9\
**Last updated:** [September 8, 2018, 10:11am UTC](https://discourse.julialang.org/t/julia-1-0-0-on-windows-10-using-pyplot-cant-load-library-expected-at-julia-packages-conda-m7vem-deps-usr-python37/14682 "2018-09-08T10:11:48Z")

</div>

0 down vote favorite I’m trying to get matplotlib working with Julia 1.0.0. Installed it but get error when I try to test it by doing this… ENV\["PYTHON"\]="c:\\\\ProgramData\\\\Anaconda3\\\\python.exe" using Pkg Pkg.add("PyP…

---

## [Similar identity matrix](https://discourse.julialang.org/t/similar-identity-matrix/14695)

<div class="topic-metadata">

**Author:** [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Replies:** 10\
**Last updated:** [September 8, 2018, 9:01am UTC](https://discourse.julialang.org/t/similar-identity-matrix/14695 "2018-09-08T09:01:41Z")

</div>

What is the idiomatic way to construct a full m×m or n×n identity matrix similar to a given m×n matrix A (static or not)? one(A\*A') or one(A'\*A) does the trick but is of course not what I want.

---

## [How do I update my package version under 1.0](https://discourse.julialang.org/t/how-do-i-update-my-package-version-under-1-0/14677)

<div class="topic-metadata">

**Author:** [@aaalexandrov](https://discourse.julialang.org/u/aaalexandrov)\
**Replies:** 5\
**Last updated:** [September 8, 2018, 5:46am UTC](https://discourse.julialang.org/t/how-do-i-update-my-package-version-under-1-0/14677 "2018-09-08T05:46:05Z")

</div>

Before 1.0, there was METADATA.jl and PkgDev. With 1.0 I’m not sure how I can update the registered version of a package I’m maintaining, or how I can register a new package. Please help?

---

## [Broadcast scalar deprecation warnings](https://discourse.julialang.org/t/broadcast-scalar-deprecation-warnings/11981)

<div class="topic-metadata">

**Author:** [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Replies:** 10\
**Last updated:** [September 8, 2018, 3:02am UTC](https://discourse.julialang.org/t/broadcast-scalar-deprecation-warnings/11981 "2018-09-08T03:02:35Z")

</div>

How are others that are updating packages dealing with deprecation warnings like ┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of │ type \`x::DirectedGraph{Vertex{Int64},…

---

## [Problems with Julia 1.0 on Mac os](https://discourse.julialang.org/t/problems-with-julia-1-0-on-mac-os/14687)

<div class="topic-metadata">

**Author:** [@rverdier](https://discourse.julialang.org/u/rverdier)\
**Replies:** 1\
**Last updated:** [September 7, 2018, 11:04pm UTC](https://discourse.julialang.org/t/problems-with-julia-1-0-on-mac-os/14687 "2018-09-07T23:04:28Z")

</div>

In order to learn Julia, I want to convert my course, Programming in Python with Graphics Applications, to Julia. Using OS 10.13.6 on a MacBook Pro, I immediately ran into two problems: 1: All the docs say to use quit(…

---

## [Multiple dispatch constructor not multiple dispatching?](https://discourse.julialang.org/t/multiple-dispatch-constructor-not-multiple-dispatching/14685)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 4\
**Last updated:** [September 7, 2018, 9:44pm UTC](https://discourse.julialang.org/t/multiple-dispatch-constructor-not-multiple-dispatching/14685 "2018-09-07T21:44:12Z")

</div>

I’m trying to do multiple dispatch magic with various ways of representing a geometric transformation matrix. I have: using StaticArrays struct Quaternion{T\<:Real} s::T v1::T v2::T v3::T end mutable st…

---

## [Multiplication of sub matrices](https://discourse.julialang.org/t/multiplication-of-sub-matrices/14676)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 7\
**Last updated:** [September 7, 2018, 8:53pm UTC](https://discourse.julialang.org/t/multiplication-of-sub-matrices/14676 "2018-09-07T20:53:54Z")

</div>

I’m sure this has been asked before but i can’t find the answer. I have arrays A{T}(n,n,p) B{T}(n,n,p) and I want to multiply them such that each of the n x n matrices are multiplied, so e.g. X = Array{T}(undef,n,n,…

---

## [Julia 1.0.0 on Windows 10 could not load library expected at: julia\\\\packages\\\\Conda\\\\m7vem\\\\deps\\\\usr\\\\python37\\](https://discourse.julialang.org/t/julia-1-0-0-on-windows-10-could-not-load-library-expected-at-julia-packages-conda-m7vem-deps-usr-python37/14679)

<div class="topic-metadata">

**Author:** [@douglaskbell](https://discourse.julialang.org/u/douglaskbell)\
**Replies:** 0\
**Last updated:** [September 7, 2018, 7:36pm UTC](https://discourse.julialang.org/t/julia-1-0-0-on-windows-10-could-not-load-library-expected-at-julia-packages-conda-m7vem-deps-usr-python37/14679 "2018-09-07T19:36:55Z")

</div>

0 down vote favorite I’m trying to get matplotlib working with Julia 1.0.0. Installed it but get error when I try to test it by doing this… ENV\["PYTHON"\]="c:\\\\ProgramData\\\\Anaconda3\\\\python.exe" using Pkg Pkg.add("PyP…

---

## [Inference upon mapreduce](https://discourse.julialang.org/t/inference-upon-mapreduce/14673)

<div class="topic-metadata">

**Author:** [@gpapo](https://discourse.julialang.org/u/gpapo)\
**Replies:** 1\
**Last updated:** [September 7, 2018, 5:19pm UTC](https://discourse.julialang.org/t/inference-upon-mapreduce/14673 "2018-09-07T17:19:11Z")

</div>

Just by curiosity, I was asking myself if the incapability of the compiler to make type-stabile this function function \_trykeepnames(dicts) ktype = mapreduce(keytype, promote\_type, dicts) vtype = mapreduce(valty…

---

## [Using time (minutes, seconds) to calculate duration of events](https://discourse.julialang.org/t/using-time-minutes-seconds-to-calculate-duration-of-events/14624)

<div class="topic-metadata">

**Author:** [@Evian](https://discourse.julialang.org/u/Evian)\
**Replies:** 17\
**Last updated:** [September 7, 2018, 4:11pm UTC](https://discourse.julialang.org/t/using-time-minutes-seconds-to-calculate-duration-of-events/14624 "2018-09-07T16:11:47Z")

</div>

I’ve read and tried the functionality included in Julia 1.0 for dates and times… I do not find an easy way - without defining functions or making manual calculations - of doing something simple as calculating the average…

---

## [Package size crazziness](https://discourse.julialang.org/t/package-size-crazziness/14644)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 20\
**Last updated:** [September 7, 2018, 12:44pm UTC](https://discourse.julialang.org/t/package-size-crazziness/14644 "2018-09-07T12:44:19Z")

</div>

Prelude I. I do everything in my laptop where disk size is far from infinite (and cost for SSD disk are not low). Prelude II. I work on Windows I made an exercise to confirm one suspicion about the size of packages ins…

---

## [Interact with another REPL/Terminal using Julia?](https://discourse.julialang.org/t/interact-with-another-repl-terminal-using-julia/14356)

<div class="topic-metadata">

**Author:** [@onetonfoot](https://discourse.julialang.org/u/onetonfoot)\
**Replies:** 1\
**Last updated:** [September 7, 2018, 10:26am UTC](https://discourse.julialang.org/t/interact-with-another-repl-terminal-using-julia/14356 "2018-09-07T10:26:36Z")

</div>

How would I go about reading and writing from another REPL/Terminal using Julia? I think it can be done with the readandwrite function, but I can’t figure it out. For example say I wanted to use the command line calculat…

---

## [\`iterate\` returning iter, next-state and iter's original length](https://discourse.julialang.org/t/iterate-returning-iter-next-state-and-iters-original-length/14656)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 4\
**Last updated:** [September 7, 2018, 9:37am UTC](https://discourse.julialang.org/t/iterate-returning-iter-next-state-and-iters-original-length/14656 "2018-09-07T09:37:47Z")

</div>

I am using a custom iterator that delegates into a struct to obtain the iterative grist, say a vector. I think it is appropriate to check if the current state (like an index) exceeds the length of the delegatee. I do n…

---

## [Crash when precompling, 0.7](https://discourse.julialang.org/t/crash-when-precompling-0-7/14598)

<div class="topic-metadata">

**Author:** [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Replies:** 2\
**Last updated:** [September 7, 2018, 7:39am UTC](https://discourse.julialang.org/t/crash-when-precompling-0-7/14598 "2018-09-07T07:39:22Z")

</div>

A package I’m working on seems to crash Julia on loading. This happens every time: julia\> using MyPackage \[ Info: Precompiling MyPackage \[13098b1d-c58a-59c4-bc25-08cc832316d6\] signal (11): Segmentation fault: 11 in exp…

---

## [Parsing non-Core types from a config file](https://discourse.julialang.org/t/parsing-non-core-types-from-a-config-file/14652)

<div class="topic-metadata">

**Author:** [@jocklawrie](https://discourse.julialang.org/u/jocklawrie)\
**Replies:** 0\
**Last updated:** [September 7, 2018, 6:26am UTC](https://discourse.julialang.org/t/parsing-non-core-types-from-a-config-file/14652 "2018-09-07T06:26:16Z")

</div>

Hi all, I’m having some trouble with the code below. I am writing a module that contains a function taking a String input (from a config file) and returns a DataType. The function aims to parse the string to a DataType.…

---

## [Vector of a union of two different numeric types---Vector{Union{Int64, Float64}}](https://discourse.julialang.org/t/vector-of-a-union-of-two-different-numeric-types-vector-union-int64-float64/14642)

<div class="topic-metadata">

**Author:** [@aaraujo71](https://discourse.julialang.org/u/aaraujo71)\
**Replies:** 2\
**Last updated:** [September 6, 2018, 9:30pm UTC](https://discourse.julialang.org/t/vector-of-a-union-of-two-different-numeric-types-vector-union-int64-float64/14642 "2018-09-06T21:30:52Z")

</div>

Dear Julia Experts, please, what’s wrong with the following? Can’t I make a vector that is a union of two different numerical types, i.e. a vector of either Int64 or Float64 elements? IntFloat = Union{Int64, Float64} f…

---

## [Create a C struct in Julia without knowing the internals?](https://discourse.julialang.org/t/create-a-c-struct-in-julia-without-knowing-the-internals/14629)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 3\
**Last updated:** [September 6, 2018, 4:34pm UTC](https://discourse.julialang.org/t/create-a-c-struct-in-julia-without-knowing-the-internals/14629 "2018-09-06T16:34:05Z")

</div>

I’m using a C library that uses C structs as internal data storage. However, the library assumes that the user will instantiate these structs him/herself, and then call an initialization routine on them. For instance, in…

---

## [Dereference a pointer in Cxx](https://discourse.julialang.org/t/dereference-a-pointer-in-cxx/12360)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 2\
**Last updated:** [September 6, 2018, 4:17pm UTC](https://discourse.julialang.org/t/dereference-a-pointer-in-cxx/12360 "2018-09-06T16:17:25Z")

</div>

Im trying to write an interface to a C++ library using Cxx. I’m running into a problem with pointers. Specifically, I can create a new object like so: myObj = @cxxnew Object() However, I would now like to call a membe…

---

## [Unsatisfiable requirements for ForwardDiff on Julia 1.0](https://discourse.julialang.org/t/unsatisfiable-requirements-for-forwarddiff-on-julia-1-0/14622)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 6\
**Last updated:** [September 6, 2018, 2:59pm UTC](https://discourse.julialang.org/t/unsatisfiable-requirements-for-forwarddiff-on-julia-1-0/14622 "2018-09-06T14:59:18Z")

</div>

I am working with version 0.18.2+ of JuMP (JuMP 0.18 compatible with 1.0) and I get the following error when I do resolve: ERROR: Unsatisfiable requirements detected for package ForwardDiff \[f6369f11\]: ForwardDiff \[f63…

---

## [Can't add JuliaDB](https://discourse.julialang.org/t/cant-add-juliadb/14616)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 4\
**Last updated:** [September 6, 2018, 2:18pm UTC](https://discourse.julialang.org/t/cant-add-juliadb/14616 "2018-09-06T14:18:09Z")

</div>

I try to add JuliaDB and get (v0.7) pkg\> add JuliaDB Resolving package versions... ERROR: Unsatisfiable requirements detected for package NamedTuples \[73a701b4\]: NamedTuples \[73a701b4\] log: ├─possible versions are: \[…

---

## [Parametric type specialization (like C++ template specialization)](https://discourse.julialang.org/t/parametric-type-specialization-like-c-template-specialization/14592)

<div class="topic-metadata">

**Author:** [@ksamtsak](https://discourse.julialang.org/u/ksamtsak)\
**Replies:** 7\
**Last updated:** [September 6, 2018, 1:53pm UTC](https://discourse.julialang.org/t/parametric-type-specialization-like-c-template-specialization/14592 "2018-09-06T13:53:29Z")

</div>

Is there some way to express the following, which is like a C++ template specialization? Let’s define a parametric type: struct MyType{N\<:Integer} field::GenericType end In the special case where N==1, we can do bet…

---

## [DataFrames Tutorial](https://discourse.julialang.org/t/dataframes-tutorial/14612)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 0\
**Last updated:** [September 6, 2018, 8:52am UTC](https://discourse.julialang.org/t/dataframes-tutorial/14612 "2018-09-06T08:52:23Z")

</div>

Several people asked when DataFrames Tutoroal would work with Julia 1.0. I would like to announce that as of today all dependencies of the tutorial have tagged versions that work with Julia 1.0 so it should be safe to r…

---

## [How to debug Linux Travis error on using package?](https://discourse.julialang.org/t/how-to-debug-linux-travis-error-on-using-package/14566)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 2\
**Last updated:** [September 6, 2018, 8:26am UTC](https://discourse.julialang.org/t/how-to-debug-linux-travis-error-on-using-package/14566 "2018-09-06T08:26:34Z")

</div>

I’m getting the following error on a Travis build of BandedMatrices.jl (Travis CI - Test and Deploy Your Code with Confidence), but only on Linux. This appears to happen on the using stage. Any advice on how to debug it? …

---

## [Error messages at \`up\`](https://discourse.julialang.org/t/error-messages-at-up/13431)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 6\
**Last updated:** [September 6, 2018, 6:58am UTC](https://discourse.julialang.org/t/error-messages-at-up/13431 "2018-09-06T06:58:54Z")

</div>

since this morning, up (on Julia 0.7.0 and 1.0.0, Win 64) gives the following message on two separate Win10 PCs Resolving package versions... Updati…

---

## [Heatmap-Images: Are there 32-bit Tiffs with negative or floating point values?](https://discourse.julialang.org/t/heatmap-images-are-there-32-bit-tiffs-with-negative-or-floating-point-values/9886)

<div class="topic-metadata">

**Author:** [@Moses](https://discourse.julialang.org/u/Moses)\
**Replies:** 8\
**Last updated:** [September 6, 2018, 6:38am UTC](https://discourse.julialang.org/t/heatmap-images-are-there-32-bit-tiffs-with-negative-or-floating-point-values/9886 "2018-09-06T06:38:01Z")

</div>

Dear community, I am new to Julia and so far was unable to find an answer to my problem: I am trying to generate heatmaps to locate signal changes in an image stack. My signal cannot only increase, but also decrease. Ac…

---

## [Performance of zeros() vs. Array{T}()?](https://discourse.julialang.org/t/performance-of-zeros-vs-array-t/14596)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 4\
**Last updated:** [September 6, 2018, 2:26am UTC](https://discourse.julialang.org/t/performance-of-zeros-vs-array-t/14596 "2018-09-06T02:26:32Z")

</div>

In the following function, I see 1.56X speedup when using zeros() function for one input instead of using Array{T}(), which seems odd to me. When I use @btime though, I get the same timings. julia\> function vander(v, x,…

---

## [Error matrix infinity norm](https://discourse.julialang.org/t/error-matrix-infinity-norm/14600)

<div class="topic-metadata">

**Author:** [@OlivierHnt](https://discourse.julialang.org/u/OlivierHnt)\
**Replies:** 4\
**Last updated:** [September 6, 2018, 1:31am UTC](https://discourse.julialang.org/t/error-matrix-infinity-norm/14600 "2018-09-06T01:31:29Z")

</div>

Hello, I was having a hard time trying to debug a code today, but it turns out the problem came from the function norm itself. The infinity norm of a matrix is not correct in Julia. According to Julia norm(A,Inf) = max(…

---

## [Dispatching custom \`getindex\` method](https://discourse.julialang.org/t/dispatching-custom-getindex-method/14601)

<div class="topic-metadata">

**Author:** [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Replies:** 1\
**Last updated:** [September 6, 2018, 12:57am UTC](https://discourse.julialang.org/t/dispatching-custom-getindex-method/14601 "2018-09-06T00:57:20Z")

</div>

I have a Vector, say xs. I also have a const CustomType = Int. Basically I want to index xs with CustomType values. Easy enough with xs\[custom\_mapping(i)\]. Is there a way to leverage the type system so I can write xs\[i\] …

---

## [Distributions precompilation error](https://discourse.julialang.org/t/distributions-precompilation-error/14595)

<div class="topic-metadata">

**Author:** [@austinbean](https://discourse.julialang.org/u/austinbean)\
**Replies:** 2\
**Last updated:** [September 5, 2018, 11:49pm UTC](https://discourse.julialang.org/t/distributions-precompilation-error/14595 "2018-09-05T23:49:35Z")

</div>

I wonder if anyone can suggest what I can do about this error. This is on a fresh install of 0.7, as far as I know. (This is on an HPC system and they upgraded at my request so I didn’t do it myself.) \_ …

---

## [Compiler optimization for variables and functions](https://discourse.julialang.org/t/compiler-optimization-for-variables-and-functions/14580)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 16\
**Last updated:** [September 5, 2018, 9:56pm UTC](https://discourse.julialang.org/t/compiler-optimization-for-variables-and-functions/14580 "2018-09-05T21:56:42Z")

</div>

C++ compilers can opt-out some extra variables and unused parts of the code. It seems that Julia doesn’t have such optimizations, e.g.: function addone(x::Int) local y::Int = 10 local z::Int = 3 y = y % x …

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

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