# General Usage

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

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

**Page:** 1037

---

## [Are there more Julia packages?](https://discourse.julialang.org/t/are-there-more-julia-packages/4933)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 5\
**Last updated:** [July 19, 2017, 8:21pm UTC](https://discourse.julialang.org/t/are-there-more-julia-packages/4933 "2017-07-19T20:21:26Z")

</div>

Is there any list of packages besides this one: https://pkg.julialang.org/ Some packages don’t appear here, for example: https://github.com/JuliaCI/BaseBenchmarks.jl Is there any interesting package besides the ones …

---

## [Unsatisfiable requirements for package ForwardDiff](https://discourse.julialang.org/t/unsatisfiable-requirements-for-package-forwarddiff/4922)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 7\
**Last updated:** [July 19, 2017, 7:29pm UTC](https://discourse.julialang.org/t/unsatisfiable-requirements-for-package-forwarddiff/4922 "2017-07-19T19:29:55Z")

</div>

It seems I have run into a problem with having ReverseDiff and DifferentialEquations installed at the same time julia\> Pkg.status("ReverseDiff") - ReverseDiff 0.1.4 julia\> Pkg.status("ForwardDiff") …

---

## [Reshape of subarray](https://discourse.julialang.org/t/reshape-of-subarray/4920)

<div class="topic-metadata">

**Author:** [@antoine-levitt](https://discourse.julialang.org/u/antoine-levitt)\
**Replies:** 4\
**Last updated:** [July 19, 2017, 7:02pm UTC](https://discourse.julialang.org/t/reshape-of-subarray/4920 "2017-07-19T19:02:20Z")

</div>

A = randn(10,2) svd(reshape(view(A,1:10), (5,2))) yields a MethodError. Is it a fault in the way svd is defined, or just me doing something wrong/“unjulian”? What’s the correct way to do this without copy?

---

## [Gtk & Julia User Inputs/Signals](https://discourse.julialang.org/t/gtk-julia-user-inputs-signals/4942)

<div class="topic-metadata">

**Author:** [@Rae](https://discourse.julialang.org/u/Rae)\
**Replies:** 3\
**Last updated:** [July 19, 2017, 4:40pm UTC](https://discourse.julialang.org/t/gtk-julia-user-inputs-signals/4942 "2017-07-19T16:40:00Z")

</div>

I am using Julia and Gtk to build a GUI, but have some trouble with callbacks and signals. How do you get the user inputs from Entry Boxes & user selections from Combo boxes and input it into a function? Many Thanks!

---

## [Can I type assert the eltype of an iterator?](https://discourse.julialang.org/t/can-i-type-assert-the-eltype-of-an-iterator/4936)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 12\
**Last updated:** [July 19, 2017, 1:49pm UTC](https://discourse.julialang.org/t/can-i-type-assert-the-eltype-of-an-iterator/4936 "2017-07-19T13:49:19Z")

</div>

I have a complicated piece of code, with a fragment like: prod(i for i in 1:10 if i \> 10) The product may or may not be empty, depending on circumstances. When it is empty, Julia gives an error: ArgumentError: reduc…

---

## [Type inference of array slices in 0.6](https://discourse.julialang.org/t/type-inference-of-array-slices-in-0-6/4934)

<div class="topic-metadata">

**Author:** [@ksmcreynolds](https://discourse.julialang.org/u/ksmcreynolds)\
**Replies:** 4\
**Last updated:** [July 19, 2017, 12:53pm UTC](https://discourse.julialang.org/t/type-inference-of-array-slices-in-0-6/4934 "2017-07-19T12:53:25Z")

</div>

I came across this strange behavior in 0.6 where the type of an array slice isn’t inferred when it is assigned in a function. Consider this MWE. test(A::Array{Float64, 2}, i::Int64) = A\[i,:\] test2(A::Array{Float64, 2}, …

---

## [Issue with DataFrames, operations on DataFrames now return Nullable Arrays?](https://discourse.julialang.org/t/issue-with-dataframes-operations-on-dataframes-now-return-nullable-arrays/4946)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 5\
**Last updated:** [July 19, 2017, 11:07am UTC](https://discourse.julialang.org/t/issue-with-dataframes-operations-on-dataframes-now-return-nullable-arrays/4946 "2017-07-19T11:07:44Z")

</div>

I would like to change entries in a DataFrame. Before, I was using: df2\[df2\[:country\] .== "United States", :country\] = "USA" which basically looks for entries equal to “United States” in column country and fills those …

---

## [@inbounds with dot notation?](https://discourse.julialang.org/t/inbounds-with-dot-notation/4939)

<div class="topic-metadata">

**Author:** [@dpo](https://discourse.julialang.org/u/dpo)\
**Replies:** 0\
**Last updated:** [July 18, 2017, 11:42pm UTC](https://discourse.julialang.org/t/inbounds-with-dot-notation/4939 "2017-07-18T23:42:06Z")

</div>

I’m wondering how to use @inbounds when vectorizing a function with dot notation or @.. I found Base.@propagate\_inbounds but am not sure I’m using it correctly. Consider using BenchmarkTools Base.@propagate\_inbounds ac…

---

## [How to know if object memory resides on stack or heap?](https://discourse.julialang.org/t/how-to-know-if-object-memory-resides-on-stack-or-heap/4927)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 13\
**Last updated:** [July 18, 2017, 8:01pm UTC](https://discourse.julialang.org/t/how-to-know-if-object-memory-resides-on-stack-or-heap/4927 "2017-07-18T20:01:52Z")

</div>

Is it possible to know in Julia whether an object’s memory resides in stack or heap?

---

## [Print matrix as html/pdf table](https://discourse.julialang.org/t/print-matrix-as-html-pdf-table/4924)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 1\
**Last updated:** [July 18, 2017, 1:44pm UTC](https://discourse.julialang.org/t/print-matrix-as-html-pdf-table/4924 "2017-07-18T13:44:15Z")

</div>

I have a rather wide matrix containing UTF-8 strings. Here’s an example of 6 columns (there are usually more than twice that) "Scarabaeus lamarcki" "First runs from nest" "1" "1 🕢" "0 🕢" "420 🕢" "Coffee beetles" …

---

## [Short-circuit prod(f,itr) if itr contains 0?](https://discourse.julialang.org/t/short-circuit-prod-f-itr-if-itr-contains-0/4917)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [July 18, 2017, 10:14am UTC](https://discourse.julialang.org/t/short-circuit-prod-f-itr-if-itr-contains-0/4917 "2017-07-18T10:14:58Z")

</div>

Does prod(f,itr) short-circuit if itr contains 0?

---

## [F(...) where {T..} really long, but cannot place 'where' in newline?](https://discourse.julialang.org/t/f-where-t-really-long-but-cannot-place-where-in-newline/4918)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [July 18, 2017, 9:50am UTC](https://discourse.julialang.org/t/f-where-t-really-long-but-cannot-place-where-in-newline/4918 "2017-07-18T09:50:00Z")

</div>

I have a long function declaration, function f(...) where {T...} # function code end which takes a lot of arguments and type parameters. Maybe this is bad design or not, but that is not my question now. What I would li…

---

## [@\_inline\_meta](https://discourse.julialang.org/t/-inline-meta/4915)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 2\
**Last updated:** [July 18, 2017, 3:48am UTC](https://discourse.julialang.org/t/-inline-meta/4915 "2017-07-18T03:48:52Z")

</div>

I was going through some examples of generated functions in StaticArrays and I came across the following code snippet with the seemingly unearthly syntax of @\_inline\_meta and the 2 return statements. I would appreciate a…

---

## [GR vs GLVisualize comparison?](https://discourse.julialang.org/t/gr-vs-glvisualize-comparison/3576)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 19\
**Last updated:** [July 18, 2017, 2:52am UTC](https://discourse.julialang.org/t/gr-vs-glvisualize-comparison/3576 "2017-07-18T02:52:25Z")

</div>

Hello. How do you compare GR to GLVisualize. Which one can deal better with large datasets? Which one lets you create simple plots with the lesser code? I’m looking for a replacement to Gadfly, easy to use but faster…

---

## [Multi-dimensional array access](https://discourse.julialang.org/t/multi-dimensional-array-access/4914)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 1\
**Last updated:** [July 18, 2017, 2:45am UTC](https://discourse.julialang.org/t/multi-dimensional-array-access/4914 "2017-07-18T02:45:22Z")

</div>

Multi-dimensional array access with less arguments than dimensions: julia\> A = zeros(3,3,3,3); julia\> A\[1,1\] = 7.0 7.0 julia\> A\[1,1\] 7.0 julia\> A\[1,1,1\] 7.0 julia\> A\[1,1,1,1\] 7.0 What is the rationale for this mean…

---

## [List of features in Julia 0.7](https://discourse.julialang.org/t/list-of-features-in-julia-0-7/4896)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 10:14pm UTC](https://discourse.julialang.org/t/list-of-features-in-julia-0-7/4896 "2017-07-17T22:14:59Z")

</div>

Is there a list of new features to expect in v0.7? Where can I find it?

---

## [\`haskey\` and \`values()\` show different realities? \[SOLVED/CLOSED\]](https://discourse.julialang.org/t/haskey-and-values-show-different-realities-solved-closed/4907)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 6:26pm UTC](https://discourse.julialang.org/t/haskey-and-values-show-different-realities-solved-closed/4907 "2017-07-17T18:26:41Z")

</div>

Here is a MWE: D = 3; L = 2000 vectors = \[rand(L) for i in 1:D\] d = Dict{Vector{Int}, Int}() minima = \[minimum(v) for v in vectors\] ind = zeros(Int, D) ε = 0.001 for j in 1:length(vectors\[1\]) for k in 1:D ind\[k\] =…

---

## [What comparison operators I need to define?](https://discourse.julialang.org/t/what-comparison-operators-i-need-to-define/4895)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [July 17, 2017, 2:59pm UTC](https://discourse.julialang.org/t/what-comparison-operators-i-need-to-define/4895 "2017-07-17T14:59:06Z")

</div>

I find it inconsistent that to define equality, I should define Base.:(==) instead of Base.isequal, but to define inequality, I should define Base.isless instead of Base.:(\<). What’s the rationale for this? In general,…

---

## [Why not "hello" === "hello"?](https://discourse.julialang.org/t/why-not-hello-hello/4903)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 3\
**Last updated:** [July 17, 2017, 2:53pm UTC](https://discourse.julialang.org/t/why-not-hello-hello/4903 "2017-07-17T14:53:24Z")

</div>

I understand that strings are implemented as mutable types. But from a user’s perspective, strings are values, like integers are. Currently "hello" === "hello" returns false, but if it returned true, then things like the…

---

## [Concise way to create numeric type?](https://discourse.julialang.org/t/concise-way-to-create-numeric-type/4900)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 7\
**Last updated:** [July 17, 2017, 1:58pm UTC](https://discourse.julialang.org/t/concise-way-to-create-numeric-type/4900 "2017-07-17T13:58:53Z")

</div>

I am creating a numeric type that contains a single number field, for example: struct T v::Float64 T(v) = 0 \<= v \<= 1 ? new(v) : error("invalid v") end In case you are wondering, I am doing this to ensure that all vari…

---

## [Creation of function using eval](https://discourse.julialang.org/t/creation-of-function-using-eval/4901)

<div class="topic-metadata">

**Author:** [@Paethon](https://discourse.julialang.org/u/Paethon)\
**Replies:** 7\
**Last updated:** [July 17, 2017, 1:12pm UTC](https://discourse.julialang.org/t/creation-of-function-using-eval/4901 "2017-07-17T13:12:35Z")

</div>

Hi I have a small problem regarding the dynamic creation of functions from expressions. My situation is the following: A process dynamically generates a random expression which is then evaluated on given samples and an …

---

## [Homebrew troubles with v0.6](https://discourse.julialang.org/t/homebrew-troubles-with-v0-6/4851)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 3\
**Last updated:** [July 17, 2017, 12:43pm UTC](https://discourse.julialang.org/t/homebrew-troubles-with-v0-6/4851 "2017-07-17T12:43:25Z")

</div>

I can’t install packages on 0.6 because my homebrew doesn’t work. I’ve already reported the issue, but it seems to be a more general problem with my setup, so maybe someone here has an idea of what the problem is. The b…

---

## [Overload === for custom type](https://discourse.julialang.org/t/overload-for-custom-type/4898)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [July 17, 2017, 11:29am UTC](https://discourse.julialang.org/t/overload-for-custom-type/4898 "2017-07-17T11:29:21Z")

</div>

I am trying to overload === on a custom type (as a workaround for https://discourse.julialang.org/t/surprising-struct-equality-test), but I get an error. cannot add methods to a builtin function Here is some code st…

---

## [Max source line length](https://discourse.julialang.org/t/max-source-line-length/4883)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [July 17, 2017, 10:53am UTC](https://discourse.julialang.org/t/max-source-line-length/4883 "2017-07-17T10:53:54Z")

</div>

Is there a recommended max line length for source code in Julia? I know it is up to personal preference to a large extent, but I am wondering if there is a reasonable default. The page on documentation recommends 92, bu…

---

## [How to start Julia REPL with a command?](https://discourse.julialang.org/t/how-to-start-julia-repl-with-a-command/4892)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 5:49am UTC](https://discourse.julialang.org/t/how-to-start-julia-repl-with-a-command/4892 "2017-07-17T05:49:16Z")

</div>

How do you start the Julia REPL with a command? This would be equivalent to how adding code to .juliarc.jl works (but without having any permenance to it) One way I thought of doing was to: make a scratch file and th…

---

## [Lufact throws error on symmetric matrix](https://discourse.julialang.org/t/lufact-throws-error-on-symmetric-matrix/4891)

<div class="topic-metadata">

**Author:** [@dpo](https://discourse.julialang.org/u/dpo)\
**Replies:** 0\
**Last updated:** [July 17, 2017, 3:18am UTC](https://discourse.julialang.org/t/lufact-throws-error-on-symmetric-matrix/4891 "2017-07-17T03:18:52Z")

</div>

I’m a bit surprised at the behavior of \\ in the following experiment: julia\> A = sprand(Float32, 10, 10, .5); julia\> b = rand(Float32, 10); julia\> A \\ b 10-element Array{Float64,1}: 5.86217 5.19403 -6.70831 …

---

## [Mysterious messages printed on Julia 0.7](https://discourse.julialang.org/t/mysterious-messages-printed-on-julia-0-7/4888)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 2\
**Last updated:** [July 17, 2017, 1:43am UTC](https://discourse.julialang.org/t/mysterious-messages-printed-on-julia-0-7/4888 "2017-07-17T01:43:41Z")

</div>

On commit 526b83e3f1 I’m seeing this strange message: julia\> using SpecialFunctions julia\> erfcinv(0.5) in erfcinv at /home/mose/.julia/v0.7/SpecialFunctions/src/erf.jl 0.4769362762044699 julia\> erfcinv(0.5) 0.4769362…

---

## [Deadlock in reading stdout from cmd](https://discourse.julialang.org/t/deadlock-in-reading-stdout-from-cmd/4788)

<div class="topic-metadata">

**Author:** [@evetion](https://discourse.julialang.org/u/evetion)\
**Replies:** 4\
**Last updated:** [July 16, 2017, 6:51pm UTC](https://discourse.julialang.org/t/deadlock-in-reading-stdout-from-cmd/4788 "2017-07-16T18:51:28Z")

</div>

Hi, When reading the stdout from an external program, we sometimes encounter a deadlock (if that’s the correct word). We can reproduce it with a very stripped down example, by just reading a large file (using cat) and r…

---

## [Inheritance or trait function?](https://discourse.julialang.org/t/inheritance-or-trait-function/4873)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 6\
**Last updated:** [July 16, 2017, 3:37pm UTC](https://discourse.julialang.org/t/inheritance-or-trait-function/4873 "2017-07-16T15:37:03Z")

</div>

I am facing a problem for which I am not 100% sure of the pros and cons of two different solutions. Imagine that I have an abstract type: abstract type A end and various concrete types: struct T1 \<: A end struct T2 \<:…

---

## [Iterators, collections, arrays](https://discourse.julialang.org/t/iterators-collections-arrays/4871)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 8\
**Last updated:** [July 16, 2017, 8:08am UTC](https://discourse.julialang.org/t/iterators-collections-arrays/4871 "2017-07-16T08:08:21Z")

</div>

Hello. I’ve being reading a little bit some basic Julia tutorials and I have a doubt: Could anyone explain the difference between Iterators, collections and arrays, please. I’m coming from R and there aren’t iterators…

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

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