# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1981

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

**Page:** 1982

---

## [Counting number of times a RNG is called](https://discourse.julialang.org/t/counting-number-of-times-a-rng-is-called/24903)

<div class="topic-metadata">

**Author:** [@MFairley](https://discourse.julialang.org/u/MFairley)\
**Replies:** 22\
**Last updated:** [June 9, 2019, 8:11am UTC](https://discourse.julialang.org/t/counting-number-of-times-a-rng-is-called/24903 "2019-06-09T08:11:32Z")

</div>

Hi, I’m trying to measure the number of random numbers generated by a Monte Carlo estimator for a given level of precision. Is there an easy way I could do this? I would like to do something like: rng = MersenneTwiste…

---

## [How to \`promote\_type\` of more than 2 values?](https://discourse.julialang.org/t/how-to-promote-type-of-more-than-2-values/25088)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 3\
**Last updated:** [June 9, 2019, 5:12am UTC](https://discourse.julialang.org/t/how-to-promote-type-of-more-than-2-values/25088 "2019-06-09T05:12:19Z")

</div>

For example, I have 4 numbers 1, 2, 3, 4.0, and I want to get their promoted type. What should I do? I currently have two ways of writing julia\> promote\_type(map(typeof, promote(1, 2, 3, 4.0))...) Float64 or julia\> el…

---

## [Concerning \`AbstractDict\` inheritance and \`push!\`, is Base wrong?](https://discourse.julialang.org/t/concerning-abstractdict-inheritance-and-push-is-base-wrong/25082)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 2\
**Last updated:** [June 9, 2019, 2:59am UTC](https://discourse.julialang.org/t/concerning-abstractdict-inheritance-and-push-is-base-wrong/25082 "2019-06-09T02:59:18Z")

</div>

I am implementing an struct that inherit AbstractDict. To reduce the effort needed for a first working implementation I decided to let many methods to be defined by the fallback methods in abstracdict.jl. push! would b…

---

## [Automatic Threshold image](https://discourse.julialang.org/t/automatic-threshold-image/25028)

<div class="topic-metadata">

**Author:** [@GERSON\_EZEQUIEL\_HERN](https://discourse.julialang.org/u/GERSON_EZEQUIEL_HERN)\
**Replies:** 14\
**Last updated:** [June 9, 2019, 2:50am UTC](https://discourse.julialang.org/t/automatic-threshold-image/25028 "2019-06-09T02:50:09Z")

</div>

How can I do the process … This is my code. I’m working in Juno. using ImageContrastAdjustment, Images, ImageFiltering, TestImages, ColorTypes, HistogramThresholding const ICA = ImageContrastAdjustment function exam…

---

## [Displaying arguments in Atom](https://discourse.julialang.org/t/displaying-arguments-in-atom/24499)

<div class="topic-metadata">

**Author:** [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Replies:** 0\
**Last updated:** [May 23, 2019, 2:10am UTC](https://discourse.julialang.org/t/displaying-arguments-in-atom/24499 "2019-05-23T02:10:23Z")

</div>

I’ve been using Atom as an IDE for Julia. I’ve found it great so far, but my only complaint is that when displaying function arguments, they generally can’t be fully displayed on the screen (see example). Is there some a…

---

## [Embedding Julia while maintaining task scheduler](https://discourse.julialang.org/t/embedding-julia-while-maintaining-task-scheduler/24851)

<div class="topic-metadata">

**Author:** [@cdsousa](https://discourse.julialang.org/u/cdsousa)\
**Replies:** 3\
**Last updated:** [June 8, 2019, 11:05pm UTC](https://discourse.julialang.org/t/embedding-julia-while-maintaining-task-scheduler/24851 "2019-06-08T23:05:08Z")

</div>

Hi, I’ve been trying to be able to embed Julia in a C++ application and access it from multiple (C++) threads (Why? Some context here). After start learning how Julia “managed” threads work, I start trying to add method…

---

## [Using stream per cpu thread pattern](https://discourse.julialang.org/t/using-stream-per-cpu-thread-pattern/25053)

<div class="topic-metadata">

**Author:** [@Alex\_Ellison](https://discourse.julialang.org/u/Alex_Ellison)\
**Replies:** 1\
**Last updated:** [June 8, 2019, 9:08pm UTC](https://discourse.julialang.org/t/using-stream-per-cpu-thread-pattern/25053 "2019-06-08T21:08:33Z")

</div>

This CUDA tutorial demonstrates how multiple cpu threads can be spawned and each will have its own stream, which achieves great concurrency on the GPU (see section " A Multi-threading Example") GPU Pro Tip: CUDA 7 Stream…

---

## [Setting the "color scale" in Plots](https://discourse.julialang.org/t/setting-the-color-scale-in-plots/6373)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon](https://discourse.julialang.org/u/Philippe_Maincon)\
**Replies:** 16\
**Last updated:** [June 8, 2019, 7:03pm UTC](https://discourse.julialang.org/t/setting-the-color-scale-in-plots/6373 "2019-06-08T19:03:58Z")

</div>

Hi, A question about Plots.jl. The “contour” plot below (actually representing a scalar field by colors), works as it says on the packaging. using Plots;gr(size=(2000,1000)) x = y = linspace(0,1,51) p2 = plot(x,y,(…

---

## [What exactly is the meaning of this one line code written in Julia?](https://discourse.julialang.org/t/what-exactly-is-the-meaning-of-this-one-line-code-written-in-julia/24185)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [May 13, 2019, 7:29pm UTC](https://discourse.julialang.org/t/what-exactly-is-the-meaning-of-this-one-line-code-written-in-julia/24185 "2019-05-13T19:29:54Z")

</div>

findlast(e -\> e.time \>= event.time, eventList) I understand that the findlast(A) function will return the index or key of the last true value in A. It will return nothing if there is no true value in A. What I do not q…

---

## [PlotlyJS : File save error（.eps）](https://discourse.julialang.org/t/plotlyjs-file-save-error-eps/25075)

<div class="topic-metadata">

**Author:** [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Replies:** 0\
**Last updated:** [June 8, 2019, 2:28pm UTC](https://discourse.julialang.org/t/plotlyjs-file-save-error-eps/25075 "2019-06-08T14:28:15Z")

</div>

I am getting an error when I try to save the generated image to .eps format,code show as below: using PlotlyJS using ORCA function Draw() X=\[0, 1, 2, 0\] Y=\[0, 0, 1, 0\] Z=\[0, 2, 0, 0\] trace1 = scatter3d(;x=X,y=Y,…

---

## [Personal StdLibs](https://discourse.julialang.org/t/personal-stdlibs/25058)

<div class="topic-metadata">

**Author:** [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Replies:** 6\
**Last updated:** [June 8, 2019, 12:04pm UTC](https://discourse.julialang.org/t/personal-stdlibs/25058 "2019-06-08T12:04:55Z")

</div>

Hi All, Having written a couple of Julia programs and working on some packages, I’ve started to group things I use very often and find handy into my personal (local) StdLib or whatever you want to call it. I assume tha…

---

## [Elseif, ellse, why read(stdin,Char) not works in Julia 0.7?](https://discourse.julialang.org/t/elseif-ellse-why-read-stdin-char-not-works-in-julia-0-7/25069)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 2\
**Last updated:** [June 8, 2019, 11:13am UTC](https://discourse.julialang.org/t/elseif-ellse-why-read-stdin-char-not-works-in-julia-0-7/25069 "2019-06-08T11:13:45Z")

</div>

Why not works else take() after enter ‘s’ to take() function take() global agreement=read(stdin,Char) end take() s if agreement=='y' ; elseif agreement=='n' ; else take() end

---

## [Why the println line is multiplaying?](https://discourse.julialang.org/t/why-the-println-line-is-multiplaying/25072)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 1\
**Last updated:** [June 8, 2019, 10:46am UTC](https://discourse.julialang.org/t/why-the-println-line-is-multiplaying/25072 "2019-06-08T10:46:41Z")

</div>

Julia display 3 times the same lines. Why ? What wrong? zgoda='o' while (!(zgoda=='y' || zgoda=='n' || zgoda=='Y' || zgoda=='N')); println("Reported missings? enter 'y' or 'n' end press ENTER"); global zgoda=read(stdin,…

---

## [How to avoid Any in list comprehensions with small unions](https://discourse.julialang.org/t/how-to-avoid-any-in-list-comprehensions-with-small-unions/25070)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 5\
**Last updated:** [June 8, 2019, 10:19am UTC](https://discourse.julialang.org/t/how-to-avoid-any-in-list-comprehensions-with-small-unions/25070 "2019-06-08T10:19:26Z")

</div>

Hi all- I have a situation where I want to generate one of two types of arrays from a list comprehension. In the simplest case, all of the elements are Float64. This is straightforward and always works. In the other cas…

---

## [Please recommend a Julia ecosystem for Statistics](https://discourse.julialang.org/t/please-recommend-a-julia-ecosystem-for-statistics/25027)

<div class="topic-metadata">

**Author:** [@B.Vangod](https://discourse.julialang.org/u/B.Vangod)\
**Replies:** 28\
**Last updated:** [June 8, 2019, 8:05am UTC](https://discourse.julialang.org/t/please-recommend-a-julia-ecosystem-for-statistics/25027 "2019-06-08T08:05:03Z")

</div>

I thought about using Julia for statistics and was used to using R with tidyverse. So I thought to check out Julia and some packages looking the most like R and tidyverse and maybe migrate. So for now, as I play around w…

---

## [How to pass a null value to a prepared statement with LibPQ.jl](https://discourse.julialang.org/t/how-to-pass-a-null-value-to-a-prepared-statement-with-libpq-jl/25068)

<div class="topic-metadata">

**Author:** [@tencnivel](https://discourse.julialang.org/u/tencnivel)\
**Replies:** 1\
**Last updated:** [June 8, 2019, 6:28am UTC](https://discourse.julialang.org/t/how-to-pass-a-null-value-to-a-prepared-statement-with-libpq-jl/25068 "2019-06-08T06:28:07Z")

</div>

Passing ‘nothing’ to a prepared statement throws an error

---

## [Julia package to find all local extrema of a function in a interval?](https://discourse.julialang.org/t/julia-package-to-find-all-local-extrema-of-a-function-in-a-interval/25067)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 3\
**Last updated:** [June 8, 2019, 5:55am UTC](https://discourse.julialang.org/t/julia-package-to-find-all-local-extrema-of-a-function-in-a-interval/25067 "2019-06-08T05:55:35Z")

</div>

i’m looking for a package to find a list of local minima of an univariate function, in a given interval, someone knows if something like this exists?

---

## [How do I find the value of sin(50 degrees)](https://discourse.julialang.org/t/how-do-i-find-the-value-of-sin-50-degrees/25039)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 6\
**Last updated:** [June 7, 2019, 10:37pm UTC](https://discourse.julialang.org/t/how-do-i-find-the-value-of-sin-50-degrees/25039 "2019-06-07T22:37:13Z")

</div>

If I want to find the value of sin(60 degrees), I can calculate from the exact value and calculate 100 decimal places using const decimalplaces = 100 const numofbits = Int(ceil(log(2,10) \* decimalplaces)) setprecisio…

---

## [Changing Threads.nthreads within Atom](https://discourse.julialang.org/t/changing-threads-nthreads-within-atom/25054)

<div class="topic-metadata">

**Author:** [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Replies:** 2\
**Last updated:** [June 7, 2019, 8:54pm UTC](https://discourse.julialang.org/t/changing-threads-nthreads-within-atom/25054 "2019-06-07T20:54:11Z")

</div>

I’m trying to change the number of threads allocated to Julia via export JULIA\_NUM\_THREADS=3 For some reason, this appears to work when I launch Julia from command line: but does not does not seem to work when I’m us…

---

## [What does this 'do' syntax mean?](https://discourse.julialang.org/t/what-does-this-do-syntax-mean/25041)

<div class="topic-metadata">

**Author:** [@Nathaniel](https://discourse.julialang.org/u/Nathaniel)\
**Replies:** 3\
**Last updated:** [June 7, 2019, 3:39pm UTC](https://discourse.julialang.org/t/what-does-this-do-syntax-mean/25041 "2019-06-07T15:39:28Z")

</div>

I found the following example in the README for the Meshing package using Meshing using GeometryTypes using LinearAlgebra: dot, norm using FileIO # generate an SDF of a sphere sdf\_sphere = SignedDistanceField(HyperRect…

---

## [Automatic differentiation - Julia implementation advantages](https://discourse.julialang.org/t/automatic-differentiation-julia-implementation-advantages/24975)

<div class="topic-metadata">

**Author:** [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Replies:** 8\
**Last updated:** [June 7, 2019, 3:35pm UTC](https://discourse.julialang.org/t/automatic-differentiation-julia-implementation-advantages/24975 "2019-06-07T15:35:41Z")

</div>

I’m interested in utilizing Julia for some ML tasks; in perusing some discussions from this discourse and the Julia slack in the past, I have a vague memory of having read some claims regarding advantages of Juila implem…

---

## [How to use SemVer with Julia?](https://discourse.julialang.org/t/how-to-use-semver-with-julia/25049)

<div class="topic-metadata">

**Author:** [@mrkaspa](https://discourse.julialang.org/u/mrkaspa)\
**Replies:** 1\
**Last updated:** [June 7, 2019, 3:16pm UTC](https://discourse.julialang.org/t/how-to-use-semver-with-julia/25049 "2019-06-07T15:16:54Z")

</div>

How can I add a package from a specific version to Julia, in my Project.toml looks like I only bind it to an specific commit \[deps\] Distributions = “31c24e10-a181-5473-b8eb-7969acd0382f” JSON = “682c06a0-de6a-54ab-a14…

---

## [Zurich Meetup 13 June: Intro to Julia (talk + hands-on)](https://discourse.julialang.org/t/zurich-meetup-13-june-intro-to-julia-talk-hands-on/25043)

<div class="topic-metadata">

**Author:** [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Replies:** 4\
**Last updated:** [June 7, 2019, 2:57pm UTC](https://discourse.julialang.org/t/zurich-meetup-13-june-intro-to-julia-talk-hands-on/25043 "2019-06-07T14:57:33Z")

</div>

We have a meetup next week in Zurich, where I give a talk and hands-on intro to Julia: (make sure you read the instructions before coming) I suspect this might be less interesting to people on this forum as most are …

---

## [ERROR: BoundsError: attempt to access 85124553-element Array{UInt8,1} at index \[4:85124553, 2\]](https://discourse.julialang.org/t/error-boundserror-attempt-to-access-85124553-element-array-uint8-1-at-index-4-85124553-2/24983)

<div class="topic-metadata">

**Author:** [@stu](https://discourse.julialang.org/u/stu)\
**Replies:** 6\
**Last updated:** [June 7, 2019, 2:54pm UTC](https://discourse.julialang.org/t/error-boundserror-attempt-to-access-85124553-element-array-uint8-1-at-index-4-85124553-2/24983 "2019-06-07T14:54:44Z")

</div>

symbols = data\[4:end, 2\] The above code is throwing the error in the title and I cannot figure out why. The below code that I run right before it in my file works just fine and I know and have checked that there are at…

---

## [Allocations reported by \`@time\`](https://discourse.julialang.org/t/allocations-reported-by-time/25032)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 4\
**Last updated:** [June 7, 2019, 2:53pm UTC](https://discourse.julialang.org/t/allocations-reported-by-time/25032 "2019-06-07T14:53:08Z")

</div>

I am confused by the following results of @time. I understand that the first call contains compilation overhead. But why is the second call allocate much more then the third? julia\> mutable struct M{T}; inner::T; end j…

---

## [How to define an everywhere defined function within a function](https://discourse.julialang.org/t/how-to-define-an-everywhere-defined-function-within-a-function/25044)

<div class="topic-metadata">

**Author:** [@dkarrasch](https://discourse.julialang.org/u/dkarrasch)\
**Replies:** 8\
**Last updated:** [June 7, 2019, 2:50pm UTC](https://discourse.julialang.org/t/how-to-define-an-everywhere-defined-function-within-a-function/25044 "2019-06-07T14:50:48Z")

</div>

In my package, I’d like to offer a convenience function like this: function gaussian(σ::Real=1.0) @eval function (x) exp(-abs2(x) / $(float(4σ))) end end I want the @eval because I don’t want the 4σ to …

---

## [Fast evaluation of multiple functions on multiple arguments](https://discourse.julialang.org/t/fast-evaluation-of-multiple-functions-on-multiple-arguments/25040)

<div class="topic-metadata">

**Author:** [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Replies:** 10\
**Last updated:** [June 7, 2019, 2:36pm UTC](https://discourse.julialang.org/t/fast-evaluation-of-multiple-functions-on-multiple-arguments/25040 "2019-06-07T14:36:46Z")

</div>

In my application I often have a bunch of functions that I need to evaluate on many arguments (i.e. each combination of function and argument). I thought of extending the Base.map function as follows: function Base.map…

---

## [Calling a function inside of a Kernel](https://discourse.julialang.org/t/calling-a-function-inside-of-a-kernel/25023)

<div class="topic-metadata">

**Author:** [@James\_Stickney](https://discourse.julialang.org/u/James_Stickney)\
**Replies:** 4\
**Last updated:** [June 7, 2019, 2:23pm UTC](https://discourse.julialang.org/t/calling-a-function-inside-of-a-kernel/25023 "2019-06-07T14:23:22Z")

</div>

This one has my head hurting. I’m not even sure how to explain the problem, but I’ll do my best. I am working on a project using CUDAnative and one of my kernels takes a function as an argument. I would like to pass a…

---

## [Help with Malaria dataset](https://discourse.julialang.org/t/help-with-malaria-dataset/25004)

<div class="topic-metadata">

**Author:** [@Deanodirector](https://discourse.julialang.org/u/Deanodirector)\
**Replies:** 7\
**Last updated:** [June 7, 2019, 10:11am UTC](https://discourse.julialang.org/t/help-with-malaria-dataset/25004 "2019-06-07T10:11:18Z")

</div>

Hello, just starting out with Julia here. I’ve downloaded the Malaria dataset from kaggle and I have two folders of images, one parasitized cells and the other normal cells. How do I go about loading all these images in…

---

## [How to deal with a Nullable DataFrame?](https://discourse.julialang.org/t/how-to-deal-with-a-nullable-dataframe/25013)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 3\
**Last updated:** [June 7, 2019, 9:43am UTC](https://discourse.julialang.org/t/how-to-deal-with-a-nullable-dataframe/25013 "2019-06-07T09:43:23Z")

</div>

I have a pretty huge csv file that contains missing values. In this case, the data of my dataframe becomes Nullable types. I have tried to apply the operation : df = unique!(df\[:city\]) LoadError: e\[91mMethodError: no …

[Previous page](https://discourse.julialang.org/latest.md?page=1980)

[Next page](https://discourse.julialang.org/latest.md?page=1982)
