# General Usage

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

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

**Page:** 987

---

## [How to round 1.653782960785311e14 to 1.65e14?](https://discourse.julialang.org/t/how-to-round-1-653782960785311e14-to-1-65e14/10016)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 12\
**Last updated:** [March 30, 2018, 2:31pm UTC](https://discourse.julialang.org/t/how-to-round-1-653782960785311e14-to-1-65e14/10016 "2018-03-30T14:31:40Z")

</div>

\`julia\> a 1.653782960785311e14 julia\> round(a,2) 1.653782960785311e14 \` how to round 1.653782960785311e14 to 1.66e14 ? Paul

---

## [Help tracking down an InexactError()](https://discourse.julialang.org/t/help-tracking-down-an-inexacterror/10069)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 7\
**Last updated:** [March 30, 2018, 1:01pm UTC](https://discourse.julialang.org/t/help-tracking-down-an-inexacterror/10069 "2018-03-30T13:01:15Z")

</div>

I’m trying to solve a dynamic programming problem and I am running into an InexactError() that I have not been able to track down. Can you please help me out? const nᵢ = 2 const δ = 0.8 const σ = 1.5 const ρ = 5.0 con…

---

## [struct{N} with internal NTuple{N,Int32}](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 2\
**Last updated:** [March 30, 2018, 11:09am UTC](https://discourse.julialang.org/t/struct-n-with-internal-ntuple-n-int32/10070 "2018-03-30T11:09:41Z")

</div>

I would like to use something like this: struct Digits{N} \<: Signed digits::NTuple{N, Int32} # ... end There can be many distinct values of N. Is there an approach which allows me the internalized tuple and …

---

## [Help with promote on FixedPointNumbers](https://discourse.julialang.org/t/help-with-promote-on-fixedpointnumbers/10047)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 2\
**Last updated:** [March 30, 2018, 8:45am UTC](https://discourse.julialang.org/t/help-with-promote-on-fixedpointnumbers/10047 "2018-03-30T08:45:47Z")

</div>

Hello, what is the right way in using FixedPointNumbers.jl to achieve custom math operation: using FixedPointNumbers a = convert(Fixed{Int8, 6}, 1.0) b = convert(Fixed{Int8, 6}, 0.5) c = convert(Fixed{Int16, 6}, 0.25) …

---

## [Accessing sets of particular indexes over multiple dimensions](https://discourse.julialang.org/t/accessing-sets-of-particular-indexes-over-multiple-dimensions/10067)

<div class="topic-metadata">

**Author:** [@abshej](https://discourse.julialang.org/u/abshej)\
**Replies:** 2\
**Last updated:** [March 30, 2018, 7:04am UTC](https://discourse.julialang.org/t/accessing-sets-of-particular-indexes-over-multiple-dimensions/10067 "2018-03-30T07:04:43Z")

</div>

How can you use maps or other techniques to instantly access every nth element of every mth element of every kth element of every element of multidimensional array? Is that allowed? # array def a = Array{Vector{Vector{S…

---

## [DataFramesMeta conditionals](https://discourse.julialang.org/t/dataframesmeta-conditionals/10057)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 8\
**Last updated:** [March 29, 2018, 11:05pm UTC](https://discourse.julialang.org/t/dataframesmeta-conditionals/10057 "2018-03-29T23:05:32Z")

</div>

I often forget to put the dot when writing conditions. I wonder why we couldn’t just do it without and automate it inside DataFramesMeta with a @. macro. Any thoughts? So, rather than writing this: @where(df, :x .\> 1)…

---

## [Data structure for multidimensional histogram](https://discourse.julialang.org/t/data-structure-for-multidimensional-histogram/10020)

<div class="topic-metadata">

**Author:** [@pasha](https://discourse.julialang.org/u/pasha)\
**Replies:** 7\
**Last updated:** [March 30, 2018, 2:04am UTC](https://discourse.julialang.org/t/data-structure-for-multidimensional-histogram/10020 "2018-03-30T02:04:31Z")

</div>

I have a big map-reduce operation on a large radio telescope FFT dataset, which gathers counts to multiple histograms for maybe 11-12 metrics. Now that this is working, I want to see about capturing the intersection of …

---

## [How to represent a DAG?](https://discourse.julialang.org/t/how-to-represent-a-dag/10025)

<div class="topic-metadata">

**Author:** [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Replies:** 8\
**Last updated:** [March 29, 2018, 11:50pm UTC](https://discourse.julialang.org/t/how-to-represent-a-dag/10025 "2018-03-29T23:50:22Z")

</div>

What is the best way to represent a DAG (Directed Acyclic Graph) in Julia? I need to have mutable nodes that know who their children and their parents are, so that I can propagate information up and down them. The use c…

---

## [Unload libjulia when embedding](https://discourse.julialang.org/t/unload-libjulia-when-embedding/10059)

<div class="topic-metadata">

**Author:** [@goldfita](https://discourse.julialang.org/u/goldfita)\
**Replies:** 0\
**Last updated:** [March 29, 2018, 9:35pm UTC](https://discourse.julialang.org/t/unload-libjulia-when-embedding/10059 "2018-03-29T21:35:19Z")

</div>

Is libjulia.dll intentionally blocked from unloading? I find I can call FreeLibrary immediately after loading, but once I call jl\_init\_with\_image, the DLL can no longer be unloaded. The issue I’m having is I load/proce…

---

## [Reading an array interactively](https://discourse.julialang.org/t/reading-an-array-interactively/10035)

<div class="topic-metadata">

**Author:** [@ramonz](https://discourse.julialang.org/u/ramonz)\
**Replies:** 5\
**Last updated:** [March 29, 2018, 7:15pm UTC](https://discourse.julialang.org/t/reading-an-array-interactively/10035 "2018-03-29T19:15:11Z")

</div>

Hello All I am trying to find a way to input the components of an array of floating numbers (i.e. a vector for a mechanics class examples) interactively. This is the way I am doing it in a notebook println("Componentes…

---

## [getting the types right for transformed distributions](https://discourse.julialang.org/t/getting-the-types-right-for-transformed-distributions/10042)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 4\
**Last updated:** [March 29, 2018, 3:49pm UTC](https://discourse.julialang.org/t/getting-the-types-right-for-transformed-distributions/10042 "2018-03-29T15:49:21Z")

</div>

I have a question about how to structure certain types. Even though the application is statistics, the question is really about types. I’d like to build types that take a Distribution (from the Distributions package) a…

---

## [API design question: asking the user for methods and types](https://discourse.julialang.org/t/api-design-question-asking-the-user-for-methods-and-types/10049)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 14\
**Last updated:** [March 29, 2018, 3:39pm UTC](https://discourse.julialang.org/t/api-design-question-asking-the-user-for-methods-and-types/10049 "2018-03-29T15:39:33Z")

</div>

I am in the process polishing up a package API before registering. The API works with “models” (arbitrary structures, the user defines them), and requires that certain transformations are available for each model (eg “si…

---

## [Julia v0.6 vs. v0.7 GC behaviour?](https://discourse.julialang.org/t/julia-v0-6-vs-v0-7-gc-behaviour/10002)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 8\
**Last updated:** [March 29, 2018, 8:08am UTC](https://discourse.julialang.org/t/julia-v0-6-vs-v0-7-gc-behaviour/10002 "2018-03-29T08:08:53Z")

</div>

I’m a bit unclear about the new v0.7 GC behaviour - I read that GC is more aggressive than on v0.6, but I failed to locate the details. In Julia v0.7, may a local variable be GC’ed within a function if it’s not used any…

---

## [How to avoid repeated data movement between processes?](https://discourse.julialang.org/t/how-to-avoid-repeated-data-movement-between-processes/9835)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 12\
**Last updated:** [March 29, 2018, 2:46am UTC](https://discourse.julialang.org/t/how-to-avoid-repeated-data-movement-between-processes/9835 "2018-03-29T02:46:25Z")

</div>

I have a program looking like @everywhere function foo(nm, k) # do something return result end n = 100 ks = rand(3, n) nm = rand(10000, 10000) s = 0.0 np = nprocs() results = Vector{Any}(n) i = 1 nextidx() = (id…

---

## [Construct large sparse matrix by blocks](https://discourse.julialang.org/t/construct-large-sparse-matrix-by-blocks/10034)

<div class="topic-metadata">

**Author:** [@WenlongGong](https://discourse.julialang.org/u/WenlongGong)\
**Replies:** 4\
**Last updated:** [March 28, 2018, 8:59pm UTC](https://discourse.julialang.org/t/construct-large-sparse-matrix-by-blocks/10034 "2018-03-28T20:59:53Z")

</div>

I’m looking for a function to construct a sparse matrix based on several blocks of smaller sparse matrices. An simple example: A11=A12=A21=A22=sprandn(4,2,0.6) The final sparse matrix A should be a combination of thes…

---

## [OutOfMemoryError() on the terminal but NOT on Jupyter](https://discourse.julialang.org/t/outofmemoryerror-on-the-terminal-but-not-on-jupyter/10032)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 0\
**Last updated:** [March 28, 2018, 1:56pm UTC](https://discourse.julialang.org/t/outofmemoryerror-on-the-terminal-but-not-on-jupyter/10032 "2018-03-28T13:56:11Z")

</div>

Hello, when I run the following code on a (400, 800, 5844) Array{Float32,3} matrix on a server with 64GB of RAM I receive an ERROR: OutOfMemoryError() Stacktrace: \[1\] convert(::Type{Array{Float64,3}}, ::Array{Float32,3…

---

## [Looking for the right structure](https://discourse.julialang.org/t/looking-for-the-right-structure/10028)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 1\
**Last updated:** [March 28, 2018, 1:43pm UTC](https://discourse.julialang.org/t/looking-for-the-right-structure/10028 "2018-03-28T13:43:23Z")

</div>

Is there any Array-like construct that allows me to index with non-Ints and that recognizes the meaning of : in accessing elements as in an Array? It’d be nice to be able to call norm on it as well.

---

## [".+ is no longer a function object" using pmap(f, a) inside macro in 0.6/0.7](https://discourse.julialang.org/t/is-no-longer-a-function-object-using-pmap-f-a-inside-macro-in-0-6-0-7/9991)

<div class="topic-metadata">

**Author:** [@rened](https://discourse.julialang.org/u/rened)\
**Replies:** 3\
**Last updated:** [March 28, 2018, 1:36pm UTC](https://discourse.julialang.org/t/is-no-longer-a-function-object-using-pmap-f-a-inside-macro-in-0-6-0-7/9991 "2018-03-28T13:36:14Z")

</div>

I have the following, boiled down example of a pattern I use in my test suites, optionally running test sets only when requested by name from the command line. The shouldtest macro checks ARGS and then emits the test se…

---

## [Disable deprecation warnings for all packages but 'mine'](https://discourse.julialang.org/t/disable-deprecation-warnings-for-all-packages-but-mine/10029)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 1\
**Last updated:** [March 28, 2018, 1:09pm UTC](https://discourse.julialang.org/t/disable-deprecation-warnings-for-all-packages-but-mine/10029 "2018-03-28T13:09:46Z")

</div>

Is it possible to disable deprecation warnings for certain packages/folders/files? Right now, I try to update some of my code to v0.7 which relies on a number of other packages. I am (for now) not interested in all the …

---

## [Inference and speeding in an interpolation](https://discourse.julialang.org/t/inference-and-speeding-in-an-interpolation/10027)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 8\
**Last updated:** [March 28, 2018, 11:40am UTC](https://discourse.julialang.org/t/inference-and-speeding-in-an-interpolation/10027 "2018-03-28T11:40:18Z")

</div>

Out of convenience I’m wrapping a scaled interpolation from Interpolations.jl: grid\_x = 0:0.1:100.0 grid\_y = 0:0.1:100.0 f(x, y) = (x + y)^2 farr = \[f(x, y) for x in grid\_x, y in grid\_y\] using Interpolations functio…

---

## [Combinations](https://discourse.julialang.org/t/combinations/10026)

<div class="topic-metadata">

**Author:** [@Samudra](https://discourse.julialang.org/u/Samudra)\
**Replies:** 2\
**Last updated:** [March 28, 2018, 7:38am UTC](https://discourse.julialang.org/t/combinations/10026 "2018-03-28T07:38:41Z")

</div>

Hi, Is there a simple way to get all the combinations of a an array for a selected elements? Thanks

---

## [Innefficient paralellization? Need some help optimizing a simple dot product](https://discourse.julialang.org/t/innefficient-paralellization-need-some-help-optimizing-a-simple-dot-product/9723)

<div class="topic-metadata">

**Author:** [@cdacosta](https://discourse.julialang.org/u/cdacosta)\
**Replies:** 32\
**Last updated:** [March 28, 2018, 7:23am UTC](https://discourse.julialang.org/t/innefficient-paralellization-need-some-help-optimizing-a-simple-dot-product/9723 "2018-03-28T07:23:06Z")

</div>

I have a very simple code I’d like to optimize, and I’m not sure I am getting the expected results. For the sake of simplicity I am optimizing a loop which computes the dot product. I have implemented two functions, a se…

---

## [Google Analytics Package?](https://discourse.julialang.org/t/google-analytics-package/10019)

<div class="topic-metadata">

**Author:** [@rwatts3](https://discourse.julialang.org/u/rwatts3)\
**Replies:** 0\
**Last updated:** [March 27, 2018, 7:50pm UTC](https://discourse.julialang.org/t/google-analytics-package/10019 "2018-03-27T19:50:17Z")

</div>

Greetings, I have performed a few Google Searches as well as checked Julia’s package directory and can’t seem to find a Google Analytics package for Julia. Or a Google API package. I am coming from R and Python and the…

---

## [Start Julia by file.bat does not display colors in plots, sys=Win7](https://discourse.julialang.org/t/start-julia-by-file-bat-does-not-display-colors-in-plots-sys-win7/10017)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 0\
**Last updated:** [March 27, 2018, 7:11pm UTC](https://discourse.julialang.org/t/start-julia-by-file-bat-does-not-display-colors-in-plots-sys-win7/10017 "2018-03-27T19:11:14Z")

</div>

sys=Win7 A need run my code by file.bat inside is C:\\Users\\PC\\AppData\\Local\\Julia-0.6.2\\bin\\julia.exe -L myprog.jl julia run but does not display colors in plots. How to run myprog.jl by cliced file.bat ? Paul

---

## [Getting PyCall to use the conda python on juliabox](https://discourse.julialang.org/t/getting-pycall-to-use-the-conda-python-on-juliabox/9997)

<div class="topic-metadata">

**Author:** [@datnamer](https://discourse.julialang.org/u/datnamer)\
**Replies:** 2\
**Last updated:** [March 27, 2018, 2:03pm UTC](https://discourse.julialang.org/t/getting-pycall-to-use-the-conda-python-on-juliabox/9997 "2018-03-27T14:03:21Z")

</div>

How can I get the PyCall to use the conda python on juliabox? The readme seems to indicated I should ENV\[“PYTHON”\]=“” and then Pkg.build(“PyCall”) But pkg.build isn’t available on juliabox.

---

## [\`filter()\` and Boolean masks](https://discourse.julialang.org/t/filter-and-boolean-masks/10005)

<div class="topic-metadata">

**Author:** [@ValdarT](https://discourse.julialang.org/u/ValdarT)\
**Replies:** 0\
**Last updated:** [March 27, 2018, 1:06pm UTC](https://discourse.julialang.org/t/filter-and-boolean-masks/10005 "2018-03-27T13:06:50Z")

</div>

It often comes up that one wants to filter/select rows of a Matrix based on the values of some column. I believe the best way of doing this is with Boolean masks? But these can get a bit weird… For example: a = \["a" "x"…

---

## [What is the effect of \`parse\` on \`Char' types?](https://discourse.julialang.org/t/what-is-the-effect-of-parse-on-char-types/9874)

<div class="topic-metadata">

**Author:** [@tparker](https://discourse.julialang.org/u/tparker)\
**Replies:** 4\
**Last updated:** [March 27, 2018, 5:34am UTC](https://discourse.julialang.org/t/what-is-the-effect-of-parse-on-char-types/9874 "2018-03-27T05:34:52Z")

</div>

parse(T::Type, str::String) converts a string str to a number of type T. However, parse(T::Type, c::Char) also returns numbers, but I’m not sure where they’re coming from and I can’t find a matching method signature in t…

---

## [NetCDF error](https://discourse.julialang.org/t/netcdf-error/9987)

<div class="topic-metadata">

**Author:** [@nobody](https://discourse.julialang.org/u/nobody)\
**Replies:** 3\
**Last updated:** [March 26, 2018, 6:33pm UTC](https://discourse.julialang.org/t/netcdf-error/9987 "2018-03-26T18:33:51Z")

</div>

Hi everyone, I am currently working on TRMM 3B43 netcdf data (OPeNDAP Hyrax: Contents of /TRMM\_L3/TRMM\_3B43.7/). I have downloaded the monthly data and from these, I tried to generate the annual average precipitation. I…

---

## [\`reinterpret\` to a single value from an array of a smaller data type](https://discourse.julialang.org/t/reinterpret-to-a-single-value-from-an-array-of-a-smaller-data-type/9932)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 24\
**Last updated:** [March 26, 2018, 5:55pm UTC](https://discourse.julialang.org/t/reinterpret-to-a-single-value-from-an-array-of-a-smaller-data-type/9932 "2018-03-26T17:55:29Z")

</div>

Currently on 0.7 if I want to reinterpret from a smaller data type to a larger one, I have to return an array, e.g. reinterpret(Float64, zeros(UInt8, 8)) # returns Float64\[0.0\] This results in an unnecessary allocation…

---

## [Having IJulia show "text/org" mimetype without type-piracy](https://discourse.julialang.org/t/having-ijulia-show-text-org-mimetype-without-type-piracy/9993)

<div class="topic-metadata">

**Author:** [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Replies:** 6\
**Last updated:** [March 26, 2018, 5:37pm UTC](https://discourse.julialang.org/t/having-ijulia-show-text-org-mimetype-without-type-piracy/9993 "2018-03-26T17:37:05Z")

</div>

I’ve been using ob-ipython in org-mode lately with ijulia as the kernel. In general, it works pretty well and papers over some of the current issues with ob-julia. The one thing it doesn’t do natively is formatting th…

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

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