# General Usage

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

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

**Page:** 821

---

## [Got route distance 0 between two different GPS locations?](https://discourse.julialang.org/t/got-route-distance-0-between-two-different-gps-locations/30291)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 0\
**Last updated:** [October 25, 2019, 7:25am UTC](https://discourse.julialang.org/t/got-route-distance-0-between-two-different-gps-locations/30291 "2019-10-25T07:25:44Z")

</div>

I have two longitude, latitude pairs in coding, which are randomly generated as the following. location 1: (39.655994758358524, 56.54323616733745) location 2: (32.44297771882851, 68.10900336760139) I need to calculate…

---

## [Convert string of type/eltype to Type itself](https://discourse.julialang.org/t/convert-string-of-type-eltype-to-type-itself/30238)

<div class="topic-metadata">

**Author:** [@FredC](https://discourse.julialang.org/u/FredC)\
**Replies:** 14\
**Last updated:** [October 25, 2019, 12:22am UTC](https://discourse.julialang.org/t/convert-string-of-type-eltype-to-type-itself/30238 "2019-10-25T00:22:47Z")

</div>

I have an Array{String,1} which I want to convert into an array of data types to use with loadnsparse in JuliaDB. There appears to be no way to convert a string such as “Union{Missing, Int64}” into the obvious type?

---

## [How do I write an array of Int8 to disk exactly](https://discourse.julialang.org/t/how-do-i-write-an-array-of-int8-to-disk-exactly/30143)

<div class="topic-metadata">

**Author:** [@gmouts](https://discourse.julialang.org/u/gmouts)\
**Replies:** 3\
**Last updated:** [October 24, 2019, 11:11pm UTC](https://discourse.julialang.org/t/how-do-i-write-an-array-of-int8-to-disk-exactly/30143 "2019-10-24T23:11:33Z")

</div>

I want to create a file that on the disk is exactly the value of a given arrayof UInt8. Say I have generated a arrayof length n and I gave it the name seq. Does the following do what I want? f = open("filename",w) wri…

---

## [JuliaDB loadndsparse: many errors](https://discourse.julialang.org/t/juliadb-loadndsparse-many-errors/30249)

<div class="topic-metadata">

**Author:** [@FredC](https://discourse.julialang.org/u/FredC)\
**Replies:** 15\
**Last updated:** [October 24, 2019, 11:07pm UTC](https://discourse.julialang.org/t/juliadb-loadndsparse-many-errors/30249 "2019-10-24T23:07:27Z")

</div>

I’ve done a fair amount of work to get my CSV cleaned up (pipe-delimited/no quotes), data types and column names right and loaded separate, consulted the out-of-core section of the JuliaDB docs, and I found the TrueFX Ju…

---

## [Separate compile cache for \`julia-debug\`?](https://discourse.julialang.org/t/separate-compile-cache-for-julia-debug/30032)

<div class="topic-metadata">

**Author:** [@twadleigh](https://discourse.julialang.org/u/twadleigh)\
**Replies:** 7\
**Last updated:** [October 24, 2019, 9:39pm UTC](https://discourse.julialang.org/t/separate-compile-cache-for-julia-debug/30032 "2019-10-24T21:39:14Z")

</div>

Whenever I run julia-debug for the first time in a while, I get: \[ Info: Precompiling Revise ...\] as it is initialized in my startup.jl. And, generally, the compile cache is invalidated and everything recompiled. When …

---

## [Bug? isapprox different results elementwise (Julia 1.1.0)](https://discourse.julialang.org/t/bug-isapprox-different-results-elementwise-julia-1-1-0/30271)

<div class="topic-metadata">

**Author:** [@dcastel](https://discourse.julialang.org/u/dcastel)\
**Replies:** 3\
**Last updated:** [October 24, 2019, 4:06pm UTC](https://discourse.julialang.org/t/bug-isapprox-different-results-elementwise-julia-1-1-0/30271 "2019-10-24T16:06:07Z")

</div>

I have this weird case where two tensors are element-wise and size-wise approx equal up to 3 digits but as a whole they aren’t. I’m still running Julia 1.1.0 though. alldigits = cat(\[\[0.375297 0.624703\]; \[0.39924 0.600…

---

## [Memory Error](https://discourse.julialang.org/t/memory-error/30251)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 9\
**Last updated:** [October 24, 2019, 1:06pm UTC](https://discourse.julialang.org/t/memory-error/30251 "2019-10-24T13:06:16Z")

</div>

Hi! I am currently using Julia to download, extract and resort data. The procedure is as follows: For each day a) Download data for every hour b) Extract hourly data and combine into a single matrix c) From that s…

---

## [CSV.jl, Write to files](https://discourse.julialang.org/t/csv-jl-write-to-files/30265)

<div class="topic-metadata">

**Author:** [@Anil\_Mathews](https://discourse.julialang.org/u/Anil_Mathews)\
**Replies:** 3\
**Last updated:** [October 24, 2019, 11:58am UTC](https://discourse.julialang.org/t/csv-jl-write-to-files/30265 "2019-10-24T11:58:43Z")

</div>

I was trying wite the companies name to CSV files. But I am getting the values what is the error in this code Letters=\["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y"…

---

## [Findall slow](https://discourse.julialang.org/t/findall-slow/30247)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 8\
**Last updated:** [October 24, 2019, 8:26am UTC](https://discourse.julialang.org/t/findall-slow/30247 "2019-10-24T08:26:28Z")

</div>

Hello, I would like to find indices of a 1D array wich verify a given condition. I think that the way to go is to use the function findall. However I have found this tricky way to be actually faster and has way less mem…

---

## [Why to assign a lot of variants to one array? (Basic syntax)](https://discourse.julialang.org/t/why-to-assign-a-lot-of-variants-to-one-array-basic-syntax/30253)

<div class="topic-metadata">

**Author:** [@Yan](https://discourse.julialang.org/u/Yan)\
**Replies:** 1\
**Last updated:** [October 24, 2019, 12:40am UTC](https://discourse.julialang.org/t/why-to-assign-a-lot-of-variants-to-one-array-basic-syntax/30253 "2019-10-24T00:40:02Z")

</div>

a=b=c=\[0\] x=y=z=0 Why producing different meanings behind a similar basic syntax? despite one for immutable, another for mutable.

---

## [Preventing dispatch on val not bits](https://discourse.julialang.org/t/preventing-dispatch-on-val-not-bits/27911)

<div class="topic-metadata">

**Author:** [@o314](https://discourse.julialang.org/u/o314)\
**Replies:** 5\
**Last updated:** [October 23, 2019, 10:55pm UTC](https://discourse.julialang.org/t/preventing-dispatch-on-val-not-bits/27911 "2019-10-23T22:55:58Z")

</div>

Val is mainly use to dispatch on bits type with static optimization. It’s rather simple to do a coding error and dispatch on Val(:foo) that is not a bits type instance. Is it possible that the compiler emits a warning …

---

## [Saving only part of the solution in DifferentialEquations.jl](https://discourse.julialang.org/t/saving-only-part-of-the-solution-in-differentialequations-jl/30134)

<div class="topic-metadata">

**Author:** [@LolianSh](https://discourse.julialang.org/u/LolianSh)\
**Replies:** 6\
**Last updated:** [October 23, 2019, 8:28pm UTC](https://discourse.julialang.org/t/saving-only-part-of-the-solution-in-differentialequations-jl/30134 "2019-10-23T20:28:41Z")

</div>

I want to use DifferentialEquations.jl to solve a system of stochastic time dependent PDEs, with a complicated geometry (multiple extended variables occupying different geometries, 1D+2D or 2D+3D, in the same simulation)…

---

## [Julia in production: examples and share your experience](https://discourse.julialang.org/t/julia-in-production-examples-and-share-your-experience/30223)

<div class="topic-metadata">

**Author:** [@jair\_wuilloud](https://discourse.julialang.org/u/jair_wuilloud)\
**Replies:** 7\
**Last updated:** [October 23, 2019, 7:45pm UTC](https://discourse.julialang.org/t/julia-in-production-examples-and-share-your-experience/30223 "2019-10-23T19:45:23Z")

</div>

I am looking for examples of Julia successfully implemented IN PRODUCTION. Can somebody point me at examples or share positive/negative experience with Julia in Prod.?

---

## [Type promototion of Vectors](https://discourse.julialang.org/t/type-promototion-of-vectors/30227)

<div class="topic-metadata">

**Author:** [@mtfishman](https://discourse.julialang.org/u/mtfishman)\
**Replies:** 6\
**Last updated:** [October 23, 2019, 4:09pm UTC](https://discourse.julialang.org/t/type-promototion-of-vectors/30227 "2019-10-23T16:09:23Z")

</div>

I believe this might be considered a bug in type promotion, but I wanted to ask here first before reporting an issue. In Julia v1.2.0 and v1.3.0-rc4.1, I see the following behavior: julia\> promote\_type(ComplexF64,Float3…

---

## [Get route length 0 wile trying to caculate route between two given locations using package OpenStreetMapX](https://discourse.julialang.org/t/get-route-length-0-wile-trying-to-caculate-route-between-two-given-locations-using-package-openstreetmapx/30220)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 0\
**Last updated:** [October 23, 2019, 1:53pm UTC](https://discourse.julialang.org/t/get-route-length-0-wile-trying-to-caculate-route-between-two-given-locations-using-package-openstreetmapx/30220 "2019-10-23T13:53:02Z")

</div>

I have two locations with latitude and longitude pair as the following: loc1 = (35.96395340992261,25.08696560352753) loc2 = (69.37249071020585,35.60655488064029) Openstreetmap data is obtained from the link: GEOFABRIK…

---

## [Example for using Interact.tabs](https://discourse.julialang.org/t/example-for-using-interact-tabs/30216)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [October 23, 2019, 12:15pm UTC](https://discourse.julialang.org/t/example-for-using-interact-tabs/30216 "2019-10-23T12:15:41Z")

</div>

Does any one have some example where they use Interact.tabs ? I’m mainly looking for some example where tabs is used to switch between “pages”, like a web-browser (and adding new tabs by pressing on the + tab). Thanks!

---

## [Strange behavior of Debugger, Atom, Julia code?](https://discourse.julialang.org/t/strange-behavior-of-debugger-atom-julia-code/30207)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [October 23, 2019, 9:22am UTC](https://discourse.julialang.org/t/strange-behavior-of-debugger-atom-julia-code/30207 "2019-10-23T09:22:27Z")

</div>

I was wondering, does anyone experience something strange like what I encountered currently. Code: using OpenStreetMapX using Debugger @enter OpenStreetMapX.get\_map\_data("/home/Desktop/s.osm") println("haha") Then, R…

---

## [Explicit version ranges in compat section in Project.toml?](https://discourse.julialang.org/t/explicit-version-ranges-in-compat-section-in-project-toml/30147)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 12\
**Last updated:** [October 23, 2019, 8:37am UTC](https://discourse.julialang.org/t/explicit-version-ranges-in-compat-section-in-project-toml/30147 "2019-10-23T08:37:29Z")

</div>

Is it possible to specify an explicit version range in the \[compat\] section of a “Project.toml” file? To prevent resolution failure among several packages with inter-dependencies, while also satisfying the new rules for …

---

## [Bad performance of group\_by of DataFrames - updated -](https://discourse.julialang.org/t/bad-performance-of-group-by-of-dataframes-updated/30061)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 21\
**Last updated:** [October 23, 2019, 8:24am UTC](https://discourse.julialang.org/t/bad-performance-of-group-by-of-dataframes-updated/30061 "2019-10-23T08:24:08Z")

</div>

Hello, I am working on a small dataset with 30 rows and 19 columns. I do a group\_by on 3 colums and aggregate between one and all colums, using sum or maximum as aggregation functions. The number of colums that are q…

---

## [Data structures for threaded computing](https://discourse.julialang.org/t/data-structures-for-threaded-computing/30131)

<div class="topic-metadata">

**Author:** [@dataDiver](https://discourse.julialang.org/u/dataDiver)\
**Replies:** 23\
**Last updated:** [October 23, 2019, 7:32am UTC](https://discourse.julialang.org/t/data-structures-for-threaded-computing/30131 "2019-10-23T07:32:25Z")

</div>

I have noticed that I am not getting the correct multiple speedups I should be getting when using threads in Julia v1.3 rc4 for what are essentially independent calculations. When I try breaking up the matrices into arra…

---

## [Vcat list of dataframes in for loop](https://discourse.julialang.org/t/vcat-list-of-dataframes-in-for-loop/30188)

<div class="topic-metadata">

**Author:** [@FredC](https://discourse.julialang.org/u/FredC)\
**Replies:** 4\
**Last updated:** [October 22, 2019, 9:14pm UTC](https://discourse.julialang.org/t/vcat-list-of-dataframes-in-for-loop/30188 "2019-10-22T21:14:56Z")

</div>

I’m attempting something like out = DataFrame() for f in readdir(“csvs”) vcat(out,CSV.read(f)) end out is empty at the end of the for loop even though everything seems to be working. Context is that I’m trying to memo…

---

## [Making mapslices drop dimensions for scalars results automatially](https://discourse.julialang.org/t/making-mapslices-drop-dimensions-for-scalars-results-automatially/19624)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [October 22, 2019, 6:42pm UTC](https://discourse.julialang.org/t/making-mapslices-drop-dimensions-for-scalars-results-automatially/19624 "2019-10-22T18:42:25Z")

</div>

In a sense, I am looking for a workaround for #16606: for functions which return an array, I would like to keep it as is, but for functions which return a scalar, I would like to drop the relevant dimension. I can’t just…

---

## [Properly query methods of a function?](https://discourse.julialang.org/t/properly-query-methods-of-a-function/30178)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 3\
**Last updated:** [October 22, 2019, 6:18pm UTC](https://discourse.julialang.org/t/properly-query-methods-of-a-function/30178 "2019-10-22T18:18:56Z")

</div>

sig\_params(t::UnionAll) = sig\_params(t.body) sig\_params(t::DataType) = t.parameters\[2:end\] abstract type AT2{T\<:Real} end f(x::AT2{Float64}) = "AT2{Float64}" f(x::T) where T\<:AT2 = "T\<:AT2" julia\>…

---

## [Is it possible to express a type relationship between arrays with different numbers of dimensions?](https://discourse.julialang.org/t/is-it-possible-to-express-a-type-relationship-between-arrays-with-different-numbers-of-dimensions/30149)

<div class="topic-metadata">

**Author:** [@bcmichael](https://discourse.julialang.org/u/bcmichael)\
**Replies:** 21\
**Last updated:** [October 22, 2019, 5:12pm UTC](https://discourse.julialang.org/t/is-it-possible-to-express-a-type-relationship-between-arrays-with-different-numbers-of-dimensions/30149 "2019-10-22T17:12:12Z")

</div>

What I really want to be able to do is express a type such as: struct Foo{T,N} a::Array{T,N} b::Array{T,N+1} # doesn't work but I hope it conveys what I want end The important part for me is that the b field has one mo…

---

## [Documentation for parallel computing - clarification](https://discourse.julialang.org/t/documentation-for-parallel-computing-clarification/30057)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 3\
**Last updated:** [October 22, 2019, 4:43pm UTC](https://discourse.julialang.org/t/documentation-for-parallel-computing-clarification/30057 "2019-10-22T16:43:07Z")

</div>

Two bits of clarification. Are these two statements correct? All parallel functions require that the user has started worker processes separately with addprocs(). You need to add at least 2 worker processes to see …

---

## [Editing UnionAll and putting it back together](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 4\
**Last updated:** [October 22, 2019, 3:37pm UTC](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116 "2019-10-22T15:37:38Z")

</div>

typ = Tuple{Int,T} where T\<:Real unwtyp = Base.unwrap\_unionall(typ) # Tuple{Int,T\<:Real} edited = edit(unwtyp,Real,Float64) # Tuple{Int,T\<:Float64}, has free type variables. I want to put Tuple{Int,T\<:Float64} back to …

---

## [Type-stable zip of tuple](https://discourse.julialang.org/t/type-stable-zip-of-tuple/30105)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [October 22, 2019, 2:53pm UTC](https://discourse.julialang.org/t/type-stable-zip-of-tuple/30105 "2019-10-22T14:53:41Z")

</div>

I have trouble getting this to infer (on 1.3; but the same happens on 1.2): function zipped\_pairs\_product(pairs) itrs = map(pair -\> zip(pair...), pairs) vec(collect(Iterators.product(itrs...))) end pairs = (1:5…

---

## [BigFloat memory usage](https://discourse.julialang.org/t/bigfloat-memory-usage/30136)

<div class="topic-metadata">

**Author:** [@ckoe-bccms](https://discourse.julialang.org/u/ckoe-bccms)\
**Replies:** 1\
**Last updated:** [October 22, 2019, 2:20pm UTC](https://discourse.julialang.org/t/bigfloat-memory-usage/30136 "2019-10-22T14:20:11Z")

</div>

Hello, I have a problem concerning the memory usage of BigFloats. I have quite some trouble switching a self-written ODE solver as well as DifferentialEquations.jl (less tests with that) from Float64 to BigFloat becaus…

---

## [Why Rebugger.keybinding use this strange strings (anti-human)?](https://discourse.julialang.org/t/why-rebugger-keybinding-use-this-strange-strings-anti-human/29485)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 5\
**Last updated:** [October 22, 2019, 2:16pm UTC](https://discourse.julialang.org/t/why-rebugger-keybinding-use-this-strange-strings-anti-human/29485 "2019-10-22T14:16:46Z")

</div>

Hi, I was trying to configure the keymap functions of Rebugger. Following is the code I put in the file startup.jl # This file should contain site-specific commands to be executed on Julia startup; # Users may store the…

---

## [How to step to the next line using option n of Debugger.jl julia?](https://discourse.julialang.org/t/how-to-step-to-the-next-line-using-option-n-of-debugger-jl-julia/29483)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 26\
**Last updated:** [October 22, 2019, 7:54am UTC](https://discourse.julialang.org/t/how-to-step-to-the-next-line-using-option-n-of-debugger-jl-julia/29483 "2019-10-22T07:54:37Z")

</div>

This should be simple, yet I need some lights. \_/ |\\\_\_'\_|\_|\_|\\\_\_'\_| | Official https://julialang.org/ release |\_\_/ | julia\> using Debugger \[ Info: Precompiling Debugger \[31a5f54b-26ea-5ae9-a837-f05…

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

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