# General Usage

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

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

**Page:** 877

---

## [Feature or Bug? - Divide by zeros: 1/0 vs \[1\]/\[0\]](https://discourse.julialang.org/t/feature-or-bug-divide-by-zeros-1-0-vs-1-0/22960)

<div class="topic-metadata">

**Author:** [@bachrathyd](https://discourse.julialang.org/u/bachrathyd)\
**Replies:** 11\
**Last updated:** [April 10, 2019, 1:46pm UTC](https://discourse.julialang.org/t/feature-or-bug-divide-by-zeros-1-0-vs-1-0/22960 "2019-04-10T13:46:17Z")

</div>

Before I open an Issue, I would like to discuss this question. The core of the question is the following difference: julia\> 1 / 0 Inf julia\> \[1\] / \[0\] 1×1 Array{Float64,2}: 0.0 In my method this lead to a problem as d…

---

## [Reset all julia data from C](https://discourse.julialang.org/t/reset-all-julia-data-from-c/22833)

<div class="topic-metadata">

**Author:** [@kim366](https://discourse.julialang.org/u/kim366)\
**Replies:** 0\
**Last updated:** [April 6, 2019, 9:19am UTC](https://discourse.julialang.org/t/reset-all-julia-data-from-c/22833 "2019-04-06T09:19:09Z")

</div>

I thought that jl\_atexit\_hook cleared all of julia data, but when I do something along the lines of jl\_init(); jl\_eval\_str("x = 5"); jl\_atexit\_hook(0); jl\_init(); jl\_unbox\_int64(jl\_eval\_str("x")); jl\_atexit\_hook(0); W…

---

## [Positive Definite Matrices, Symmetric or Hermitian](https://discourse.julialang.org/t/positive-definite-matrices-symmetric-or-hermitian/22965)

<div class="topic-metadata">

**Author:** [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Replies:** 4\
**Last updated:** [April 10, 2019, 8:31am UTC](https://discourse.julialang.org/t/positive-definite-matrices-symmetric-or-hermitian/22965 "2019-04-10T08:31:09Z")

</div>

Hello, I am writing a package for manipulating positive definite matrices on their Riemannian manifold. Those matrix may be real or complex and the code should be able to treat either case alike. My code involves stan…

---

## [what is "1.2+0.21" in Julia?](https://discourse.julialang.org/t/what-is-1-2-0-21-in-julia/13085)

<div class="topic-metadata">

**Author:** [@askuyue](https://discourse.julialang.org/u/askuyue)\
**Replies:** 15\
**Last updated:** [April 10, 2019, 6:26am UTC](https://discourse.julialang.org/t/what-is-1-2-0-21-in-julia/13085 "2019-04-10T06:26:26Z")

</div>

Julia\>1.2 + 0.12 1.3199999999999998

---

## [Code Generation](https://discourse.julialang.org/t/code-generation/22985)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 2\
**Last updated:** [April 10, 2019, 6:07am UTC](https://discourse.julialang.org/t/code-generation/22985 "2019-04-10T06:07:56Z")

</div>

I have a question which I am having trouble figuring out. assume I have the following function gentype() = PP assume I have a type as QQ{MM{gentype(){LL{Int}},Z}, NN{LL{Z}}} I want to transform it to another type XQQ…

---

## [JuliaDB won't open CSV file](https://discourse.julialang.org/t/juliadb-wont-open-csv-file/22981)

<div class="topic-metadata">

**Author:** [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Replies:** 6\
**Last updated:** [April 10, 2019, 1:50am UTC](https://discourse.julialang.org/t/juliadb-wont-open-csv-file/22981 "2019-04-10T01:50:57Z")

</div>

I have been using JuliaDB across my various OSX, Linux, and Windows computer to load data for a project. I am working off of my Linux computer currently, but JuliaDB doesn’t seem to want to open a single CSV file. It is …

---

## [NLopt optimization with inequality constraint where objective function is undefined outside of the constraint](https://discourse.julialang.org/t/nlopt-optimization-with-inequality-constraint-where-objective-function-is-undefined-outside-of-the-constraint/22924)

<div class="topic-metadata">

**Author:** [@Shunsuke-Hori](https://discourse.julialang.org/u/Shunsuke-Hori)\
**Replies:** 3\
**Last updated:** [April 10, 2019, 1:43am UTC](https://discourse.julialang.org/t/nlopt-optimization-with-inequality-constraint-where-objective-function-is-undefined-outside-of-the-constraint/22924 "2019-04-10T01:43:23Z")

</div>

Hello, I would like to do nonlinear optimization with inequality constraint by NLopt, in which my objective function is not defined when the constraint is not satisfied. I’m using LN\_COBYLA because I cannot compute the …

---

## [How to construct a DataFrame with a loop?](https://discourse.julialang.org/t/how-to-construct-a-dataframe-with-a-loop/22958)

<div class="topic-metadata">

**Author:** [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Replies:** 7\
**Last updated:** [April 9, 2019, 10:54pm UTC](https://discourse.julialang.org/t/how-to-construct-a-dataframe-with-a-loop/22958 "2019-04-09T22:54:29Z")

</div>

Hello, I need to construct a DataFrame similar to: df=DataFrame(\[ String, String, String, ... \], \[ :cod\_1, :cod\_2, :cod\_3, cod\_... \], 0); where…

---

## [CartesianIndices syntax](https://discourse.julialang.org/t/cartesianindices-syntax/22970)

<div class="topic-metadata">

**Author:** [@Pier](https://discourse.julialang.org/u/Pier)\
**Replies:** 6\
**Last updated:** [April 9, 2019, 9:19pm UTC](https://discourse.julialang.org/t/cartesianindices-syntax/22970 "2019-04-09T21:19:26Z")

</div>

Imagine a 5x5 matrix. One can look at the entries in rows 2:3 and columns 2 and 5 with view(A,2:3,\[2,5\]). However CartesianIndices((2:3,\[2,5\])) is not admissible, although I believe that the meaning of it is clear. The…

---

## [PhysicalConstants package with Julia 1.0.1.1?](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189)

<div class="topic-metadata">

**Author:** [@astrowanders](https://discourse.julialang.org/u/astrowanders)\
**Replies:** 14\
**Last updated:** [April 9, 2019, 7:50pm UTC](https://discourse.julialang.org/t/physicalconstants-package-with-julia-1-0-1-1/16189 "2019-04-09T19:50:23Z")

</div>

Hello, I’ve been using thePhysicalConstants.jl package for some time now, and greatly appreciate the ability to define CGS or MKS units. We use CGS units in astrophysics. The PhysicalConstants package was developed abo…

---

## [Strange segfault](https://discourse.julialang.org/t/strange-segfault/22932)

<div class="topic-metadata">

**Author:** [@Diego\_Javier\_Zea](https://discourse.julialang.org/u/Diego_Javier_Zea)\
**Replies:** 4\
**Last updated:** [April 9, 2019, 3:02pm UTC](https://discourse.julialang.org/t/strange-segfault/22932 "2019-04-09T15:02:32Z")

</div>

Hi, I have a strange segmentation fault with the next code: using BioAlignments using MIToS.MSA using MIToS.SIFTS using MIToS.PDB using StatsPlots filename = "/home/zea/.julia/dev/MIToS/test/data/modeller.pir.gz"; msa…

---

## [Swimmer Plot in Plots.jl](https://discourse.julialang.org/t/swimmer-plot-in-plots-jl/22961)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 0\
**Last updated:** [April 9, 2019, 2:41pm UTC](https://discourse.julialang.org/t/swimmer-plot-in-plots-jl/22961 "2019-04-09T14:41:53Z")

</div>

I am trying to display several processes across time as a swimmer plot. Each horizontal bar or “lane” is color coded and represents whether a given process is active at a particular time. Is it possible to do this in Plo…

---

## [How to write many DataFrames in a single CSV file?](https://discourse.julialang.org/t/how-to-write-many-dataframes-in-a-single-csv-file/22818)

<div class="topic-metadata">

**Author:** [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Replies:** 2\
**Last updated:** [April 9, 2019, 12:36pm UTC](https://discourse.julialang.org/t/how-to-write-many-dataframes-in-a-single-csv-file/22818 "2019-04-09T12:36:34Z")

</div>

Hello, Is it possible to write many DataFrames (with identical structure) in a single CSV file by using for example CSV.write and a loop ? Thank you very much for your advice ! Moreover, how to write 2 DataFrames wit…

---

## [Lazy Iteration](https://discourse.julialang.org/t/lazy-iteration/22933)

<div class="topic-metadata">

**Author:** [@srb](https://discourse.julialang.org/u/srb)\
**Replies:** 4\
**Last updated:** [April 8, 2019, 8:17pm UTC](https://discourse.julialang.org/t/lazy-iteration/22933 "2019-04-08T20:17:08Z")

</div>

I have defined a certain type that can hold arbitrarily many values, and I have already implemented an iterate() method for it. However, it seems to me that this method allocates all of the iterators elements in memory s…

---

## [Could not load library librsvg - very strange error](https://discourse.julialang.org/t/could-not-load-library-librsvg-very-strange-error/21276)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 11\
**Last updated:** [April 8, 2019, 7:10pm UTC](https://discourse.julialang.org/t/could-not-load-library-librsvg-very-strange-error/21276 "2019-04-08T19:10:46Z")

</div>

I’m using VegaLite library, and after some update it does not load when imported after PyPlot: using PyPlot using VegaLite gives the following: ERROR: InitError: error compiling \_\_init\_\_: could not load library "/usr/…

---

## [Registry problems. Related to the planned change?](https://discourse.julialang.org/t/registry-problems-related-to-the-planned-change/22925)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [April 8, 2019, 4:12pm UTC](https://discourse.julialang.org/t/registry-problems-related-to-the-planned-change/22925 "2019-04-08T16:12:16Z")

</div>

pkrysl@FIRENZE:/mnt/c/Users/PKrysl/Documents/AcoustColAluCyl$ ../julia-1.1.0/bin/julia \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ …

---

## [Parallel computation of multiplication of large matrices](https://discourse.julialang.org/t/parallel-computation-of-multiplication-of-large-matrices/22898)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 5\
**Last updated:** [April 8, 2019, 4:07pm UTC](https://discourse.julialang.org/t/parallel-computation-of-multiplication-of-large-matrices/22898 "2019-04-08T16:07:35Z")

</div>

A common task in many programs is to multiply two large matrices, namely, A = B \*C. Is there a way to do it in a way that utlizes all the processors ? This is a task that is theoretically, very easy to parallelize over a…

---

## [Collect JDBC Results](https://discourse.julialang.org/t/collect-jdbc-results/22927)

<div class="topic-metadata">

**Author:** [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Replies:** 0\
**Last updated:** [April 8, 2019, 4:06pm UTC](https://discourse.julialang.org/t/collect-jdbc-results/22927 "2019-04-08T16:06:42Z")

</div>

I am trying to extract data from an Oracle JDBC connection. I have successfully connected and can put the data out and see it in the REPL. However I want to collect the println results of the iterator in an object. How d…

---

## [Set a breakpoint in the custom module](https://discourse.julialang.org/t/set-a-breakpoint-in-the-custom-module/22823)

<div class="topic-metadata">

**Author:** [@mzhenirovskyy](https://discourse.julialang.org/u/mzhenirovskyy)\
**Replies:** 1\
**Last updated:** [April 8, 2019, 3:58pm UTC](https://discourse.julialang.org/t/set-a-breakpoint-in-the-custom-module/22823 "2019-04-08T15:58:00Z")

</div>

I want to set up breakpoint in the custom module. My module is in the file “utils.jl”: using Revise using Debugger module Utils export myfunc2 function myfunc2(x) x = x .^2 @bp x = x .+ 3 end end When…

---

## [Matrix block indexing](https://discourse.julialang.org/t/matrix-block-indexing/22922)

<div class="topic-metadata">

**Author:** [@Invarianz](https://discourse.julialang.org/u/Invarianz)\
**Replies:** 2\
**Last updated:** [April 8, 2019, 3:40pm UTC](https://discourse.julialang.org/t/matrix-block-indexing/22922 "2019-04-08T15:40:53Z")

</div>

I also posted this question on stackeroverflow.com, so if anyone wants to also answer it there I would happily accept it. I am using Julia version 1.1. I am working a lot with matrices that can be constructed from small…

---

## [Support CartesianIndices with Arrays and other iterables, not just ranges (alternative?)](https://discourse.julialang.org/t/support-cartesianindices-with-arrays-and-other-iterables-not-just-ranges-alternative/22812)

<div class="topic-metadata">

**Author:** [@ksamtsak](https://discourse.julialang.org/u/ksamtsak)\
**Replies:** 7\
**Last updated:** [April 8, 2019, 2:41pm UTC](https://discourse.julialang.org/t/support-cartesianindices-with-arrays-and-other-iterables-not-just-ranges-alternative/22812 "2019-04-08T14:41:04Z")

</div>

I’m making a custom array (SparseSynapses{Npre,Npost}) that simulates multidimensional sparse tensors on top of SparseMatrixCSC (for a specific case). To perform the transformation of multidimensional CartesianIndex-es t…

---

## [INCOMPLETE FUNCTION (end) error](https://discourse.julialang.org/t/incomplete-function-end-error/22920)

<div class="topic-metadata">

**Author:** [@Angela\_Mulenga](https://discourse.julialang.org/u/Angela_Mulenga)\
**Replies:** 2\
**Last updated:** [April 8, 2019, 2:03pm UTC](https://discourse.julialang.org/t/incomplete-function-end-error/22920 "2019-04-08T14:03:46Z")

</div>

I keep getting the error ‘syntax: incomplete: “function” at none:2 requires end’ but when I check all my fucntions have an ‘end’. Kindly show me where the error is how to correct it. Here is the code: function C…

---

## [I am unable to add stdlib libraries](https://discourse.julialang.org/t/i-am-unable-to-add-stdlib-libraries/22910)

<div class="topic-metadata">

**Author:** [@HBaghdadi1995](https://discourse.julialang.org/u/HBaghdadi1995)\
**Replies:** 2\
**Last updated:** [April 8, 2019, 1:20pm UTC](https://discourse.julialang.org/t/i-am-unable-to-add-stdlib-libraries/22910 "2019-04-08T13:20:03Z")

</div>

I activated a project of my own to modify the project.toml and manifest.toml files and then went back to activate .julia\\environments\\v1.1. When I try to add an stdlib that I haven’t load before hower, it returns an erro…

---

## [Have to click on stack frame when debugging in Juno](https://discourse.julialang.org/t/have-to-click-on-stack-frame-when-debugging-in-juno/22909)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 4\
**Last updated:** [April 8, 2019, 11:58am UTC](https://discourse.julialang.org/t/have-to-click-on-stack-frame-when-debugging-in-juno/22909 "2019-04-08T11:58:04Z")

</div>

I’m trying out the debugger in Juno for the first time. I notice that when a breakpoint is hit and the prompt turns to debug\>, the prompt is not automatically in the innermost stack frame, even though this is highlighted…

---

## [Making new a bit more automatic](https://discourse.julialang.org/t/making-new-a-bit-more-automatic/22905)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [April 8, 2019, 10:46am UTC](https://discourse.julialang.org/t/making-new-a-bit-more-automatic/22905 "2019-04-08T10:46:28Z")

</div>

Consider a definition with the outer-only constructor Base.@kwdef struct Foo{T,S} a::T b::S function Foo(a::T, b::S) where {T,S} @assert a \> 0 && b \> 0 new{T,S}(a, b) end end where T and…

---

## [Convert Matlab Code to Julia 1.0](https://discourse.julialang.org/t/convert-matlab-code-to-julia-1-0/21529)

<div class="topic-metadata">

**Author:** [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Replies:** 22\
**Last updated:** [April 8, 2019, 9:35am UTC](https://discourse.julialang.org/t/convert-matlab-code-to-julia-1-0/21529 "2019-04-08T09:35:26Z")

</div>

Dear all, I want to ask, which best tool that I can convert Matlab code to Julia, now some tools are not supported any more in GitHub…… Best regards

---

## [Windows, simple way of gettting path to package with single backslashes](https://discourse.julialang.org/t/windows-simple-way-of-gettting-path-to-package-with-single-backslashes/22906)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 2\
**Last updated:** [April 8, 2019, 8:44am UTC](https://discourse.julialang.org/t/windows-simple-way-of-gettting-path-to-package-with-single-backslashes/22906 "2019-04-08T08:44:12Z")

</div>

For example, when I have a package called ‘MyPackage’ then I call this to get the package directory pathof(MyPackage) "C:\\\\Users\\\\User\\\\.julia\\\\packages\\\\MyPacakge\\\\ouQ51\\\\src\\\\MyPackage.jl" If I want to paste this in…

---

## [Generate next random value based on a given statistical distribution in julia?](https://discourse.julialang.org/t/generate-next-random-value-based-on-a-given-statistical-distribution-in-julia/22872)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [April 8, 2019, 7:19am UTC](https://discourse.julialang.org/t/generate-next-random-value-based-on-a-given-statistical-distribution-in-julia/22872 "2019-04-08T07:19:48Z")

</div>

mutable struct DistrRng{T\<:Sampleable} d::T rng::MersenneTwister function DistrRng(d::T, rng::MersenneTwister) where T \<: Sampleable return new{T}(d, deepcopy(rng)) end function DistrRng(d::T; seed::Int = nullInd…

---

## [What wrong in cat ? Two simillar Arrays! ERROR: UndefRefError: access to undefined reference](https://discourse.julialang.org/t/what-wrong-in-cat-two-simillar-arrays-error-undefreferror-access-to-undefined-reference/22884)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 6\
**Last updated:** [April 8, 2019, 1:45am UTC](https://discourse.julialang.org/t/what-wrong-in-cat-two-simillar-arrays-error-undefreferror-access-to-undefined-reference/22884 "2019-04-08T01:45:08Z")

</div>

What wrong in cat ? Two simillar Arrays ! julia\> pole0 3×2 Array{Any,2}: “a” undef undef undef undef undef julia\> poleL 3×2 Array{Any,2}: “M999” “Tak” undef “Nie” undef undef julia\> hcat(po…

---

## [Type Float64 has no field head](https://discourse.julialang.org/t/type-float64-has-no-field-head/22897)

<div class="topic-metadata">

**Author:** [@Y\_Li](https://discourse.julialang.org/u/Y_Li)\
**Replies:** 2\
**Last updated:** [April 8, 2019, 12:35am UTC](https://discourse.julialang.org/t/type-float64-has-no-field-head/22897 "2019-04-08T00:35:28Z")

</div>

what does"type Float64 has no field head" means exactly?

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

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