# Latest

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

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

**Page:** 1489

---

## [How to Find the First Instance of a Value in an Array](https://discourse.julialang.org/t/how-to-find-the-first-instance-of-a-value-in-an-array/55290)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 5\
**Last updated:** [February 17, 2021, 2:41am UTC](https://discourse.julialang.org/t/how-to-find-the-first-instance-of-a-value-in-an-array/55290 "2021-02-17T02:41:58Z")

</div>

Hi all, I was wondering why this wasn’t working: mylist = \["a", "b", "c"\] findfirst(\["a"\], mylist) As I expected it to work in at least Julia 1.6. Instead I got a stacktrace that looked like this: ERROR: MethodError:…

---

## [Can anyone point me to formatting string. I have an output where I want to control](https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 17, 2021, 2:23am UTC](https://discourse.julialang.org/t/can-anyone-point-me-to-formatting-string-i-have-an-output-where-i-want-to-control/55431 "2021-02-17T02:23:28Z")

</div>

can anyone point me to formatting string. I have an output where I want to control the spacing of everything and have it separated like this #This is what I have "converged: true |...." "converged: false |...." #This i…

---

## [Telegram bot to code and run programs in Julia](https://discourse.julialang.org/t/telegram-bot-to-code-and-run-programs-in-julia/55434)

<div class="topic-metadata">

**Author:** [@Ata0k](https://discourse.julialang.org/u/Ata0k)\
**Replies:** 0\
**Last updated:** [February 17, 2021, 2:19am UTC](https://discourse.julialang.org/t/telegram-bot-to-code-and-run-programs-in-julia/55434 "2021-02-17T02:19:15Z")

</div>

I would like to share with you a simple program to generate Telegram-bot for code and run the programs. First, you need to generate a Telegram bot via the @BotFather bot ( send the message /newbot to @BotFather and foll…

---

## [MLJ on GPU?](https://discourse.julialang.org/t/mlj-on-gpu/55047)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 4\
**Last updated:** [February 17, 2021, 1:46am UTC](https://discourse.julialang.org/t/mlj-on-gpu/55047 "2021-02-17T01:46:44Z")

</div>

I would like to know, how to train MLJ model on GPU. Example using MLJ X = MLJ.table(rand(100, 10)); y = 2X.x1 - X.x2 + 0.05\*rand(100); @load LinearRegressor pkg=MLJLinearModels verbosity=0; model = LinearRegressor() …

---

## [AI based editor auto completion](https://discourse.julialang.org/t/ai-based-editor-auto-completion/55427)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 2\
**Last updated:** [February 17, 2021, 12:30am UTC](https://discourse.julialang.org/t/ai-based-editor-auto-completion/55427 "2021-02-17T00:30:20Z")

</div>

Hi all, do we have anything like tabnine or kite for Julia? I think that would be a very cool project using Julia :slight\_smile:

---

## [Single module vs. submodules in a project](https://discourse.julialang.org/t/single-module-vs-submodules-in-a-project/55361)

<div class="topic-metadata">

**Author:** [@erans](https://discourse.julialang.org/u/erans)\
**Replies:** 17\
**Last updated:** [February 17, 2021, 12:14am UTC](https://discourse.julialang.org/t/single-module-vs-submodules-in-a-project/55361 "2021-02-17T00:14:49Z")

</div>

I have been reading a fair amount (a few references at end of post) about how to “correctly”, or better yet idiomatically, structure code in Julia. In general, there seems to be a strong sentiment that many submodules pr…

---

## [What’s the best place to go to learn about scraping data from websites in Julia (t](https://discourse.julialang.org/t/what-s-the-best-place-to-go-to-learn-about-scraping-data-from-websites-in-julia-t/55426)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 10:54pm UTC](https://discourse.julialang.org/t/what-s-the-best-place-to-go-to-learn-about-scraping-data-from-websites-in-julia-t/55426 "2021-02-16T22:54:47Z")

</div>

What’s the best place to go to learn about scraping data from websites in Julia (this is for my 17 year old son, who wants to do a project, looking at data from Wikipedia) Note that the original poster on Slack cannot s…

---

## [JuMP/Simplex - basic question: derivatives](https://discourse.julialang.org/t/jump-simplex-basic-question-derivatives/55416)

<div class="topic-metadata">

**Author:** [@TheMEGuy](https://discourse.julialang.org/u/TheMEGuy)\
**Replies:** 3\
**Last updated:** [February 16, 2021, 10:27pm UTC](https://discourse.julialang.org/t/jump-simplex-basic-question-derivatives/55416 "2021-02-16T22:27:47Z")

</div>

Hi, I am new to optimization and I have a question for you: these might be naive questions but when I register a nonlinear function I have two options: to provide JuMP with the first two derivations to use the auto d…

---

## [I am looking for some help with segfault when passing a struct to a C-API via \`@cc](https://discourse.julialang.org/t/i-am-looking-for-some-help-with-segfault-when-passing-a-struct-to-a-c-api-via-cc/55425)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 10:15pm UTC](https://discourse.julialang.org/t/i-am-looking-for-some-help-with-segfault-when-passing-a-struct-to-a-c-api-via-cc/55425 "2021-02-16T22:15:16Z")

</div>

I am looking for some help with segfault when passing a struct to a C-API via @ccall. I created an immutable struct inside a Ref(), and then call something like @ccall lib.somefunc(myref::Ptr{MyStruct}).... This seems to…

---

## [Do not assume BB binary is used everywhere](https://discourse.julialang.org/t/do-not-assume-bb-binary-is-used-everywhere/54760)

<div class="topic-metadata">

**Author:** [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Replies:** 47\
**Last updated:** [February 16, 2021, 8:18pm UTC](https://discourse.julialang.org/t/do-not-assume-bb-binary-is-used-everywhere/54760 "2021-02-16T20:18:13Z")

</div>

As I predicted, now you are just reinventing the wheel and create a new distro within a distro that is completely incompatible with the host system and can’t be used to interact with the system at all.

---

## [Call for proposals: DataFrames.jl documentation](https://discourse.julialang.org/t/call-for-proposals-dataframes-jl-documentation/55418)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 0\
**Last updated:** [February 16, 2021, 8:08pm UTC](https://discourse.julialang.org/t/call-for-proposals-dataframes-jl-documentation/55418 "2021-02-16T20:08:34Z")

</div>

In cooperation with @vjd and Pumas AI I am glad to announce that DataFrames.jl that we are currently looking for a person who would be willing to work on improving the DataFrames.jl manual as this is an important area to…

---

## [Artificial ownership chaining from precompilation directives](https://discourse.julialang.org/t/artificial-ownership-chaining-from-precompilation-directives/55405)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 6:38pm UTC](https://discourse.julialang.org/t/artificial-ownership-chaining-from-precompilation-directives/55405 "2021-02-16T18:38:05Z")

</div>

Hey, I want to know if it is possible to do some artificial way to give ownership of the precompilation directives generated from SnoopCompile.jl to our package. My idea: @snoopi\_deep on a code → export it to prec…

---

## [Using GPU via PyCall causes non-reusable memory allocation](https://discourse.julialang.org/t/using-gpu-via-pycall-causes-non-reusable-memory-allocation/55140)

<div class="topic-metadata">

**Author:** [@JosePereiraUA](https://discourse.julialang.org/u/JosePereiraUA)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 6:33pm UTC](https://discourse.julialang.org/t/using-gpu-via-pycall-causes-non-reusable-memory-allocation/55140 "2021-02-16T18:33:14Z")

</div>

My name is José Pereira, I’m a portuguese PhD student currently using Julia to develop a light-weight protein design package. I’m trying to implement TorchANI, a known ML model for molecular energy calculation, developed…

---

## [Open MIT Julia Class tomorrow Wednesday 2/17 1:05pm](https://discourse.julialang.org/t/open-mit-julia-class-tomorrow-wednesday-2-17-1-05pm/55410)

<div class="topic-metadata">

**Author:** [@mit.edelman](https://discourse.julialang.org/u/mit.edelman)\
**Replies:** 0\
**Last updated:** [February 16, 2021, 6:31pm UTC](https://discourse.julialang.org/t/open-mit-julia-class-tomorrow-wednesday-2-17-1-05pm/55410 "2021-02-16T18:31:32Z")

</div>

Spread the word. Starting tomorrow we are broadcasting the spring semester MIT class on computational thinking with Julia: https://computationalthinking.mit.edu/Spring21/ This version of the class features a new compu…

---

## [Quick DataFrame question: I am trying to read CSVs that, for some reason, have pos](https://discourse.julialang.org/t/quick-dataframe-question-i-am-trying-to-read-csvs-that-for-some-reason-have-pos/55404)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 6:22pm UTC](https://discourse.julialang.org/t/quick-dataframe-question-i-am-trying-to-read-csvs-that-for-some-reason-have-pos/55404 "2021-02-16T18:22:17Z")

</div>

quick DataFrame question: I am trying to read CSVs that, for some reason, have possibly many columns of missing data at the end. The columns are entirely missing. Is there something similar to dropmissing that operates …

---

## [Need help with bar plot in Plots.jl](https://discourse.julialang.org/t/need-help-with-bar-plot-in-plots-jl/55360)

<div class="topic-metadata">

**Author:** [@asyrov](https://discourse.julialang.org/u/asyrov)\
**Replies:** 3\
**Last updated:** [February 16, 2021, 6:19pm UTC](https://discourse.julialang.org/t/need-help-with-bar-plot-in-plots-jl/55360 "2021-02-16T18:19:24Z")

</div>

I’m using Plots.jl from inside Weave.jl to generate html. All looks good except I cannot locate how to plot grouped bar chart similar to below. (Note: I saw similar questions solved for StatPlots.jl, but StatPlots is…

---

## [Writing to HDF5 File with Compound Datatypes](https://discourse.julialang.org/t/writing-to-hdf5-file-with-compound-datatypes/55408)

<div class="topic-metadata">

**Author:** [@nicrummel](https://discourse.julialang.org/u/nicrummel)\
**Replies:** 0\
**Last updated:** [February 16, 2021, 5:57pm UTC](https://discourse.julialang.org/t/writing-to-hdf5-file-with-compound-datatypes/55408 "2021-02-16T17:57:34Z")

</div>

The HDF5.jl is a great tool for reading and analyzing data from HDF5 files in Julia, but the process of writing is not straight forward. It appears that I will need to go through the low level API to accomplish the task …

---

## [Standard error of predictions?](https://discourse.julialang.org/t/standard-error-of-predictions/55398)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 2\
**Last updated:** [February 16, 2021, 4:32pm UTC](https://discourse.julialang.org/t/standard-error-of-predictions/55398 "2021-02-16T16:32:23Z")

</div>

seems like StatsBase.predict() gives only the point estimate (the mean) of prediction. How could I get more information like confidence interval or standard error of the prediction (not the coefficients)? thanks.

---

## [Drawing parametric surfaces in Plots.jl](https://discourse.julialang.org/t/drawing-parametric-surfaces-in-plots-jl/36560)

<div class="topic-metadata">

**Author:** [@Tbl](https://discourse.julialang.org/u/Tbl)\
**Replies:** 13\
**Last updated:** [February 16, 2021, 4:19pm UTC](https://discourse.julialang.org/t/drawing-parametric-surfaces-in-plots-jl/36560 "2021-02-16T16:19:46Z")

</div>

Does anyone know how to make a 3D plot of surfaces which are parametric? I mean e.g. sphere or Möbius strip. Looking at help and my own experiments, function surface draws on rectangles seem to not provide option of givi…

---

## [I need some help defining an interface that would kind of be a static class method](https://discourse.julialang.org/t/i-need-some-help-defining-an-interface-that-would-kind-of-be-a-static-class-method/54883)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 4:18pm UTC](https://discourse.julialang.org/t/i-need-some-help-defining-an-interface-that-would-kind-of-be-a-static-class-method/54883 "2021-02-16T16:18:37Z")

</div>

I need some help defining an interface that would kind of be a static class method in an OO language (while also having concrete instances of the contextual class with functionality in the class methods). For simplicity,…

---

## [Is there a way to define a 'module' variable?](https://discourse.julialang.org/t/is-there-a-way-to-define-a-module-variable/55301)

<div class="topic-metadata">

**Author:** [@stefkuypers](https://discourse.julialang.org/u/stefkuypers)\
**Replies:** 3\
**Last updated:** [February 16, 2021, 4:00pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-define-a-module-variable/55301 "2021-02-16T16:00:45Z")

</div>

I’m struggling a bit with scopes. From the documentation, this works: module Bar x = 1 foo() = x export foo end using .Bar foo() But this does not: module Tofu counter = 0 f() = (c…

---

## [Need to find datetime for a datetime plus a duration/period/timedelta](https://discourse.julialang.org/t/need-to-find-datetime-for-a-datetime-plus-a-duration-period-timedelta/55267)

<div class="topic-metadata">

**Author:** [@bvilmann](https://discourse.julialang.org/u/bvilmann)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 3:18pm UTC](https://discourse.julialang.org/t/need-to-find-datetime-for-a-datetime-plus-a-duration-period-timedelta/55267 "2021-02-16T15:18:41Z")

</div>

Suppose I have a period, defined by Time() and a datetime, DateTime(). My goal is to to get a new datetime: using Dates startTime = DateTime(2021,2,14,19,00) duration = Time(4,30) endTime = startTime + duration Abov…

---

## [Please help with my first research paper (on distributed computing, implemented in Julia)](https://discourse.julialang.org/t/please-help-with-my-first-research-paper-on-distributed-computing-implemented-in-julia/55395)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 3\
**Last updated:** [February 16, 2021, 3:15pm UTC](https://discourse.julialang.org/t/please-help-with-my-first-research-paper-on-distributed-computing-implemented-in-julia/55395 "2021-02-16T15:15:22Z")

</div>

I am finishing my very first research paper at the age of 42 :slight\_smile: , with the help of a friend. It is about automatically restructuring complex, long-running multi-threaded/distributed computations on the fly, …

---

## [Cannot capture log with JuMP](https://discourse.julialang.org/t/cannot-capture-log-with-jump/55365)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 5\
**Last updated:** [February 16, 2021, 2:43pm UTC](https://discourse.julialang.org/t/cannot-capture-log-with-jump/55365 "2021-02-16T14:43:48Z")

</div>

I wanna capture CPLEX log in a file when it executes. However, when solving MIP instances the last bit of the log is never captured by redirect\_stdout and redirect\_stderr. I do not know the reason, I only know it happens…

---

## [Help Improving Performance of a Loop](https://discourse.julialang.org/t/help-improving-performance-of-a-loop/55343)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 15\
**Last updated:** [February 16, 2021, 1:01pm UTC](https://discourse.julialang.org/t/help-improving-performance-of-a-loop/55343 "2021-02-16T13:01:21Z")

</div>

Hello! I am trying to make a code more efficient and I have found a huge bottleneck in the following function of this MWE: using Random, BenchmarkTools J = 250 T = 100 Mat1 = rand(J,J) vec1 = rand(J) Mat2= rand(J,J…

---

## [Gradient of sum](https://discourse.julialang.org/t/gradient-of-sum/55389)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 12:06pm UTC](https://discourse.julialang.org/t/gradient-of-sum/55389 "2021-02-16T12:06:39Z")

</div>

T = randn(10,10) ps = Flux.params(T) opt=ADAM() for iter = 1:100 gs = gradient(ps) do sum(T) end Flux.update!(opt, ps, gs) end throws an error: ArgumentError: Cannot setindex! to 0.00099999999000000…

---

## [Having trouble to get julia 1.5.3 setup in my students windows computers. It seems](https://discourse.julialang.org/t/having-trouble-to-get-julia-1-5-3-setup-in-my-students-windows-computers-it-seems/55383)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [February 16, 2021, 11:21am UTC](https://discourse.julialang.org/t/having-trouble-to-get-julia-1-5-3-setup-in-my-students-windows-computers-it-seems/55383 "2021-02-16T11:21:02Z")

</div>

Having trouble to get julia 1.5.3 setup in my students windows computers. It seems like the General registry is not added with the installation? Moreoever, when one tries \] registry add General they get ERROR: SystemErro…

---

## [DiffEqCallbacks problem with DDE](https://discourse.julialang.org/t/diffeqcallbacks-problem-with-dde/54921)

<div class="topic-metadata">

**Author:** [@zamk](https://discourse.julialang.org/u/zamk)\
**Replies:** 10\
**Last updated:** [February 16, 2021, 10:50am UTC](https://discourse.julialang.org/t/diffeqcallbacks-problem-with-dde/54921 "2021-02-16T10:50:48Z")

</div>

I have created a SavingCallback which prints out and saves the du, here is my code: prob = DDEProblem(model,u0,h,(0.0,120.0),p) alg = MethodOfSteps(Tsit5()) saved\_values = SavedValues(Float64,Array{Float64}) saving = Sa…

---

## [Lectures on Julia/JuMP for the next POEMA training day](https://discourse.julialang.org/t/lectures-on-julia-jump-for-the-next-poema-training-day/55384)

<div class="topic-metadata">

**Author:** [@magronv](https://discourse.julialang.org/u/magronv)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 10:34am UTC](https://discourse.julialang.org/t/lectures-on-julia-jump-for-the-next-poema-training-day/55384 "2021-02-16T10:34:34Z")

</div>

Dear members of the Julia community, I hope that everything goes well for you and your relatives. I allow myself to contact you on behalf of the POEMA EU consortium. POEMA stands for Polynomial Optimization, Efficiency…

---

## [Could pop!(::Dict, key, default) have a do-block method?](https://discourse.julialang.org/t/could-pop-dict-key-default-have-a-do-block-method/55378)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 10:10am UTC](https://discourse.julialang.org/t/could-pop-dict-key-default-have-a-do-block-method/55378 "2021-02-16T10:10:22Z")

</div>

Currently pop! has a method that requires all arguments to be evaluated beforehand: julia\> a = Dict("x" =\> 3, "y" =\> 4) Dict{String,Int64} with 2 entries: "x" =\> 3 "y" =\> 4 julia\> @time pop!(a, "x", (sleep(10); 5))…

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

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