# General Usage

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

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

**Page:** 573

---

## [How to compute the rolling standardization using DataFrames](https://discourse.julialang.org/t/how-to-compute-the-rolling-standardization-using-dataframes/64976)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 8\
**Last updated:** [July 21, 2021, 3:54pm UTC](https://discourse.julialang.org/t/how-to-compute-the-rolling-standardization-using-dataframes/64976 "2021-07-21T15:54:42Z")

</div>

using DataFrames data = DataFrame(time = rand(1:100, 1\_000\_000), val=rand(1\_000\_000)) consider the above data frame and say I wish to compute the average val within a rolling window and normalize each val using the roll…

---

## [Function input vs argument](https://discourse.julialang.org/t/function-input-vs-argument/65040)

<div class="topic-metadata">

**Author:** [@AhmedAlreweny](https://discourse.julialang.org/u/AhmedAlreweny)\
**Replies:** 1\
**Last updated:** [July 21, 2021, 3:48pm UTC](https://discourse.julialang.org/t/function-input-vs-argument/65040 "2021-07-21T15:48:03Z")

</div>

Hi, Sometimes it happens that I want to define a function f(x,y) that have two arguments (x ,y in this case ) to use it further in gradient computation or some similar application that requires a clear explicit definit…

---

## [Problem combining worker processes and threads](https://discourse.julialang.org/t/problem-combining-worker-processes-and-threads/64069)

<div class="topic-metadata">

**Author:** [@orenbenkiki](https://discourse.julialang.org/u/orenbenkiki)\
**Replies:** 8\
**Last updated:** [July 21, 2021, 2:04pm UTC](https://discourse.julialang.org/t/problem-combining-worker-processes-and-threads/64069 "2021-07-21T14:04:55Z")

</div>

(Running julia 1.6.1 if that matters) Seeking help in understanding what am I doing wrong in an application which combines multiple worker processes and multiple threads within each one. I’ve been pushing and pulling at…

---

## [Multi-threadded processing of large number of files faster when reading in batch](https://discourse.julialang.org/t/multi-threadded-processing-of-large-number-of-files-faster-when-reading-in-batch/64968)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 10\
**Last updated:** [July 21, 2021, 1:27pm UTC](https://discourse.julialang.org/t/multi-threadded-processing-of-large-number-of-files-faster-when-reading-in-batch/64968 "2021-07-21T13:27:17Z")

</div>

Dear All, I would like to ask a question about a behavior of multi-threadding. My usecase is following. I have on disk 800 000 files containing compressed JSONs, and I want to find those containing some predefined set o…

---

## [Problem with @async and remotecall\_fetch()](https://discourse.julialang.org/t/problem-with-async-and-remotecall-fetch/65022)

<div class="topic-metadata">

**Author:** [@WeiMXi](https://discourse.julialang.org/u/WeiMXi)\
**Replies:** 1\
**Last updated:** [July 21, 2021, 11:46am UTC](https://discourse.julialang.org/t/problem-with-async-and-remotecall-fetch/65022 "2021-07-21T11:46:57Z")

</div>

I have the following code, my purpose is assigning the tasks to the different workers, and print the progress. # bug.jl # a simple calculation task function cal\_one\_task(size) a = rand(size) sum(a) end # manag…

---

## [Generic square matrix constructor from a vector?](https://discourse.julialang.org/t/generic-square-matrix-constructor-from-a-vector/62306)

<div class="topic-metadata">

**Author:** [@Vasily\_Pisarev](https://discourse.julialang.org/u/Vasily_Pisarev)\
**Replies:** 1\
**Last updated:** [July 21, 2021, 5:42am UTC](https://discourse.julialang.org/t/generic-square-matrix-constructor-from-a-vector/62306 "2021-07-21T05:42:24Z")

</div>

Is there a generic way, given a vector, to produce a square matrix of the “best matching” type? By “best matching” I mean here Matrix for Base vectors and views, MMatrix for static arrays and SizedMatrix for SizedVectors…

---

## [ModelingToolkit: how to get variable index of ODE solution as interpolating function](https://discourse.julialang.org/t/modelingtoolkit-how-to-get-variable-index-of-ode-solution-as-interpolating-function/64999)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 2\
**Last updated:** [July 21, 2021, 1:16am UTC](https://discourse.julialang.org/t/modelingtoolkit-how-to-get-variable-index-of-ode-solution-as-interpolating-function/64999 "2021-07-21T01:16:39Z")

</div>

Since the ordering of symbols is not guaranteed, the solution of ode’s from ModelingToolkit is usually accessed by name. However, sol\[foo\] only gives a vector (against sol.t). How to find the index of some variable foo i…

---

## [NamedTuple with explicit (abstract) types](https://discourse.julialang.org/t/namedtuple-with-explicit-abstract-types/65000)

<div class="topic-metadata">

**Author:** [@Uroc327](https://discourse.julialang.org/u/Uroc327)\
**Replies:** 3\
**Last updated:** [July 20, 2021, 7:04pm UTC](https://discourse.julialang.org/t/namedtuple-with-explicit-abstract-types/65000 "2021-07-20T19:04:41Z")

</div>

How can I create a NamedTuple with an abstract type? When I try the following code, nt.a is of concrete type Vector{Float64} and the assignment nt.a\[\] = arr fails because a Matrix{Int64} cannot be converted to a Vector{…

---

## [Mutable sorted collections](https://discourse.julialang.org/t/mutable-sorted-collections/64938)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 7\
**Last updated:** [July 20, 2021, 6:13pm UTC](https://discourse.julialang.org/t/mutable-sorted-collections/64938 "2021-07-20T18:13:07Z")

</div>

I don’t understand what the use case for SortedSet is. It seems to only collect and sort keys, with no values associated with those keys. I have a homogeneous collection of structs (points of a parameterized curve in a …

---

## [Is it safe to run this code in multithread way: modify the same data frame in loop](https://discourse.julialang.org/t/is-it-safe-to-run-this-code-in-multithread-way-modify-the-same-data-frame-in-loop/64896)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 3\
**Last updated:** [July 20, 2021, 5:59pm UTC](https://discourse.julialang.org/t/is-it-safe-to-run-this-code-in-multithread-way-modify-the-same-data-frame-in-loop/64896 "2021-07-20T17:59:21Z")

</div>

I wonder, is it safe to modify the same Data Frame in a multithread loop? @threads for i in 1:size(df)\[1\] df.column\[i\] = some\_function(…) end Thank you in advance. Best

---

## [Using cppyy for julia/C++ interoperability](https://discourse.julialang.org/t/using-cppyy-for-julia-c-interoperability/63979)

<div class="topic-metadata">

**Author:** [@kfjahnke](https://discourse.julialang.org/u/kfjahnke)\
**Replies:** 34\
**Last updated:** [July 20, 2021, 4:56pm UTC](https://discourse.julialang.org/t/using-cppyy-for-julia-c-interoperability/63979 "2021-07-20T16:56:02Z")

</div>

Browsing the julia universe, I found interpolations.jl, which offers b-spline interpolation. I am the author of a comprehensive C++ b-spline library, so I thought I’d post a greeting issue to the colleagues and point the…

---

## [How to input files as command line arguments to compiled Julia](https://discourse.julialang.org/t/how-to-input-files-as-command-line-arguments-to-compiled-julia/64633)

<div class="topic-metadata">

**Author:** [@connormeaton](https://discourse.julialang.org/u/connormeaton)\
**Replies:** 46\
**Last updated:** [July 20, 2021, 3:50pm UTC](https://discourse.julialang.org/t/how-to-input-files-as-command-line-arguments-to-compiled-julia/64633 "2021-07-20T15:50:24Z")

</div>

I am building a shippable app with Julia using the PackageCompiler.jl library. I have followed the example they provided and replicated it properly. I am now trying to modify the code piece by piece to replace the to…

---

## [How can I speed up my Neural ODE?](https://discourse.julialang.org/t/how-can-i-speed-up-my-neural-ode/64848)

<div class="topic-metadata">

**Author:** [@Antonino\_Gandolfo](https://discourse.julialang.org/u/Antonino_Gandolfo)\
**Replies:** 4\
**Last updated:** [July 20, 2021, 3:14pm UTC](https://discourse.julialang.org/t/how-can-i-speed-up-my-neural-ode/64848 "2021-07-20T15:14:12Z")

</div>

Hi @ChrisRackauckas , I would like to ask you how can I speed up my code. I tried to do a system identification about an HVAC system. Here’s the code: using CSV,DataFrames,DifferentialEquations,Plots,Flux,DiffEqFlux,…

---

## [What is the best way to get orthogonal polynomials for a regression like R's poly function](https://discourse.julialang.org/t/what-is-the-best-way-to-get-orthogonal-polynomials-for-a-regression-like-rs-poly-function/64972)

<div class="topic-metadata">

**Author:** [@andrewjessop](https://discourse.julialang.org/u/andrewjessop)\
**Replies:** 1\
**Last updated:** [July 20, 2021, 11:51am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-get-orthogonal-polynomials-for-a-regression-like-rs-poly-function/64972 "2021-07-20T11:51:59Z")

</div>

R has a very easy-to-use function where you provide a vector and it will return orthogonal polynomial vectors that can be used in linear models. There are a few different polynomial packages available. Can this be done …

---

## [Issue while using dictionary in Julia](https://discourse.julialang.org/t/issue-while-using-dictionary-in-julia/64925)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 4\
**Last updated:** [July 20, 2021, 10:57am UTC](https://discourse.julialang.org/t/issue-while-using-dictionary-in-julia/64925 "2021-07-20T10:57:22Z")

</div>

items = Dict{String,Int64} Total\_craneMovement =985 MaxCraneMovement =312 CraneIntensity =Total\_craneMovement/MaxCraneMovement push!(items,"Total\_craneMovement"=\>Total\_craneMovement) push!(items,"MaxCraneMovement"=\>MaxC…

---

## [Display full error message, and continue](https://discourse.julialang.org/t/display-full-error-message-and-continue/64747)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 3\
**Last updated:** [July 20, 2021, 9:03am UTC](https://discourse.julialang.org/t/display-full-error-message-and-continue/64747 "2021-07-20T09:03:04Z")

</div>

I want to catch an error, display the full error message, and then continue execution (to return whatever data was produced before the error. So I code (MWE) v = Vector{Vector{Float64}}(undef,3) try v\[2\] catch err …

---

## [Tkinter - Error on button-click](https://discourse.julialang.org/t/tkinter-error-on-button-click/64740)

<div class="topic-metadata">

**Author:** [@trilobit](https://discourse.julialang.org/u/trilobit)\
**Replies:** 2\
**Last updated:** [July 20, 2021, 5:29am UTC](https://discourse.julialang.org/t/tkinter-error-on-button-click/64740 "2021-07-20T05:29:04Z")

</div>

Hi, I’m playing around with Tkinter and don’t understand why I get an error, when I want to replace a text. The test program should start a new measurement, but something goes wrong, when the “Repeat”-Button is click…

---

## [Local scope rules are confusing in inner scopes (Julia 1.6)](https://discourse.julialang.org/t/local-scope-rules-are-confusing-in-inner-scopes-julia-1-6/64936)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 1\
**Last updated:** [July 20, 2021, 2:03am UTC](https://discourse.julialang.org/t/local-scope-rules-are-confusing-in-inner-scopes-julia-1-6/64936 "2021-07-20T02:03:52Z")

</div>

I am using Julia 1.6.1: julia\> VERSION v"1.6.1-pre.1" I find the local scope rules are confusing to apply to inner scopes (such as inner functions). The rules are described at described at Scope of Variables · The Ju…

---

## [How to define an infix operator that can act on multiple arguments at once like \`:\`?](https://discourse.julialang.org/t/how-to-define-an-infix-operator-that-can-act-on-multiple-arguments-at-once-like/64954)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 3\
**Last updated:** [July 19, 2021, 11:21pm UTC](https://discourse.julialang.org/t/how-to-define-an-infix-operator-that-can-act-on-multiple-arguments-at-once-like/64954 "2021-07-19T23:21:53Z")

</div>

Forgive me if I am wrong, but why can : act on 3 arguments at a time as an infix operator? julia\> @which 1:2:3 (::Colon)(start::T, step::T, stop::T) where T\<:Real in Base at range.jl:22 If I want to define a new operat…

---

## [Raw string "$"](https://discourse.julialang.org/t/raw-string/64948)

<div class="topic-metadata">

**Author:** [@Angie\_Cruz](https://discourse.julialang.org/u/Angie_Cruz)\
**Replies:** 5\
**Last updated:** [July 19, 2021, 10:05pm UTC](https://discourse.julialang.org/t/raw-string/64948 "2021-07-19T22:05:58Z")

</div>

Hello, I would like to print “abc$def” as a string x = "abc$def" but it doesn’t allow me because of the $, I tried to write it like this x="abc"\*raw"$"\*"def" but I get the following: "abc\\$def" My issue is that I d…

---

## [Need help learning Julia (tutorial example doesn't work for SQLite.Query](https://discourse.julialang.org/t/need-help-learning-julia-tutorial-example-doesnt-work-for-sqlite-query/64942)

<div class="topic-metadata">

**Author:** [@ChaoticSun](https://discourse.julialang.org/u/ChaoticSun)\
**Replies:** 3\
**Last updated:** [July 19, 2021, 9:01pm UTC](https://discourse.julialang.org/t/need-help-learning-julia-tutorial-example-doesnt-work-for-sqlite-query/64942 "2021-07-19T21:01:04Z")

</div>

Good afternoon. I’m trying to learn Julia and found a long tutorial (over 4 hours). I’ve been tracking along pretty well until I hit the database section using the SQLite package. I’ve created the DB (a very simple one e…

---

## [How to generate Project.toml and Manifest.toml for a repository for be executed with Binder](https://discourse.julialang.org/t/how-to-generate-project-toml-and-manifest-toml-for-a-repository-for-be-executed-with-binder/64939)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 3\
**Last updated:** [July 19, 2021, 8:15pm UTC](https://discourse.julialang.org/t/how-to-generate-project-toml-and-manifest-toml-for-a-repository-for-be-executed-with-binder/64939 "2021-07-19T20:15:11Z")

</div>

I have a local folder that contains a subfolder with two jl files, and a few Jupyter Notebooks in the root. I intend to push it to a github repository to use Binder for running the notebooks. My notebooks are using a f…

---

## [How to create a pre-compiler Julia image from C to reduce init time?](https://discourse.julialang.org/t/how-to-create-a-pre-compiler-julia-image-from-c-to-reduce-init-time/64930)

<div class="topic-metadata">

**Author:** [@Clonkk](https://discourse.julialang.org/u/Clonkk)\
**Replies:** 0\
**Last updated:** [July 19, 2021, 3:30pm UTC](https://discourse.julialang.org/t/how-to-create-a-pre-compiler-julia-image-from-c-to-reduce-init-time/64930 "2021-07-19T15:30:36Z")

</div>

Hello, I’ve been working on integratring Julia with Nim on GitHub - Clonkk/nimjl: A bridge between Nim-lang and Julia ! and I’d like to be able to save pre-compiled image and load them at start-up. For that I’m hoping …

---

## [NLopt - Same complex clalculations in objetive function and nonlinear constraints](https://discourse.julialang.org/t/nlopt-same-complex-clalculations-in-objetive-function-and-nonlinear-constraints/41677)

<div class="topic-metadata">

**Author:** [@wg030](https://discourse.julialang.org/u/wg030)\
**Replies:** 17\
**Last updated:** [July 19, 2021, 1:31pm UTC](https://discourse.julialang.org/t/nlopt-same-complex-clalculations-in-objetive-function-and-nonlinear-constraints/41677 "2021-07-19T13:31:52Z")

</div>

Hey guys, I need a hint on how to effectivley solve a nonlinear optimization problem with NLopt package when my objective function contains some complex calculations and my nonlinear constraint contains the same complex…

---

## [Trying to train a variable GNN w/ GeometricFlux.jl](https://discourse.julialang.org/t/trying-to-train-a-variable-gnn-w-geometricflux-jl/64246)

<div class="topic-metadata">

**Author:** [@eahenle](https://discourse.julialang.org/u/eahenle)\
**Replies:** 4\
**Last updated:** [July 19, 2021, 1:23pm UTC](https://discourse.julialang.org/t/trying-to-train-a-variable-gnn-w-geometricflux-jl/64246 "2021-07-19T13:23:14Z")

</div>

I am trying to train a gated graph neural network to predict molecular properties with GeometricFlux.jl: GitHub - FluxML/GeometricFlux.jl: Geometric Deep Learning for Flux The inputs are FeaturedGraph objects of various…

---

## [Is there a name for an iterator that is like \`product(a, a)\` except only distinct-indexed elements are paired](https://discourse.julialang.org/t/is-there-a-name-for-an-iterator-that-is-like-product-a-a-except-only-distinct-indexed-elements-are-paired/64838)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [July 19, 2021, 12:54pm UTC](https://discourse.julialang.org/t/is-there-a-name-for-an-iterator-that-is-like-product-a-a-except-only-distinct-indexed-elements-are-paired/64838 "2021-07-19T12:54:21Z")

</div>

I often want to iterator over a iterable in such a way that distinct-index elements are only paired once. This is useful for things like one round round-robin leagues for i in 1:length(a)-1 for j in i+1:length(a) a…

---

## [Compilation does not terminate (\>3 hours) with nested numerical integration](https://discourse.julialang.org/t/compilation-does-not-terminate-3-hours-with-nested-numerical-integration/64922)

<div class="topic-metadata">

**Author:** [@meew0](https://discourse.julialang.org/u/meew0)\
**Replies:** 0\
**Last updated:** [July 19, 2021, 11:30am UTC](https://discourse.julialang.org/t/compilation-does-not-terminate-3-hours-with-nested-numerical-integration/64922 "2021-07-19T11:30:58Z")

</div>

I am trying to do two-dimensional numerical integration. For this my first attempt was something like the following, using DoubleExponentialFormulas.jl. This example is significantly reduced and no longer does anything m…

---

## [Solving ODE with vector Argument](https://discourse.julialang.org/t/solving-ode-with-vector-argument/64907)

<div class="topic-metadata">

**Author:** [@aiiiob\_bie](https://discourse.julialang.org/u/aiiiob_bie)\
**Replies:** 2\
**Last updated:** [July 19, 2021, 11:15am UTC](https://discourse.julialang.org/t/solving-ode-with-vector-argument/64907 "2021-07-19T11:15:54Z")

</div>

Dear Friends I am trying to solve an ode problem function myfun(du,u,p,t) where u consists of the vectors x,z,e. I want this function return solution just for e (I do not know how must I do this) Here is the code whi…

---

## [Strange performance characteristics and regression with tuple recursion](https://discourse.julialang.org/t/strange-performance-characteristics-and-regression-with-tuple-recursion/64888)

<div class="topic-metadata">

**Author:** [@jfeist](https://discourse.julialang.org/u/jfeist)\
**Replies:** 5\
**Last updated:** [July 19, 2021, 10:14am UTC](https://discourse.julialang.org/t/strange-performance-characteristics-and-regression-with-tuple-recursion/64888 "2021-07-19T10:14:09Z")

</div>

I have a custom iterator that produces the unique indices of an M-dimensional array with exchange symmetry (i.e., where the value is the same for any permutation of the indices), which is the same as the nonzero indices …

---

## [Deploying docs to another repo with Github Actions](https://discourse.julialang.org/t/deploying-docs-to-another-repo-with-github-actions/64459)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 4\
**Last updated:** [July 19, 2021, 9:25am UTC](https://discourse.julialang.org/t/deploying-docs-to-another-repo-with-github-actions/64459 "2021-07-19T09:25:47Z")

</div>

Trying to move a large-ish project with externally hosted documentation from Travis to Github Actions (It worked with Travis some time ago). deploydocs( repo = "github.com/Circo-dev/Circo-docs.git", branch = "ma…

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

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