# General Usage

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

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

**Page:** 820

---

## [Benchmarking the cost of allocation](https://discourse.julialang.org/t/benchmarking-the-cost-of-allocation/30435)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [October 29, 2019, 12:21pm UTC](https://discourse.julialang.org/t/benchmarking-the-cost-of-allocation/30435 "2019-10-29T12:21:30Z")

</div>

I would like to have an educated guess of how much speed I would gain if I rewrote a rather large codebase with preallocated buffers (all the other low-hanging fruits I could think of have been harvested at this point, e…

---

## [How to draw this picture?](https://discourse.julialang.org/t/how-to-draw-this-picture/30432)

<div class="topic-metadata">

**Author:** [@vtchen](https://discourse.julialang.org/u/vtchen)\
**Replies:** 0\
**Last updated:** [October 29, 2019, 8:50am UTC](https://discourse.julialang.org/t/how-to-draw-this-picture/30432 "2019-10-29T08:50:01Z")

</div>

There is such a picture in this video ( JuliaCon 2018 | Solving Partial Differential Equations with Julia | Chris Rackauckas(https://www.youtube.com/watch?v=okGybBmihOE, 34:24)). I want to know how to draw it. Can som…

---

## [Extending Base.read, issue with keyword arguments](https://discourse.julialang.org/t/extending-base-read-issue-with-keyword-arguments/30412)

<div class="topic-metadata">

**Author:** [@emiles](https://discourse.julialang.org/u/emiles)\
**Replies:** 3\
**Last updated:** [October 29, 2019, 7:15am UTC](https://discourse.julialang.org/t/extending-base-read-issue-with-keyword-arguments/30412 "2019-10-29T07:15:53Z")

</div>

In the process of implementing a library (ITensors.jl), we were planning to extend the Base.read methods to support the custom types introduced by our library. So these extensions, in their most basic form, would work by…

---

## [Using a bi-directional pipe to read and write from 'cmd'](https://discourse.julialang.org/t/using-a-bi-directional-pipe-to-read-and-write-from-cmd/30313)

<div class="topic-metadata">

**Author:** [@ko56](https://discourse.julialang.org/u/ko56)\
**Replies:** 5\
**Last updated:** [October 28, 2019, 9:57pm UTC](https://discourse.julialang.org/t/using-a-bi-directional-pipe-to-read-and-write-from-cmd/30313 "2019-10-28T21:57:15Z")

</div>

Hi, I’m using a bi-directional pipe for Julia 1.1.1 to communicate back and forth with an external process: cvc4 = open(\`cvc4 --incremental\`, read=true, write=true) The 2-way communication seems to work ok, except whe…

---

## [Program structure](https://discourse.julialang.org/t/program-structure/30376)

<div class="topic-metadata">

**Author:** [@Ebtissam](https://discourse.julialang.org/u/Ebtissam)\
**Replies:** 6\
**Last updated:** [October 28, 2019, 8:05pm UTC](https://discourse.julialang.org/t/program-structure/30376 "2019-10-28T20:05:06Z")

</div>

Hello everyone i am new to Julia language i need help regarding program structure of Julia language. (What is the program structure of Julia language?)

---

## [Why do you use JuliaDB?](https://discourse.julialang.org/t/why-do-you-use-juliadb/30410)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 9\
**Last updated:** [October 28, 2019, 5:27pm UTC](https://discourse.julialang.org/t/why-do-you-use-juliadb/30410 "2019-10-28T17:27:16Z")

</div>

I was kinda waiting for CSV.jl to get to as good as it is now before I start DiskFrame.jl which is a sister project to R’s diskframe.com (I am the author). It’s a disk-based data manipulation system. It’s on my laptop at…

---

## [Latexify.jl outputs incorrectly when variable names contain both unicode and ascii](https://discourse.julialang.org/t/latexify-jl-outputs-incorrectly-when-variable-names-contain-both-unicode-and-ascii/30393)

<div class="topic-metadata">

**Author:** [@anon56330260](https://discourse.julialang.org/u/anon56330260)\
**Replies:** 2\
**Last updated:** [October 28, 2019, 11:26am UTC](https://discourse.julialang.org/t/latexify-jl-outputs-incorrectly-when-variable-names-contain-both-unicode-and-ascii/30393 "2019-10-28T11:26:47Z")

</div>

It seems that if a variable contains both unicode and ascii character, latexify will product incorrect output: julia\> latexify("δa") L"$\\deltaa$" but what I want is :$\\delta a$, adding \_ would not help because it will …

---

## [Is Base.MPFR.setprecision in Julia 1.3 Thread Safe?](https://discourse.julialang.org/t/is-base-mpfr-setprecision-in-julia-1-3-thread-safe/30394)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 1\
**Last updated:** [October 28, 2019, 8:20am UTC](https://discourse.julialang.org/t/is-base-mpfr-setprecision-in-julia-1-3-thread-safe/30394 "2019-10-28T08:20:51Z")

</div>

Is Base.MPFR.setprecision in Julia 1.3 Thread Safe?

---

## [Euler project - P 164](https://discourse.julialang.org/t/euler-project-p-164/30135)

<div class="topic-metadata">

**Author:** [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)\
**Replies:** 30\
**Last updated:** [October 27, 2019, 4:31pm UTC](https://discourse.julialang.org/t/euler-project-p-164/30135 "2019-10-27T16:31:49Z")

</div>

Hi, I am doing some small algorithmic puzzles from the Euler Project. I have a working solution in code for P164 but it is so slow that I fear that I am doing something wrong. Could someone give me tips how to make my c…

---

## [Type stability with a vector of abstracts inside struct](https://discourse.julialang.org/t/type-stability-with-a-vector-of-abstracts-inside-struct/30353)

<div class="topic-metadata">

**Author:** [@abelsiqueira](https://discourse.julialang.org/u/abelsiqueira)\
**Replies:** 7\
**Last updated:** [October 28, 2019, 4:32am UTC](https://discourse.julialang.org/t/type-stability-with-a-vector-of-abstracts-inside-struct/30353 "2019-10-28T04:32:31Z")

</div>

Hi all, I appreciate any help in making the following code type stable: abstract type Something{T} end Base.eltype(:: Something{T}) where T = T mutable struct OneThing{T} \<: Something{T} α :: T end # HERE mutable s…

---

## [OnlineStats can’t handle Missing?](https://discourse.julialang.org/t/onlinestats-can-t-handle-missing/30317)

<div class="topic-metadata">

**Author:** [@FredC](https://discourse.julialang.org/u/FredC)\
**Replies:** 6\
**Last updated:** [October 28, 2019, 2:26am UTC](https://discourse.julialang.org/t/onlinestats-can-t-handle-missing/30317 "2019-10-28T02:26:43Z")

</div>

Am I mistaken in my experience that the OnlineStats package can’t handle Missing? Is there anything from Julia Computing that actually works? Not only are these packages out there, they’re presenting them as being good…

---

## [Iterate and intersect on BitSet vs Int](https://discourse.julialang.org/t/iterate-and-intersect-on-bitset-vs-int/30345)

<div class="topic-metadata">

**Author:** [@jeremiedb](https://discourse.julialang.org/u/jeremiedb)\
**Replies:** 11\
**Last updated:** [October 27, 2019, 9:23pm UTC](https://discourse.julialang.org/t/iterate-and-intersect-on-bitset-vs-int/30345 "2019-10-27T21:23:41Z")

</div>

I noticed that looping on a BitSet resulted in a significant slowdown (~10X) compared to the equivalent loop on Int64. This is resulting in undesirable performance tradeoff as intersect on the BitSets is significantly fa…

---

## [Error when attempting to run commands in debugging mode](https://discourse.julialang.org/t/error-when-attempting-to-run-commands-in-debugging-mode/30368)

<div class="topic-metadata">

**Author:** [@victor.d](https://discourse.julialang.org/u/victor.d)\
**Replies:** 0\
**Last updated:** [October 27, 2019, 2:21pm UTC](https://discourse.julialang.org/t/error-when-attempting-to-run-commands-in-debugging-mode/30368 "2019-10-27T14:21:32Z")

</div>

Hello. I’m running Juno debugger and everything works fine except when I’m trying to run any command/evaluate a variable or expression etc in debugging mode (under the “debug\>” prompt), I get the following error: ERROR:…

---

## [Julia not Working in Atom](https://discourse.julialang.org/t/julia-not-working-in-atom/30364)

<div class="topic-metadata">

**Author:** [@Adarsh\_Raj](https://discourse.julialang.org/u/Adarsh_Raj)\
**Replies:** 2\
**Last updated:** [October 27, 2019, 1:19pm UTC](https://discourse.julialang.org/t/julia-not-working-in-atom/30364 "2019-10-27T13:19:31Z")

</div>

Hi, can anyone help me with this Julia has exited. Press Enter to start a new session.

---

## [DAE problem set-up in DiffEq changed?](https://discourse.julialang.org/t/dae-problem-set-up-in-diffeq-changed/30330)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [October 27, 2019, 12:04pm UTC](https://discourse.julialang.org/t/dae-problem-set-up-in-diffeq-changed/30330 "2019-10-27T12:04:31Z")

</div>

I used DifferentialEquations.jl to solve a DAE in 2017-2018 or so. I just tried to re-run the Jupyter notebook, and now I get an error message… Here is the essence of my past set-up: function seborg\_is(err,dxdt,x,par,t)…

---

## [Wrapping C struct with contiguous memory requirements](https://discourse.julialang.org/t/wrapping-c-struct-with-contiguous-memory-requirements/30269)

<div class="topic-metadata">

**Author:** [@abulak](https://discourse.julialang.org/u/abulak)\
**Replies:** 2\
**Last updated:** [October 27, 2019, 10:55am UTC](https://discourse.julialang.org/t/wrapping-c-struct-with-contiguous-memory-requirements/30269 "2019-10-27T10:55:06Z")

</div>

So I need to wrap the following data structure in c: typedef struct { uint8\_t type : 8; uint8\_t flags : 8; uint64\_t size : 48; } Header; where size corresponds to the length of a uint64\_t\* array follow…

---

## [Brew a Parallel RNG?](https://discourse.julialang.org/t/brew-a-parallel-rng/30286)

<div class="topic-metadata">

**Author:** [@HaoLi111](https://discourse.julialang.org/u/HaoLi111)\
**Replies:** 20\
**Last updated:** [October 27, 2019, 8:31am UTC](https://discourse.julialang.org/t/brew-a-parallel-rng/30286 "2019-10-27T08:31:22Z")

</div>

RNGs cannot be parallelized without modification, as the effectiveness of the randomness representation ceases if the sequences are related. Previous discussions have been found from But can we use some alternative so…

---

## [Understanding generated functions](https://discourse.julialang.org/t/understanding-generated-functions/10092)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 7\
**Last updated:** [October 27, 2019, 6:21am UTC](https://discourse.julialang.org/t/understanding-generated-functions/10092 "2019-10-27T06:21:05Z")

</div>

Hi all. I’m trying to understand how generated functions work. From the 0.6 manual: A very special macro is @generated, which allows you to define so-called generated functions. These have the capability to generate …

---

## [ERROR: GitError(Code:EMERGECONFLICT, Class:Checkout, 619 conflicts prevent checkout)](https://discourse.julialang.org/t/error-giterror-code-emergeconflict-class-checkout-619-conflicts-prevent-checkout/30307)

<div class="topic-metadata">

**Author:** [@Yan](https://discourse.julialang.org/u/Yan)\
**Replies:** 3\
**Last updated:** [October 27, 2019, 2:40am UTC](https://discourse.julialang.org/t/error-giterror-code-emergeconflict-class-checkout-619-conflicts-prevent-checkout/30307 "2019-10-27T02:40:18Z")

</div>

julia\> Pkg.add(“Plots”) Updating registry at C:\\Users\\Administrator\\.juliapro\\JuliaPro\_v1.2.0-1\\registries\\JuliaPro Updating git-repo https://pkg.juliacomputing.com//registry/JuliaPro ERROR: GitError(Code:EMERGECONFLI…

---

## [Unreachable reached at 0x7f5b7ecd6739](https://discourse.julialang.org/t/unreachable-reached-at-0x7f5b7ecd6739/30325)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 3\
**Last updated:** [October 26, 2019, 11:15pm UTC](https://discourse.julialang.org/t/unreachable-reached-at-0x7f5b7ecd6739/30325 "2019-10-26T23:15:44Z")

</div>

I’m probably doing some wrong, on the other hand Julia probably shouldn’t be crashing. To reproduce run this under Atom: mutable struct Buffer data::Vector{UInt8} offset::Int Buffer(val::Vector{UInt8}) = ne…

---

## [Parsing CSV files where numbers may have thousand separators and a percentage symbol](https://discourse.julialang.org/t/parsing-csv-files-where-numbers-may-have-thousand-separators-and-a-percentage-symbol/30344)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 1\
**Last updated:** [October 26, 2019, 11:15pm UTC](https://discourse.julialang.org/t/parsing-csv-files-where-numbers-may-have-thousand-separators-and-a-percentage-symbol/30344 "2019-10-26T23:15:10Z")

</div>

I am trying to load a csv file using CSV.jl. The file looks like the following "Date, Vol, Change" "Sep 30, 2019","6,688.30","-0.41%" "Sep 27, 2019","6,716.10","0.58%" "Sep 26, 2019","6,677.60","-0.49%" Although I am a…

---

## [Clarifying package compatibility rules](https://discourse.julialang.org/t/clarifying-package-compatibility-rules/30322)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 1\
**Last updated:** [October 26, 2019, 12:14pm UTC](https://discourse.julialang.org/t/clarifying-package-compatibility-rules/30322 "2019-10-26T12:14:42Z")

</div>

The way that Julia manages package compatibilities (and incompatibilities) is superb, but also leads to situations that may be difficult to understand if you don’t know how it works. Actually I’m not totally sure of my u…

---

## [Memory consumption of precompilation](https://discourse.julialang.org/t/memory-consumption-of-precompilation/30327)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 3\
**Last updated:** [October 26, 2019, 11:01am UTC](https://discourse.julialang.org/t/memory-consumption-of-precompilation/30327 "2019-10-26T11:01:43Z")

</div>

I am using a Lenovo laptop with 8Gb RAM, running Ubuntu and Julia v1.3-rc4. While precompiling some packages, for example OrdinaryDiffEq and my own package that depends on OrdinaryDiffEq, my machine runs out of memory wi…

---

## [Type, Structure](https://discourse.julialang.org/t/type-structure/30290)

<div class="topic-metadata">

**Author:** [@Anil\_Mathews](https://discourse.julialang.org/u/Anil_Mathews)\
**Replies:** 4\
**Last updated:** [October 26, 2019, 8:23am UTC](https://discourse.julialang.org/t/type-structure/30290 "2019-10-26T08:23:03Z")

</div>

I want to create Structure to store my details struct MyStruct name:: String age ::int Father\_Name:: String end data= Array{MyStruct,1}("anil",22,"Mathew) Then, I want to use MyStruct Type…

---

## [Compatibility across Julia 1+ versions](https://discourse.julialang.org/t/compatibility-across-julia-1-versions/27196)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 54\
**Last updated:** [October 26, 2019, 7:20am UTC](https://discourse.julialang.org/t/compatibility-across-julia-1-versions/27196 "2019-10-26T07:20:07Z")

</div>

I saw in a thread: “we have effectively lost the JDBC wrapper until Julia 2.0”. This isn’t strictly true, as it still works in Julia 1.0.x, the LTS versions for the foreseeable future. But, yes, Julia 1.1, if I recall,…

---

## [Vector of monomials of order up to n?](https://discourse.julialang.org/t/vector-of-monomials-of-order-up-to-n/30308)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [October 25, 2019, 5:41pm UTC](https://discourse.julialang.org/t/vector-of-monomials-of-order-up-to-n/30308 "2019-10-25T17:41:41Z")

</div>

Suppose I have a scalar x. Then producing the vector \[1,x,x^2, \\ldots,x^n\] is straightforward, \[x^i for i in 0:n\] What if x is a vector, x=\[x\_1,\\dots,x\_{n\_x}\], and I want to produce the vector \[1, x\_1, \\ldots,x\_{n\_x}, …

---

## [Understanding while loop UndedVarError and scope](https://discourse.julialang.org/t/understanding-while-loop-undedvarerror-and-scope/16609)

<div class="topic-metadata">

**Author:** [@Vic](https://discourse.julialang.org/u/Vic)\
**Replies:** 28\
**Last updated:** [October 25, 2019, 5:14pm UTC](https://discourse.julialang.org/t/understanding-while-loop-undedvarerror-and-scope/16609 "2019-10-25T17:14:36Z")

</div>

REPL, Julia v1.0.1: julia\> a=1; julia\> while true; print(a); break; end 1 julia\> while true; a=2; break; end julia\> while true; a=2; print(a); break; end 2 julia\> while true; print(a); a=…

---

## [What's the problem presented by the Anti-malwares](https://discourse.julialang.org/t/whats-the-problem-presented-by-the-anti-malwares/30303)

<div class="topic-metadata">

**Author:** [@Yan](https://discourse.julialang.org/u/Yan)\
**Replies:** 3\
**Last updated:** [October 25, 2019, 2:28pm UTC](https://discourse.julialang.org/t/whats-the-problem-presented-by-the-anti-malwares/30303 "2019-10-25T14:28:50Z")

</div>

---

## [What is the relation between cropping a .osm file by osmium cat and the crop! function provided in OpenStreetMapX package?](https://discourse.julialang.org/t/what-is-the-relation-between-cropping-a-osm-file-by-osmium-cat-and-the-crop-function-provided-in-openstreetmapx-package/30210)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 6\
**Last updated:** [October 25, 2019, 1:44pm UTC](https://discourse.julialang.org/t/what-is-the-relation-between-cropping-a-osm-file-by-osmium-cat-and-the-crop-function-provided-in-openstreetmapx-package/30210 "2019-10-25T13:44:34Z")

</div>

I’m confused by the two cropping operations as mentioned in the title. My goal is to obtain the roadnetwork of a certain area using open street map data. Reference link: What's the general algorithm to draw a road netwo…

---

## [Connecting Juno to work with Julia installed on a remote server](https://discourse.julialang.org/t/connecting-juno-to-work-with-julia-installed-on-a-remote-server/7494)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 22\
**Last updated:** [October 25, 2019, 8:46am UTC](https://discourse.julialang.org/t/connecting-juno-to-work-with-julia-installed-on-a-remote-server/7494 "2019-10-25T08:46:59Z")

</div>

Hello, I am trying to work with Juno using Julia installed on a powerful server, for which I have SSH (and a not-default port let’s call it #SPORT). I am trying to follow the documentation at http://docs.junolab.org/la…

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

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