# Latest

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

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

**Page:** 832

---

## [Construct a JuMP model from smaller models](https://discourse.julialang.org/t/construct-a-jump-model-from-smaller-models/91929)

<div class="topic-metadata">

**Author:** [@Betristor](https://discourse.julialang.org/u/Betristor)\
**Replies:** 4\
**Last updated:** [December 21, 2022, 8:18pm UTC](https://discourse.julialang.org/t/construct-a-jump-model-from-smaller-models/91929 "2022-12-21T20:18:52Z")

</div>

Hey guys, I’m quite curious about the JuMP model object. Once I construct a JuMP model where all variables and expressions are organized into one model instance which goes through many scripts and it worked. It could be …

---

## [Summarizing Float64 values after grouping by different time scales from DateTime object](https://discourse.julialang.org/t/summarizing-float64-values-after-grouping-by-different-time-scales-from-datetime-object/90320)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 2\
**Last updated:** [December 21, 2022, 3:56pm UTC](https://discourse.julialang.org/t/summarizing-float64-values-after-grouping-by-different-time-scales-from-datetime-object/90320 "2022-12-21T15:56:59Z")

</div>

I have a data frame with two columns. Column time has datetime elements while column values has Float64 elements. I want to group the column time by year, month, day, and hour to calculate the average of the values. I c…

---

## [Speeding up operations on large arrays](https://discourse.julialang.org/t/speeding-up-operations-on-large-arrays/91966)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 6\
**Last updated:** [December 21, 2022, 5:06pm UTC](https://discourse.julialang.org/t/speeding-up-operations-on-large-arrays/91966 "2022-12-21T17:06:06Z")

</div>

Hi, I’m working on a code that needs to calculate many, simple arithmetic on slices of large arrays. Ideally I’d like to understand how to speed up this code and explored multiple approaches: function sub\_single(x1, x…

---

## [Using a particular environment with Pluto](https://discourse.julialang.org/t/using-a-particular-environment-with-pluto/91967)

<div class="topic-metadata">

**Author:** [@lgmendes](https://discourse.julialang.org/u/lgmendes)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 5:04pm UTC](https://discourse.julialang.org/t/using-a-particular-environment-with-pluto/91967 "2022-12-21T17:04:08Z")

</div>

It is possible to use a particular environment in a Pluto notebook? i.e., using a package already installed in a particular environment? In the VScode terminal, even when I start Pluto within a particular environment I …

---

## [Optional elements in vector literal](https://discourse.julialang.org/t/optional-elements-in-vector-literal/91963)

<div class="topic-metadata">

**Author:** [@bjarthur](https://discourse.julialang.org/u/bjarthur)\
**Replies:** 5\
**Last updated:** [December 21, 2022, 4:33pm UTC](https://discourse.julialang.org/t/optional-elements-in-vector-literal/91963 "2022-12-21T16:33:27Z")

</div>

is there a nice way to optionally include an element in a vector literal construction? something like foo = \[1, 2, @maybe x 3, 4, 5\] where only if x==true is 3 included.

---

## [Loss of smoothness of a MeshViz/Makie plot when assigning colors to vertices](https://discourse.julialang.org/t/loss-of-smoothness-of-a-meshviz-makie-plot-when-assigning-colors-to-vertices/91964)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 4:32pm UTC](https://discourse.julialang.org/t/loss-of-smoothness-of-a-meshviz-makie-plot-when-assigning-colors-to-vertices/91964 "2022-12-21T16:32:31Z")

</div>

Hello, I have a 3D mesh made with the Meshes package. When I plot it with MeshViz using the default attributes, it is smooth. But when I assign some colors to the vertices of the mesh, it is not smooth anymore: How …

---

## [AbstractTrees parent child circular reference](https://discourse.julialang.org/t/abstracttrees-parent-child-circular-reference/91959)

<div class="topic-metadata">

**Author:** [@Lighfe](https://discourse.julialang.org/u/Lighfe)\
**Replies:** 3\
**Last updated:** [December 21, 2022, 3:59pm UTC](https://discourse.julialang.org/t/abstracttrees-parent-child-circular-reference/91959 "2022-12-21T15:59:32Z")

</div>

I’m trying to implement a fairly simple tree. mutable struct TreeNode parent::Union{Nothing,TreeNode} name::String children::Vector{TreeNode} size::Int end mutable struct Tree nodes::Vector{TreeNode}…

---

## [Stepping thru a matrix](https://discourse.julialang.org/t/stepping-thru-a-matrix/91956)

<div class="topic-metadata">

**Author:** [@jdarnold](https://discourse.julialang.org/u/jdarnold)\
**Replies:** 2\
**Last updated:** [December 21, 2022, 3:03pm UTC](https://discourse.julialang.org/t/stepping-thru-a-matrix/91956 "2022-12-21T15:03:30Z")

</div>

I’m just wondering if there is a easier / better way to step thru the elements of a 10x2 matrix, where I want to get each part of the x2 as an element: testmatrix = zeros(Int,10,2) for tidx = 1:size(testmatrix)\[1\] …

---

## [VCS Julia Formatter error](https://discourse.julialang.org/t/vcs-julia-formatter-error/91943)

<div class="topic-metadata">

**Author:** [@pjgorski](https://discourse.julialang.org/u/pjgorski)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 2:31pm UTC](https://discourse.julialang.org/t/vcs-julia-formatter-error/91943 "2022-12-21T14:31:20Z")

</div>

Hi! 6 weeks ago everything was working fine. I came back to one of my projects. Before doing anything, I had 3 uncommitted changes: a change in todo.txt file, new pdf file, change in jupyter file. I committed the change…

---

## [How to Create a Brackets for certain length in Plots?](https://discourse.julialang.org/t/how-to-create-a-brackets-for-certain-length-in-plots/91930)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 2:18pm UTC](https://discourse.julialang.org/t/how-to-create-a-brackets-for-certain-length-in-plots/91930 "2022-12-21T14:18:36Z")

</div>

Hi all, I want to create a bracket like this: I currently use a line and two bars to replace the bracket, I try to use } with rotation and increase the length and it is not working. this is my code: using Plots, La…

---

## [How to get the Cartesian indices of a row/column in a \`Matrix\`?](https://discourse.julialang.org/t/how-to-get-the-cartesian-indices-of-a-row-column-in-a-matrix/91940)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 3\
**Last updated:** [December 21, 2022, 2:22pm UTC](https://discourse.julialang.org/t/how-to-get-the-cartesian-indices-of-a-row-column-in-a-matrix/91940 "2022-12-21T14:22:24Z")

</div>

Given a Matrix m, setting its values is simple: m = rand(4, 4) m\[begin, :\] = 1 m\[:, end\] = 2 But how can we get the indices of its first row/last column of elements? I guess it is similar to this question: Eachindex fo…

---

## [Color ramp](https://discourse.julialang.org/t/color-ramp/91946)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 7\
**Last updated:** [December 21, 2022, 1:37pm UTC](https://discourse.julialang.org/t/color-ramp/91946 "2022-12-21T13:37:35Z")

</div>

Hello, I’m looking for a package providing color ramps. By color ramp I mean a function defined by a color palette and which maps a number between 0 and 1 to a color of this palette, by interpolation. 0 is mapped to the…

---

## [Run(\`\`),and how to add $](https://discourse.julialang.org/t/run-and-how-to-add/91947)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 12:50pm UTC](https://discourse.julialang.org/t/run-and-how-to-add/91947 "2022-12-21T12:50:30Z")

</div>

I ran this code in linux shell. And I want to filter the last column which is smaller than 1000. cat test.bed 999981 999981 HES4 981 1173903 1173903 TTLL10 15903 1173903 1173903 TTLL10 1903 1287109 1287109 SCNN1…

---

## [How to do an atomic compare and swap on a SharedArray](https://discourse.julialang.org/t/how-to-do-an-atomic-compare-and-swap-on-a-sharedarray/91942)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 0\
**Last updated:** [December 21, 2022, 10:52am UTC](https://discourse.julialang.org/t/how-to-do-an-atomic-compare-and-swap-on-a-sharedarray/91942 "2022-12-21T10:52:24Z")

</div>

Hi all :slight\_smile: I want to use shared memory and do an atomic\_cas! (Atomically compare-and-set) in some file/ shared array. How would I do that? Thanks!

---

## [How to use \`invoke\` with a functor](https://discourse.julialang.org/t/how-to-use-invoke-with-a-functor/91949)

<div class="topic-metadata">

**Author:** [@abraunst](https://discourse.julialang.org/u/abraunst)\
**Replies:** 0\
**Last updated:** [December 21, 2022, 12:22pm UTC](https://discourse.julialang.org/t/how-to-use-invoke-with-a-functor/91949 "2022-12-21T12:22:23Z")

</div>

This is maybe a stupid question, but I couldn’t find the answer in the documentation. I need it mainly for debugging, but a minimal example would be abstract type A end (::A)() = "A" struct B \<: A end (::B)() = "B" b = …

---

## [Check that two julia files lead to the same code](https://discourse.julialang.org/t/check-that-two-julia-files-lead-to-the-same-code/91918)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 6\
**Last updated:** [December 21, 2022, 11:05am UTC](https://discourse.julialang.org/t/check-that-two-julia-files-lead-to-the-same-code/91918 "2022-12-21T11:05:46Z")

</div>

Let’s say I have these two files: a.jl function foo() println("hello") end and b.jl """ foo() A function """ function foo() println("hello") end is there an easy way to assess that these two files are “the sa…

---

## [A minimal example with Base.redirect\_stdout](https://discourse.julialang.org/t/a-minimal-example-with-base-redirect-stdout/64245)

<div class="topic-metadata">

**Author:** [@harris-chris](https://discourse.julialang.org/u/harris-chris)\
**Replies:** 10\
**Last updated:** [December 21, 2022, 10:03am UTC](https://discourse.julialang.org/t/a-minimal-example-with-base-redirect-stdout/64245 "2022-12-21T10:03:24Z")

</div>

Hello all I’m having a bit of difficulty making the Base.redirect\_stdout(f::Function, stream) method work. What I would have thought would be a minimal working example is in fact a minimal failing example: out = Pipe()…

---

## [HypothesisTests, rand and very low pvalue](https://discourse.julialang.org/t/hypothesistests-rand-and-very-low-pvalue/91939)

<div class="topic-metadata">

**Author:** [@fpoling](https://discourse.julialang.org/u/fpoling)\
**Replies:** 1\
**Last updated:** [December 21, 2022, 9:53am UTC](https://discourse.julialang.org/t/hypothesistests-rand-and-very-low-pvalue/91939 "2022-12-21T09:53:56Z")

</div>

Consider the following code: using Distributions import HypothesisTests as HT HT.pvalue(HT.ApproximateOneSampleKSTest(rand(Normal(), 1\_000\_000), Normal())) I expected that the answer will be very close to one, but depe…

---

## [run(\`...\`),I want to return like the shell not process](https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 3\
**Last updated:** [December 21, 2022, 8:27am UTC](https://discourse.julialang.org/t/run-i-want-to-return-like-the-shell-not-process/91933 "2022-12-21T08:27:52Z")

</div>

julia\> run(\`which samtools\`) /home/zhangchunyong/miniconda3/envs/chipseq/bin/samtools Process(\`which samtools\`, ProcessExited(0)) julia\> ans Process(\`which samtools\`, ProcessExited(0)) But I want return “/home/zhangchu…

---

## [How to get the first row of each group of a DataFrame?](https://discourse.julialang.org/t/how-to-get-the-first-row-of-each-group-of-a-dataframe/47320)

<div class="topic-metadata">

**Author:** [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Replies:** 7\
**Last updated:** [December 20, 2022, 4:58pm UTC](https://discourse.julialang.org/t/how-to-get-the-first-row-of-each-group-of-a-dataframe/47320 "2022-12-20T16:58:55Z")

</div>

How do I get the first row from each group of a grouped DataFrame? Say, I want to find the sex and height of the tallest person in each age-group: using DataFrames df = DataFrame(sex = repeat(\["F","M"\], inner=4, outer=…

---

## [Delete user input from terminal?](https://discourse.julialang.org/t/delete-user-input-from-terminal/91619)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 4\
**Last updated:** [December 20, 2022, 11:50pm UTC](https://discourse.julialang.org/t/delete-user-input-from-terminal/91619 "2022-12-20T23:50:26Z")

</div>

I’m working on a little project that’s a “personal assistant” to me manage my todo list. I’m using Term.jl to make it look pretty. I’m trying to emulate sort of a chat box aesthetic. It’s bugging me that I can’t rem…

---

## [\`sort\` vs \`copy\`+\`sort!\`](https://discourse.julialang.org/t/sort-vs-copy-sort/91919)

<div class="topic-metadata">

**Author:** [@Dan](https://discourse.julialang.org/u/Dan)\
**Replies:** 3\
**Last updated:** [December 20, 2022, 11:47pm UTC](https://discourse.julialang.org/t/sort-vs-copy-sort/91919 "2022-12-20T23:47:19Z")

</div>

This is run on Julia 1.8.3 using BenchmarkTools function benchsort(L) v = rand(L) @show L @btime sort($v) @btime sort!($v) @btime sort!(copy($v)) nothing end Running this with 2048 length vecto…

---

## [Mini batching with ensemble problem diffeq and neural ode's sciml](https://discourse.julialang.org/t/mini-batching-with-ensemble-problem-diffeq-and-neural-odes-sciml/91665)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 11\
**Last updated:** [December 20, 2022, 11:26pm UTC](https://discourse.julialang.org/t/mini-batching-with-ensemble-problem-diffeq-and-neural-odes-sciml/91665 "2022-12-20T23:26:19Z")

</div>

Following this excellent example: https://docs.sciml.ai/SciMLSensitivity/stable/ode\_fitting/data\_parallel/#Minibatching-Across-GPUs-with-DiffEqGPU The title seems to tempt me with the syntax for micro-batching to make …

---

## [Is there a way to enable syntax highlighting for Expr objects in the REPL?](https://discourse.julialang.org/t/is-there-a-way-to-enable-syntax-highlighting-for-expr-objects-in-the-repl/91920)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 0\
**Last updated:** [December 20, 2022, 11:21pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-enable-syntax-highlighting-for-expr-objects-in-the-repl/91920 "2022-12-20T23:21:03Z")

</div>

I think it will be easier to debug expressions returned by macros if they could be syntax highlighted. The package OhMyREPL already enables syntax highlighting in the REPL (which i use), but it doesn’t highlight expressi…

---

## [How to show docstring-based documentation in IJulia notebooks?](https://discourse.julialang.org/t/how-to-show-docstring-based-documentation-in-ijulia-notebooks/40814)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [December 20, 2022, 11:14pm UTC](https://discourse.julialang.org/t/how-to-show-docstring-based-documentation-in-ijulia-notebooks/40814 "2022-12-20T23:14:54Z")

</div>

If I type ?\[Function\] in a jupyter notebook with a IJulia kernel, I can see IJulia searches for the documentation and it “finds” it, but it doesn’t show it :-/ : Julia 1.4.1, IJulia 1.21.2

---

## [Precompilation/recompilation - what's going on?](https://discourse.julialang.org/t/precompilation-recompilation-whats-going-on/91829)

<div class="topic-metadata">

**Author:** [@FedeClaudi](https://discourse.julialang.org/u/FedeClaudi)\
**Replies:** 3\
**Last updated:** [December 20, 2022, 10:23pm UTC](https://discourse.julialang.org/t/precompilation-recompilation-whats-going-on/91829 "2022-12-20T22:23:03Z")

</div>

Hey folks, I’m working on improving time to first X in Term.jl by precompilation etc, but it’s not a tool I’m super familiar with these things so I was hoping someone might give me some advice. For reference, I’ve red s…

---

## [Package or Function to find and access keys in a nested dicts](https://discourse.julialang.org/t/package-or-function-to-find-and-access-keys-in-a-nested-dicts/91909)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 9\
**Last updated:** [December 20, 2022, 9:58pm UTC](https://discourse.julialang.org/t/package-or-function-to-find-and-access-keys-in-a-nested-dicts/91909 "2022-12-20T21:58:10Z")

</div>

Continuing the discussion from Looking for a key in a nested dict: This does not work for me, my Dict has three sub-layers of Dicts. In my case I can reach the value of interest by the following command: molar\_mass\_ …

---

## [Big Book of Julia - please contribute!](https://discourse.julialang.org/t/big-book-of-julia-please-contribute/89484)

<div class="topic-metadata">

**Author:** [@AdamWysokinski](https://discourse.julialang.org/u/AdamWysokinski)\
**Replies:** 3\
**Last updated:** [December 20, 2022, 10:04pm UTC](https://discourse.julialang.org/t/big-book-of-julia-please-contribute/89484 "2022-12-20T22:04:18Z")

</div>

Hi, The Big Book of Julia (BBJ) is slowly, but constantly growing. Please contribute by adding links to webpages/tutorials/package documentation/books. https://codeberg.org/AdamWysokinski/BBJ ATB, Adam

---

## [Use the Docstrings Luke](https://discourse.julialang.org/t/use-the-docstrings-luke/91915)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 1\
**Last updated:** [December 20, 2022, 9:55pm UTC](https://discourse.julialang.org/t/use-the-docstrings-luke/91915 "2022-12-20T21:55:39Z")

</div>

I just had a small revelation… following a post on the issasigned function I wanted to discover more about it. Googling for the documentation I saw a reddit article which prompted the reader to read the docstrings… So r…

---

## [Parsing of mysql timestamps](https://discourse.julialang.org/t/parsing-of-mysql-timestamps/77587)

<div class="topic-metadata">

**Author:** [@linusheinz](https://discourse.julialang.org/u/linusheinz)\
**Replies:** 8\
**Last updated:** [December 20, 2022, 9:42pm UTC](https://discourse.julialang.org/t/parsing-of-mysql-timestamps/77587 "2022-12-20T21:42:50Z")

</div>

I am querying a table with a timestamp: data = DBInterface.execute(database, sql) df = DataFrame(data) But I get : ERROR: LoadError: error parsing DateTime from "2022-01-04 15:08:44.171540" Stacktrace: How can I tell…

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

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