# General Usage

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

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

**Page:** 378

---

## [How to define a symbolic vector using for loop with Symbolics.jl?](https://discourse.julialang.org/t/how-to-define-a-symbolic-vector-using-for-loop-with-symbolics-jl/89262)

<div class="topic-metadata">

**Author:** [@xyli](https://discourse.julialang.org/u/xyli)\
**Replies:** 7\
**Last updated:** [October 26, 2022, 7:32pm UTC](https://discourse.julialang.org/t/how-to-define-a-symbolic-vector-using-for-loop-with-symbolics-jl/89262 "2022-10-26T19:32:28Z")

</div>

Dear all, How to define a symbolic vector using for loop with Symbolics.jl? For example, x=\[x1, x2, x3, x4, …, x100\], where xi are all variables defined using @variables. It can be easily done using sympy.jl as julia\>…

---

## [Using CLang version 14](https://discourse.julialang.org/t/using-clang-version-14/89321)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 0\
**Last updated:** [October 26, 2022, 7:11pm UTC](https://discourse.julialang.org/t/using-clang-version-14/89321 "2022-10-26T19:11:25Z")

</div>

I would like to use CLang version 14 to parse some C++ files. The C++ files I would like to parse are using the “module” feature added in C++20 and it doesn’t appear that version 13 understands the module keyword. I bel…

---

## [Questions about csv（How to write to csv faster）](https://discourse.julialang.org/t/questions-about-csv-how-to-write-to-csv-faster/89247)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 10\
**Last updated:** [October 26, 2022, 6:21pm UTC](https://discourse.julialang.org/t/questions-about-csv-how-to-write-to-csv-faster/89247 "2022-10-26T18:21:32Z")

</div>

I have a huge dataframe which has 26M rows.How do I write it to a csv file faster and comsume fewer memories? julia\> pdpdpd=vcat(pd,pd,pd) 26590302×6 DataFrame Row │ chr position pdr discordant sum …

---

## [Instantiate does not instantiate?](https://discourse.julialang.org/t/instantiate-does-not-instantiate/89309)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [October 26, 2022, 5:56pm UTC](https://discourse.julialang.org/t/instantiate-does-not-instantiate/89309 "2022-10-26T17:56:29Z")

</div>

I’m playing with some student code, and the following is happening: while there is a Manifest.toml file and it seems to contain all the packages, instantiate does nothing: shell\> ls config.jl 'ddt\_polipart!.jl' …

---

## [Storing and parsing Dates.CompoundPeriod?](https://discourse.julialang.org/t/storing-and-parsing-dates-compoundperiod/89295)

<div class="topic-metadata">

**Author:** [@hacklint](https://discourse.julialang.org/u/hacklint)\
**Replies:** 5\
**Last updated:** [October 26, 2022, 5:34pm UTC](https://discourse.julialang.org/t/storing-and-parsing-dates-compoundperiod/89295 "2022-10-26T17:34:59Z")

</div>

Hi, In a small application I need to store and do simple arithmetics on durations (estimates and effort). So far the best option I have found seem to be Dates.CompoundPeriod, which works fine for now, providing additio…

---

## [Matt Parker's Crappy Python Challenge](https://discourse.julialang.org/t/matt-parkers-crappy-python-challenge/88970)

<div class="topic-metadata">

**Author:** [@HexSpin](https://discourse.julialang.org/u/HexSpin)\
**Replies:** 19\
**Last updated:** [October 26, 2022, 5:20pm UTC](https://discourse.julialang.org/t/matt-parkers-crappy-python-challenge/88970 "2022-10-26T17:20:55Z")

</div>

I found this amusing and perhaps you will too… and maybe someone with Julia will make their mark. (The scattergram does show a Julia competitor looking pretty good.)

---

## [Multiple Condition for DifferentialEquations callback](https://discourse.julialang.org/t/multiple-condition-for-differentialequations-callback/89308)

<div class="topic-metadata">

**Author:** [@pimler73](https://discourse.julialang.org/u/pimler73)\
**Replies:** 1\
**Last updated:** [October 26, 2022, 5:11pm UTC](https://discourse.julialang.org/t/multiple-condition-for-differentialequations-callback/89308 "2022-10-26T17:11:46Z")

</div>

I am solving an IVP with the DifferentialEquations package and I am looking to find n events with a specific condition. The issue rises from the fact that my events require 2 conditions to be satisfied. I am using Contin…

---

## [Wrapping methods used by multiple structs](https://discourse.julialang.org/t/wrapping-methods-used-by-multiple-structs/89311)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 0\
**Last updated:** [October 26, 2022, 5:04pm UTC](https://discourse.julialang.org/t/wrapping-methods-used-by-multiple-structs/89311 "2022-10-26T17:04:05Z")

</div>

For use running incremental statistics over windowed data, I have some structs that share struct-function-like methods. Here is an example that keeps track of the maximum value encountered as it runs over a windowed dat…

---

## [Getting Each Pixel Covered by a Bezier Curve](https://discourse.julialang.org/t/getting-each-pixel-covered-by-a-bezier-curve/89162)

<div class="topic-metadata">

**Author:** [@GameDungeon](https://discourse.julialang.org/u/GameDungeon)\
**Replies:** 4\
**Last updated:** [October 25, 2022, 10:24pm UTC](https://discourse.julialang.org/t/getting-each-pixel-covered-by-a-bezier-curve/89162 "2022-10-25T22:24:21Z")

</div>

For a project of mine, I have a bezier curve’s control points. I need to get the pixels that the curve passes over. I haven’t been able to find anything that does this and was wondering if any of you knew of something. T…

---

## [@turbo macro gives incorrect results](https://discourse.julialang.org/t/turbo-macro-gives-incorrect-results/89280)

<div class="topic-metadata">

**Author:** [@sidelkin](https://discourse.julialang.org/u/sidelkin)\
**Replies:** 4\
**Last updated:** [October 26, 2022, 3:53pm UTC](https://discourse.julialang.org/t/turbo-macro-gives-incorrect-results/89280 "2022-10-26T15:53:47Z")

</div>

I often use the @turbo macro for calculations. But I recently discovered that using it sometimes gives incorrect results. Below are minimal working examples where different options are compared. using LoopVectorization …

---

## [ComponentArrays vs LabelledArrays](https://discourse.julialang.org/t/componentarrays-vs-labelledarrays/67464)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 5\
**Last updated:** [October 26, 2022, 3:41pm UTC](https://discourse.julialang.org/t/componentarrays-vs-labelledarrays/67464 "2022-10-26T15:41:38Z")

</div>

I’ve been a user of ComponentArrays.jl for a while. Just recently discovered LabelledArrays.jl. They strike as very similar. Are there any fundamental differences between them? Just as example, this is the kind of use f…

---

## [Overlay Pie chart and scatter plot with CairoMakie](https://discourse.julialang.org/t/overlay-pie-chart-and-scatter-plot-with-cairomakie/88982)

<div class="topic-metadata">

**Author:** [@JJ\_DY](https://discourse.julialang.org/u/JJ_DY)\
**Replies:** 2\
**Last updated:** [October 26, 2022, 3:20pm UTC](https://discourse.julialang.org/t/overlay-pie-chart-and-scatter-plot-with-cairomakie/88982 "2022-10-26T15:20:17Z")

</div>

Hi Julia community, Do you know if there is a way to put multiple pie charts on an existing scatter plot based on the x y position? I am trying to create a figure like this with Makie but can’t get it to work. Thank v…

---

## [DataDrivenDiffEq package error](https://discourse.julialang.org/t/datadrivendiffeq-package-error/89303)

<div class="topic-metadata">

**Author:** [@BILEHGUELLEHSAHAL](https://discourse.julialang.org/u/BILEHGUELLEHSAHAL)\
**Replies:** 1\
**Last updated:** [October 26, 2022, 3:00pm UTC](https://discourse.julialang.org/t/datadrivendiffeq-package-error/89303 "2022-10-26T15:00:22Z")

</div>

Hello I am new in Julia and i would like your help on how to manage differents package that are compatible with differents versions. I found this error when using the DataDrivenDiffEq Pkg. Also note I’m using Julia 1.8. …

---

## [Problem with LoopVectorization : @turbo, LoopVectorization.check\_args](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963)

<div class="topic-metadata">

**Author:** [@Elyco](https://discourse.julialang.org/u/Elyco)\
**Replies:** 27\
**Last updated:** [October 26, 2022, 2:46pm UTC](https://discourse.julialang.org/t/problem-with-loopvectorization-turbo-loopvectorization-check-args/77963 "2022-10-26T14:46:50Z")

</div>

Hi, I’m trying to optimize a loop and I get a warning about \`LoopVectorization.check\_args\` on your inputs failed. Here is my MWE: psi = rand(ComplexF64,4,4) dpsi = zeros(ComplexF64,4,4) function test\_turbo(dpsi::Arr…

---

## [What is a custom mark function supposed to return?](https://discourse.julialang.org/t/what-is-a-custom-mark-function-supposed-to-return/87877)

<div class="topic-metadata">

**Author:** [@Taaitaaiger](https://discourse.julialang.org/u/Taaitaaiger)\
**Replies:** 1\
**Last updated:** [October 26, 2022, 2:44pm UTC](https://discourse.julialang.org/t/what-is-a-custom-mark-function-supposed-to-return/87877 "2022-10-26T14:44:33Z")

</div>

You can create foreign types that have custom mark and sweep functions with jl\_new\_foreign\_type. The custom mark function must return a uintptr\_t, but it’s undocumented what should be returned exactly. The custom mark i…

---

## [Passing userdata to solver](https://discourse.julialang.org/t/passing-userdata-to-solver/89289)

<div class="topic-metadata">

**Author:** [@Schlabonski](https://discourse.julialang.org/u/Schlabonski)\
**Replies:** 1\
**Last updated:** [October 26, 2022, 10:40am UTC](https://discourse.julialang.org/t/passing-userdata-to-solver/89289 "2022-10-26T10:40:09Z")

</div>

Hi there, I’m using DifferentialEquations.jl to simulate collisions between particles. When one particle leaves a defined volume I want to reseed it randomly until a certain number of collisions is reached. My code from…

---

## [Tracking down a dyld error on apple silicon](https://discourse.julialang.org/t/tracking-down-a-dyld-error-on-apple-silicon/89240)

<div class="topic-metadata">

**Author:** [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)\
**Replies:** 0\
**Last updated:** [October 25, 2022, 8:22am UTC](https://discourse.julialang.org/t/tracking-down-a-dyld-error-on-apple-silicon/89240 "2022-10-25T08:22:04Z")

</div>

Hello Julians, I am trying to track down a dyld error on Apple Silicon when using the UMAP.jl package. Under rosetta it works perfectly well, but in 1.8.2 (native) I get the following error when add-ing and then test-in…

---

## [Seek help on an error of PackageCompiler](https://discourse.julialang.org/t/seek-help-on-an-error-of-packagecompiler/89232)

<div class="topic-metadata">

**Author:** [@lionisxn](https://discourse.julialang.org/u/lionisxn)\
**Replies:** 1\
**Last updated:** [October 26, 2022, 7:02am UTC](https://discourse.julialang.org/t/seek-help-on-an-error-of-packagecompiler/89232 "2022-10-26T07:02:36Z")

</div>

I’m using Julia 1.8.2, and I want to create a C shared dynamic library from my package by “create\_library(sourPkg, “lib”; lib\_name = “lib”, header\_files = \[“headfile.h”\], force = true, incremental = false, filter\_stdlibs…

---

## [How usable is Julia for NLP related ML tasks?](https://discourse.julialang.org/t/how-usable-is-julia-for-nlp-related-ml-tasks/89270)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 0\
**Last updated:** [October 26, 2022, 5:59am UTC](https://discourse.julialang.org/t/how-usable-is-julia-for-nlp-related-ml-tasks/89270 "2022-10-26T05:59:09Z")

</div>

I am looking to implement the following paper in Julia ( 2018\_commonsense\_ZhouHao\_3\_TYVQ7Iq.pdf (tsinghua.edu.cn)) . It has an existing TensorFlow implementation on a very old TensorFlow version, so I felt it would be ni…

---

## [Replacing grep, sed, awk scripts with Julia](https://discourse.julialang.org/t/replacing-grep-sed-awk-scripts-with-julia/16014)

<div class="topic-metadata">

**Author:** [@FemtoTrader](https://discourse.julialang.org/u/FemtoTrader)\
**Replies:** 16\
**Last updated:** [October 26, 2022, 2:56am UTC](https://discourse.julialang.org/t/replacing-grep-sed-awk-scripts-with-julia/16014 "2022-10-26T02:56:57Z")

</div>

Hello, I have always considered grep, sed, awk scripts very difficult to read. I wonder if someone have try to build a tutorial and tools to move from this kind of tools to a proper script language such as Julia. Pyth…

---

## [Scaling Big Ints? Rounding?](https://discourse.julialang.org/t/scaling-big-ints-rounding/89257)

<div class="topic-metadata">

**Author:** [@theboiwholived](https://discourse.julialang.org/u/theboiwholived)\
**Replies:** 8\
**Last updated:** [October 26, 2022, 2:44am UTC](https://discourse.julialang.org/t/scaling-big-ints-rounding/89257 "2022-10-26T02:44:45Z")

</div>

Hey guys i have a unique problem. I ingest raw hex data println(key.second\["hex"\]) println(parse(BigInt, key.second\["hex"\]) ) println(floor(BigInt, parse(BigInt, key.secon…

---

## [Fastest way to negate some booleans in an array](https://discourse.julialang.org/t/fastest-way-to-negate-some-booleans-in-an-array/89261)

<div class="topic-metadata">

**Author:** [@HMegh](https://discourse.julialang.org/u/HMegh)\
**Replies:** 10\
**Last updated:** [October 26, 2022, 12:28am UTC](https://discourse.julialang.org/t/fastest-way-to-negate-some-booleans-in-an-array/89261 "2022-10-26T00:28:31Z")

</div>

Hi, I am trying to optimize a code for a number theory side project. Currently, I have a large vector of booleans, say A=rand(Bool,10^8) I want to negate all the even-index terms. One possible way that I have found is …

---

## [Symply.jl for getting coefficients for all combination of the variables of a multivariable polynomial](https://discourse.julialang.org/t/symply-jl-for-getting-coefficients-for-all-combination-of-the-variables-of-a-multivariable-polynomial/89091)

<div class="topic-metadata">

**Author:** [@xyli](https://discourse.julialang.org/u/xyli)\
**Replies:** 16\
**Last updated:** [October 25, 2022, 10:01pm UTC](https://discourse.julialang.org/t/symply-jl-for-getting-coefficients-for-all-combination-of-the-variables-of-a-multivariable-polynomial/89091 "2022-10-25T22:01:10Z")

</div>

Dear all, Does anyone know how to get coefficients for ALL combination of the variables of a multivariable polynomial using sympy.jl or other Julia package for symbolic computation? Here is an example from MATLAB, sym…

---

## [Custom error to check stochastic matrix](https://discourse.julialang.org/t/custom-error-to-check-stochastic-matrix/89259)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 5\
**Last updated:** [October 25, 2022, 8:46pm UTC](https://discourse.julialang.org/t/custom-error-to-check-stochastic-matrix/89259 "2022-10-25T20:46:54Z")

</div>

I would like to write a function that checks whether the rows of a stochastic matrix sum to 1 and throws an error if they do not. The following code works for a check by hand: sum(mat,dims = 2) But this code does not …

---

## [Fixing type stability involving functions](https://discourse.julialang.org/t/fixing-type-stability-involving-functions/89258)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 1\
**Last updated:** [October 25, 2022, 7:48pm UTC](https://discourse.julialang.org/t/fixing-type-stability-involving-functions/89258 "2022-10-25T19:48:46Z")

</div>

I have the following codes using Parameters function spatiotemporal(x, t, a\_coefs::AbstractMatrix, b\_coefs::AbstractMatrix) ns = size(a\_coefs,1) - 1 nt = Int((size(a\_coefs,2) - 1)/2) c = zero(eltype(a\_coe…

---

## [Reduce allocations (increase the running speed) for large scale ODEs (136 equations)](https://discourse.julialang.org/t/reduce-allocations-increase-the-running-speed-for-large-scale-odes-136-equations/89253)

<div class="topic-metadata">

**Author:** [@xspeng](https://discourse.julialang.org/u/xspeng)\
**Replies:** 3\
**Last updated:** [October 25, 2022, 6:54pm UTC](https://discourse.julialang.org/t/reduce-allocations-increase-the-running-speed-for-large-scale-odes-136-equations/89253 "2022-10-25T18:54:31Z")

</div>

Hi, I am wondering how to improve the speed of large scale ODEs, which includes 136 equations. I already use the staticarray, and for loop instead of broadcast to speed up the program and it’s already 10 times faster tha…

---

## [Signal (11): Segmentation fault when launching MATLAB process](https://discourse.julialang.org/t/signal-11-segmentation-fault-when-launching-matlab-process/89250)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 3\
**Last updated:** [October 25, 2022, 4:54pm UTC](https://discourse.julialang.org/t/signal-11-segmentation-fault-when-launching-matlab-process/89250 "2022-10-25T16:54:08Z")

</div>

I am trying to call MATLAB from julia, but I get a segmentation fault: julia\> using MATLAB │ Package MATLAB not found, but a package named MATLAB is available from a │ registry. │ Install package? │ (@v1.8) pkg\> …

---

## [Modify PlotlyJS-Templates](https://discourse.julialang.org/t/modify-plotlyjs-templates/89251)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 2\
**Last updated:** [October 25, 2022, 3:36pm UTC](https://discourse.julialang.org/t/modify-plotlyjs-templates/89251 "2022-10-25T15:36:10Z")

</div>

In the current documentation for PlotlyJS the description how to modify available Styles/Templates is outdated :frowning: This is a known issue: Style() not defined Based on the information in this thread I experimente…

---

## [Filtering DataFrame based on two conditions](https://discourse.julialang.org/t/filtering-dataframe-based-on-two-conditions/89248)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 1\
**Last updated:** [October 25, 2022, 1:23pm UTC](https://discourse.julialang.org/t/filtering-dataframe-based-on-two-conditions/89248 "2022-10-25T13:23:19Z")

</div>

Hi everyone, I am trying to filter a dataset based on two conditions but it does not allow me to do so unless I write an auxiliary function which in my case is now worth it. Is there not a way to do the following in a …

---

## [Calculating normal to any arbitary surface](https://discourse.julialang.org/t/calculating-normal-to-any-arbitary-surface/89194)

<div class="topic-metadata">

**Author:** [@Jyoti\_Sharma](https://discourse.julialang.org/u/Jyoti_Sharma)\
**Replies:** 7\
**Last updated:** [October 25, 2022, 12:54pm UTC](https://discourse.julialang.org/t/calculating-normal-to-any-arbitary-surface/89194 "2022-10-25T12:54:03Z")

</div>

Hello, I am looking to calculate normal (pointing outwards) at each point of a curve. I want to know if there is any Julia package to perform this action.I am using the Forward gradient package to calculate the gradient…

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

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