# General Usage

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

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

**Page:** 733

---

## [How do I create syntactic sugar for Julia functions?](https://discourse.julialang.org/t/how-do-i-create-syntactic-sugar-for-julia-functions/42312)

<div class="topic-metadata">

**Author:** [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Replies:** 19\
**Last updated:** [July 1, 2020, 3:18am UTC](https://discourse.julialang.org/t/how-do-i-create-syntactic-sugar-for-julia-functions/42312 "2020-07-01T03:18:57Z")

</div>

For example, if I have a function “f(x, y)” and want to abbreviate it with “x S y”, how can it be done?

---

## [Multiple 2D plots with both axes logarithmically scaled](https://discourse.julialang.org/t/multiple-2d-plots-with-both-axes-logarithmically-scaled/42333)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 1\
**Last updated:** [July 1, 2020, 4:44am UTC](https://discourse.julialang.org/t/multiple-2d-plots-with-both-axes-logarithmically-scaled/42333 "2020-07-01T04:44:42Z")

</div>

I’m doing some error analysis and it would be handy if I could display errors with both axes scaled logarithmically in multiple separate plot windows. See, I have four vectors (diffc1, diffc2, diffc3, diffc4) containing …

---

## [Types of arguments within functions](https://discourse.julialang.org/t/types-of-arguments-within-functions/42337)

<div class="topic-metadata">

**Author:** [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Replies:** 4\
**Last updated:** [July 1, 2020, 4:32am UTC](https://discourse.julialang.org/t/types-of-arguments-within-functions/42337 "2020-07-01T04:32:09Z")

</div>

I have writing a function where both arguments can either be an array of Bool, Int64, and String values. I would prefer not to specify both arguments (less space) but rather substitute a substitute Type something like th…

---

## [JuliaDB signal (11) segmentation fault](https://discourse.julialang.org/t/juliadb-signal-11-segmentation-fault/41604)

<div class="topic-metadata">

**Author:** [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Replies:** 3\
**Last updated:** [July 1, 2020, 3:17am UTC](https://discourse.julialang.org/t/juliadb-signal-11-segmentation-fault/41604 "2020-07-01T03:17:05Z")

</div>

I have been using JuliaDB for the past two months trying to transition from R. I recently updated packages using a source-compiled version of the stable Julia release (1.4.2) with the Intel MKL libraries and I have been …

---

## ["Merge" environments](https://discourse.julialang.org/t/merge-environments/19742)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 2\
**Last updated:** [July 1, 2020, 2:22am UTC](https://discourse.julialang.org/t/merge-environments/19742 "2020-07-01T02:22:38Z")

</div>

I have a Project+Manifest file and I would like to add packages as specified by the Manifest file into into another environment (say the global one). Is this possible?

---

## [Manual overide with Registry commit error](https://discourse.julialang.org/t/manual-overide-with-registry-commit-error/42330)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 1\
**Last updated:** [July 1, 2020, 2:14am UTC](https://discourse.julialang.org/t/manual-overide-with-registry-commit-error/42330 "2020-07-01T02:14:45Z")

</div>

Hi, I need someone to manually review my pull request on the General Registry https://github.com/JuliaRegistries/General/pull/17272 Would be good to get fixed as soon as possible, since this dependency is needed.

---

## [Downgrade a package without version number?](https://discourse.julialang.org/t/downgrade-a-package-without-version-number/42324)

<div class="topic-metadata">

**Author:** [@Ken\_Lin](https://discourse.julialang.org/u/Ken_Lin)\
**Replies:** 1\
**Last updated:** [June 30, 2020, 11:03pm UTC](https://discourse.julialang.org/t/downgrade-a-package-without-version-number/42324 "2020-06-30T23:03:53Z")

</div>

Hi, I’m using a package cloned from github in Julia 1.3.1 The owner of the package updated the code recently. I would like to try the new version, but since there is no corresponding version number, I wonder if it is po…

---

## [How to subtype a type alias?](https://discourse.julialang.org/t/how-to-subtype-a-type-alias/24050)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 13\
**Last updated:** [June 30, 2020, 9:42pm UTC](https://discourse.julialang.org/t/how-to-subtype-a-type-alias/24050 "2020-06-30T21:42:01Z")

</div>

Hello everyone, I have a struct: struct MyType data :: Int end Now I want to create a vector of such structs: const MyVector = Vector{MyType} This works fine because I can make methods that dispatch on MyVector. …

---

## [Function variable scope in IJulia Jupyter notebook](https://discourse.julialang.org/t/function-variable-scope-in-ijulia-jupyter-notebook/41792)

<div class="topic-metadata">

**Author:** [@Ken\_Lin](https://discourse.julialang.org/u/Ken_Lin)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 8:17pm UTC](https://discourse.julialang.org/t/function-variable-scope-in-ijulia-jupyter-notebook/41792 "2020-06-30T20:17:39Z")

</div>

I’m using IJulia Jupyter notebook with Julia 1.3.1 Say I define the following function: function r(x) @show b @show a a = 1+x+b return a end And if I run the code below: a = 5 b = 4 r(1) I will get …

---

## [Fast iteration over rows of a DataFrame](https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 14\
**Last updated:** [June 30, 2020, 3:20pm UTC](https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612 "2020-06-30T15:20:56Z")

</div>

I want to read a CSV file and do some path-dependent calculations involving multiple columns (i.e., no vectorization allowed in the actual problem.) I was surprised to see that in a simple example, DataFrames introduce …

---

## [Can't Convert 'Nothing' to 'Missing'](https://discourse.julialang.org/t/cant-convert-nothing-to-missing/42303)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 4\
**Last updated:** [June 30, 2020, 2:20pm UTC](https://discourse.julialang.org/t/cant-convert-nothing-to-missing/42303 "2020-06-30T14:20:40Z")

</div>

There has been a bit of discussion on here about ‘nothing’ vs ‘missing’ and why both are needed. I don’t really have an opinion on this as long as I can easily convert, which I can’t. I tried the suggestion on Github …

---

## [Why does this allocate?](https://discourse.julialang.org/t/why-does-this-allocate/42298)

<div class="topic-metadata">

**Author:** [@cafaxo](https://discourse.julialang.org/u/cafaxo)\
**Replies:** 4\
**Last updated:** [June 30, 2020, 12:23pm UTC](https://discourse.julialang.org/t/why-does-this-allocate/42298 "2020-06-30T12:23:42Z")

</div>

Consider the following code: function foo(x) if x\[1\] \> 0 (x, 1) else nothing end end It seems that this code has 1 allocation: julia\> bla = \[1\] 1-element Array{Int64,1}: 1 julia\> @time f…

---

## [Unitful: how to restrict units to specific dimension](https://discourse.julialang.org/t/unitful-how-to-restrict-units-to-specific-dimension/42295)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 11:29am UTC](https://discourse.julialang.org/t/unitful-how-to-restrict-units-to-specific-dimension/42295 "2020-06-30T11:29:40Z")

</div>

Hello everyone, My question is very similar to How To Properly Use Unitful. I would like to make a function that is similar to uconvert in that its first argument is a unit of dimension length: f1(unit :: ??) = unit W…

---

## [Function returning normalized vector and norm](https://discourse.julialang.org/t/function-returning-normalized-vector-and-norm/42285)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 9\
**Last updated:** [June 30, 2020, 9:15am UTC](https://discourse.julialang.org/t/function-returning-normalized-vector-and-norm/42285 "2020-06-30T09:15:50Z")

</div>

Does the standard library have a function equivalent to the following? function norm\_normalize(v, p = 2) n = norm(v,p) return n, v/n end If not, is there a reason why such a function does not exist? And finall…

---

## [Metaprogamming](https://discourse.julialang.org/t/metaprogamming/42286)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 5\
**Last updated:** [June 30, 2020, 6:38am UTC](https://discourse.julialang.org/t/metaprogamming/42286 "2020-06-30T06:38:50Z")

</div>

Hi there, I am writing a module with dozens of MyType like structure (as below), that all belong to an Abstract super type. I would like to be able to write a meta constructor (roughly sketched below). Is it possible? s…

---

## [What causes data movement when using remotecall\_fetch?](https://discourse.julialang.org/t/what-causes-data-movement-when-using-remotecall-fetch/42279)

<div class="topic-metadata">

**Author:** [@xtt](https://discourse.julialang.org/u/xtt)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 5:05am UTC](https://discourse.julialang.org/t/what-causes-data-movement-when-using-remotecall-fetch/42279 "2020-06-30T05:05:55Z")

</div>

Hi, I read the section Data Movement and Global variables to understand when data is being transferred between processes. Still, I need some help here. I try to define a global data on the main process, send this data …

---

## [Is possible to enabled an option so that type-instable functions will throw an error?](https://discourse.julialang.org/t/is-possible-to-enabled-an-option-so-that-type-instable-functions-will-throw-an-error/42278)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [June 30, 2020, 2:50am UTC](https://discourse.julialang.org/t/is-possible-to-enabled-an-option-so-that-type-instable-functions-will-throw-an-error/42278 "2020-06-30T02:50:39Z")

</div>

I wonder if it’s possible run a function so that after running the function, all type instable functions will throw error, e.g. it looks into the @code\_warntypes, detects if there are any Any and throw an error it does? …

---

## [Comparing Julia Performance to CLI Program](https://discourse.julialang.org/t/comparing-julia-performance-to-cli-program/42280)

<div class="topic-metadata">

**Author:** [@mtsch](https://discourse.julialang.org/u/mtsch)\
**Replies:** 0\
**Last updated:** [June 30, 2020, 2:22am UTC](https://discourse.julialang.org/t/comparing-julia-performance-to-cli-program/42280 "2020-06-30T02:22:01Z")

</div>

Hi, I have written a Julia package that is based on an algorithm that is used by a CLI program. I’m trying to perform some benchmarks to see where I stand. I want to eventually publish the results, so I want to make sur…

---

## [Haskey is deprecated, use Target instead](https://discourse.julialang.org/t/haskey-is-deprecated-use-target-instead/42273)

<div class="topic-metadata">

**Author:** [@deveshjawla](https://discourse.julialang.org/u/deveshjawla)\
**Replies:** 1\
**Last updated:** [June 29, 2020, 11:28pm UTC](https://discourse.julialang.org/t/haskey-is-deprecated-use-target-instead/42273 "2020-06-29T23:28:23Z")

</div>

I get this warning ever since I added CUDA.jl. How to make sense of a warning in Julia?

---

## [Seeking recommended dashboard Julia packages](https://discourse.julialang.org/t/seeking-recommended-dashboard-julia-packages/42253)

<div class="topic-metadata">

**Author:** [@hafez\_ahmad](https://discourse.julialang.org/u/hafez_ahmad)\
**Replies:** 4\
**Last updated:** [June 29, 2020, 6:43pm UTC](https://discourse.julialang.org/t/seeking-recommended-dashboard-julia-packages/42253 "2020-06-29T18:43:03Z")

</div>

seeking recommended dashboard Julia packages. I know python Plotly dashboard and R shiny dashboard are suitable for me. but I am trying to move into Julia. I am trying to make geospatial dashboards .for example, I will …

---

## [Flux's model-zoo CIFAR10 example saturates 8GB gpu](https://discourse.julialang.org/t/fluxs-model-zoo-cifar10-example-saturates-8gb-gpu/42244)

<div class="topic-metadata">

**Author:** [@natema](https://discourse.julialang.org/u/natema)\
**Replies:** 5\
**Last updated:** [June 29, 2020, 4:35pm UTC](https://discourse.julialang.org/t/fluxs-model-zoo-cifar10-example-saturates-8gb-gpu/42244 "2020-06-29T16:35:07Z")

</div>

Running the Flux’s model-zoo CIFAR10 example seems to saturate the 8GB memory of my Quadro RTX 4000: \[ Info: CUDA is on \[ Info: Constructing Model \[ Info: Training.... \[ Info: Epoch 1 ┌ Warning: \`Target(triple::String)\`…

---

## [Plotting a timeline?](https://discourse.julialang.org/t/plotting-a-timeline/42254)

<div class="topic-metadata">

**Author:** [@Valentine\_GRAND](https://discourse.julialang.org/u/Valentine_GRAND)\
**Replies:** 3\
**Last updated:** [June 29, 2020, 4:01pm UTC](https://discourse.julialang.org/t/plotting-a-timeline/42254 "2020-06-29T16:01:04Z")

</div>

Hi everyone, Do you know how i could plot a timeline like this : \[Creating a timeline with lines, dates, and text — Matplotlib 3.1.3 documentation\] Or at least wich package do you recommend ? Thank you Valentine

---

## [Another post on package compilation time](https://discourse.julialang.org/t/another-post-on-package-compilation-time/42015)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 14\
**Last updated:** [June 29, 2020, 2:27pm UTC](https://discourse.julialang.org/t/another-post-on-package-compilation-time/42015 "2020-06-29T14:27:40Z")

</div>

Let me start by saying I’m very new to issues regarding compilation. (I never heard of compilation when I used Matlab-R-STATA.) Suppose I load a Julia package AAA.jl with one function f(x,y) . The first time I call f(…

---

## [Are let blocks as fast as functions?](https://discourse.julialang.org/t/are-let-blocks-as-fast-as-functions/42115)

<div class="topic-metadata">

**Author:** [@jfan](https://discourse.julialang.org/u/jfan)\
**Replies:** 11\
**Last updated:** [June 29, 2020, 2:27pm UTC](https://discourse.julialang.org/t/are-let-blocks-as-fast-as-functions/42115 "2020-06-29T14:27:33Z")

</div>

Based on reading this discussion and having to write a large script (I prefer script files), I find that using functions for “for loops” is a pain in my application. Since the matrices I’m dealing with are very large (~ …

---

## [Non-allocating views](https://discourse.julialang.org/t/non-allocating-views/42249)

<div class="topic-metadata">

**Author:** [@codebilly](https://discourse.julialang.org/u/codebilly)\
**Replies:** 2\
**Last updated:** [June 29, 2020, 1:36pm UTC](https://discourse.julialang.org/t/non-allocating-views/42249 "2020-06-29T13:36:47Z")

</div>

I recently installed Julia Version 1.5.0-beta1.0 and I was impressed with the non-allocating views. I just tried an example of LU factorisation written in vectorised style to get a feel for it, and the performance compa…

---

## [Changes in the Plots/GraphRecipes packages?](https://discourse.julialang.org/t/changes-in-the-plots-graphrecipes-packages/42246)

<div class="topic-metadata">

**Author:** [@Valentine\_GRAND](https://discourse.julialang.org/u/Valentine_GRAND)\
**Replies:** 2\
**Last updated:** [June 29, 2020, 1:21pm UTC](https://discourse.julialang.org/t/changes-in-the-plots-graphrecipes-packages/42246 "2020-06-29T13:21:38Z")

</div>

Hello everyone, In the documentation of Plot/GraphRecipes (http://docs.juliaplots.org/latest/graphrecipes/examples/#graph\_examples-1) you can find this example: using GraphRecipes, Plots g = \[0 1 1; 0 0 1; 0 1 0\] …

---

## [Creating a graph out of a string list?](https://discourse.julialang.org/t/creating-a-graph-out-of-a-string-list/42233)

<div class="topic-metadata">

**Author:** [@Valentine\_GRAND](https://discourse.julialang.org/u/Valentine_GRAND)\
**Replies:** 6\
**Last updated:** [June 29, 2020, 8:58am UTC](https://discourse.julialang.org/t/creating-a-graph-out-of-a-string-list/42233 "2020-06-29T08:58:25Z")

</div>

Hello everyone, This is my first post here, I hope I’m going to do it right and it’s the right place to post it :slight\_smile: Here’s my problem, I have a list of string: \[" 'DataManager' ", " 'LauncherFrame' ", " '…

---

## [Undefined /out of scope](https://discourse.julialang.org/t/undefined-out-of-scope/42188)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 10\
**Last updated:** [June 29, 2020, 6:19am UTC](https://discourse.julialang.org/t/undefined-out-of-scope/42188 "2020-06-29T06:19:05Z")

</div>

Hello all, I have been developing a code that executes a function using an array and now the problem started to happen when I put that function in a loop…I get the message saying that the array is not defined… I wrote t…

---

## [Why DataFrames v.0.21.2 (julia v1.4.2) requires more memory than the previous version](https://discourse.julialang.org/t/why-dataframes-v-0-21-2-julia-v1-4-2-requires-more-memory-than-the-previous-version/41171)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 22\
**Last updated:** [June 29, 2020, 2:45am UTC](https://discourse.julialang.org/t/why-dataframes-v-0-21-2-julia-v1-4-2-requires-more-memory-than-the-previous-version/41171 "2020-06-29T02:45:50Z")

</div>

I’ve updated to DataFrame v.0.21.2 and Julia ver 1.4.2. Try to load CSV file (9GB), as result 32 GB Ram is not enough. Is it reasonable? Why DataFrames consume so much memory?

---

## [Optional processor flags in jll packages](https://discourse.julialang.org/t/optional-processor-flags-in-jll-packages/42215)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 1\
**Last updated:** [June 29, 2020, 12:03am UTC](https://discourse.julialang.org/t/optional-processor-flags-in-jll-packages/42215 "2020-06-29T00:03:42Z")

</div>

I’m building a jll package of a c library. The library has some processor specific configuration flags, namely setting AVX512 for processors that support it. Is it possible to generate several versions (e.g. with/withou…

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

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