# General Usage

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

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

**Page:** 537

---

## [What wrong ? ERROR: UndefVarError: Gray not defined](https://discourse.julialang.org/t/what-wrong-error-undefvarerror-gray-not-defined/69503)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 1\
**Last updated:** [October 10, 2021, 8:33am UTC](https://discourse.julialang.org/t/what-wrong-error-undefvarerror-gray-not-defined/69503 "2021-10-10T08:33:12Z")

</div>

julia\> imagestrip(image::Matrix{\<:Gray}) = Float32.(reshape(image, :)) ERROR: UndefVarError: Gray not defined Stacktrace: \[1\] top-level scope @ REPL\[43\]:1 All code :Recognize Handwriting Using an Artificial Neural N…

---

## [Export very large dataframe](https://discourse.julialang.org/t/export-very-large-dataframe/69229)

<div class="topic-metadata">

**Author:** [@bojusemo](https://discourse.julialang.org/u/bojusemo)\
**Replies:** 10\
**Last updated:** [October 10, 2021, 8:34am UTC](https://discourse.julialang.org/t/export-very-large-dataframe/69229 "2021-10-10T08:34:17Z")

</div>

Hi guys, May someone tell me please how to export a 6G dataframe with 200 million rows and 4 columns? I am using the CSV.write function of the CSV package, but it just exports part of the table. I think it is because th…

---

## [How to do http request to get the whole source page when part of html loaded by javascript?](https://discourse.julialang.org/t/how-to-do-http-request-to-get-the-whole-source-page-when-part-of-html-loaded-by-javascript/69501)

<div class="topic-metadata">

**Author:** [@wuxinyu](https://discourse.julialang.org/u/wuxinyu)\
**Replies:** 0\
**Last updated:** [October 10, 2021, 6:30am UTC](https://discourse.julialang.org/t/how-to-do-http-request-to-get-the-whole-source-page-when-part-of-html-loaded-by-javascript/69501 "2021-10-10T06:30:25Z")

</div>

I wait to get the html web page from https://www.collinsdictionary.com/dictionary/english/supremacy, but part of the html file is loaded by javascript. When I use HTTP.jl to get the web page with HTTP.request(), I only g…

---

## [Pkg.test() fails if isdir(tempdir()) == false](https://discourse.julialang.org/t/pkg-test-fails-if-isdir-tempdir-false/69486)

<div class="topic-metadata">

**Author:** [@josePereiro](https://discourse.julialang.org/u/josePereiro)\
**Replies:** 3\
**Last updated:** [October 10, 2021, 4:33am UTC](https://discourse.julialang.org/t/pkg-test-fails-if-isdir-tempdir-false/69486 "2021-10-10T04:33:15Z")

</div>

Hi, Im have some tests which delete the tempdir() folder before exiting. They works perfectly. But, the problem is that if I call the tests again in the same process (e.g. using a REPL) the tests engine (Pkg) fails. Is t…

---

## [What is "default" in this Pluto notebook on JuliaHub?](https://discourse.julialang.org/t/what-is-default-in-this-pluto-notebook-on-juliahub/66033)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 1\
**Last updated:** [October 9, 2021, 10:33pm UTC](https://discourse.julialang.org/t/what-is-default-in-this-pluto-notebook-on-juliahub/66033 "2021-10-09T22:33:09Z")

</div>

What does “default” mean in the screenshot below? It’s the only option in the drop-down.

---

## [Julian way to do strptime?](https://discourse.julialang.org/t/julian-way-to-do-strptime/20492)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 8\
**Last updated:** [October 9, 2021, 9:28pm UTC](https://discourse.julialang.org/t/julian-way-to-do-strptime/20492 "2021-10-09T21:28:46Z")

</div>

I’m converting an R script that uses strptime to extact datetime data from strings. Is there a more Julian way of doing this than calling Base.Libc.strptime? I’m not very familiar with either string or date handling in …

---

## [Metaprogramming first steps](https://discourse.julialang.org/t/metaprogramming-first-steps/69475)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 4\
**Last updated:** [October 9, 2021, 8:35pm UTC](https://discourse.julialang.org/t/metaprogramming-first-steps/69475 "2021-10-09T20:35:01Z")

</div>

\# Hello, i have a struct and i want to get with a macro a class builder and # constructor Foo, like this: # i have struct Foo a::Int64 b::Int64 c::Any d::String e::Union{Nothing,Foo} # ... …

---

## [Why this code can't annote all heatmap cells?](https://discourse.julialang.org/t/why-this-code-cant-annote-all-heatmap-cells/69431)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 4\
**Last updated:** [October 9, 2021, 6:54pm UTC](https://discourse.julialang.org/t/why-this-code-cant-annote-all-heatmap-cells/69431 "2021-10-09T18:54:48Z")

</div>

Hello, good morning. I’m trying o annotate a heatmap, but the labels are going wrong in the map as the figure below shows May someone help? source using Plots week\_day = randn(24, 5); xlabel = \["Mon", "Tue", "Wed…

---

## [\[PSA\] The new version of libgit2-1.2 resurrects the old "invalid-proxy" problem](https://discourse.julialang.org/t/psa-the-new-version-of-libgit2-1-2-resurrects-the-old-invalid-proxy-problem/69457)

<div class="topic-metadata">

**Author:** [@dalejordan](https://discourse.julialang.org/u/dalejordan)\
**Replies:** 2\
**Last updated:** [October 9, 2021, 5:47pm UTC](https://discourse.julialang.org/t/psa-the-new-version-of-libgit2-1-2-resurrects-the-old-invalid-proxy-problem/69457 "2021-10-09T17:47:49Z")

</div>

https://github.com/JuliaLang/julia/issues/33111 This time the problem seems to crop up on local packages. The problem goes away when downgrading to libgit2 v1.1. The problem has been reported on the Rust tracker also…

---

## [Fast random number generator for RGBs](https://discourse.julialang.org/t/fast-random-number-generator-for-rgbs/52035)

<div class="topic-metadata">

**Author:** [@boroboro77](https://discourse.julialang.org/u/boroboro77)\
**Replies:** 11\
**Last updated:** [October 9, 2021, 5:43pm UTC](https://discourse.julialang.org/t/fast-random-number-generator-for-rgbs/52035 "2021-10-09T17:43:10Z")

</div>

I would like to generate very fast pseudo random images. The quality of the random numbers to generate random RGBs are not very important to be completely independent. But they sould look “random” for a human eye. Is th…

---

## [Pluto precompile failure](https://discourse.julialang.org/t/pluto-precompile-failure/69471)

<div class="topic-metadata">

**Author:** [@evad](https://discourse.julialang.org/u/evad)\
**Replies:** 0\
**Last updated:** [October 9, 2021, 11:01am UTC](https://discourse.julialang.org/t/pluto-precompile-failure/69471 "2021-10-09T11:01:18Z")

</div>

Hi, while normal updating the packages, I have the following error for Pluto. How can I correct this: ERROR: The following 1 direct dependency failed to precompile: Pluto \[c3e4b0f8-55cb-11ea-2926-15256bba5781\] Failed…

---

## [Use of CachingPool's for a pmap that will be run many times](https://discourse.julialang.org/t/use-of-cachingpools-for-a-pmap-that-will-be-run-many-times/69462)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 0\
**Last updated:** [October 9, 2021, 4:12am UTC](https://discourse.julialang.org/t/use-of-cachingpools-for-a-pmap-that-will-be-run-many-times/69462 "2021-10-09T04:12:06Z")

</div>

Hi! I’m writing a custom linear map using LinearMaps.jl whose matrix-vector product I would like to embarassingly parallelize. The point is that this linear map will be used tens of thousands of times during an iterative…

---

## [Registered new release still pointing to old version](https://discourse.julialang.org/t/registered-new-release-still-pointing-to-old-version/69454)

<div class="topic-metadata">

**Author:** [@Johncowk](https://discourse.julialang.org/u/Johncowk)\
**Replies:** 6\
**Last updated:** [October 9, 2021, 2:40am UTC](https://discourse.julialang.org/t/registered-new-release-still-pointing-to-old-version/69454 "2021-10-09T02:40:57Z")

</div>

I registered a new version of a package, and the pull request was merged but when I install the package via \`\`Pkg.add\`\`\`, the old version is installed. Why is this so and how can I fix it?

---

## [Symbolics.jl bootstrapping a beginner](https://discourse.julialang.org/t/symbolics-jl-bootstrapping-a-beginner/68674)

<div class="topic-metadata">

**Author:** [@banksiaboy](https://discourse.julialang.org/u/banksiaboy)\
**Replies:** 16\
**Last updated:** [October 8, 2021, 11:47pm UTC](https://discourse.julialang.org/t/symbolics-jl-bootstrapping-a-beginner/68674 "2021-10-08T23:47:14Z")

</div>

I’d like to be able to follow along my process of learning geometric algebra from scratch using Symbolics.jl I like how I’ve seen multiple-dispatch allow symbolic expressions to travel through standard libraries. I am a…

---

## [How to register breaking changes?](https://discourse.julialang.org/t/how-to-register-breaking-changes/69451)

<div class="topic-metadata">

**Author:** [@Johncowk](https://discourse.julialang.org/u/Johncowk)\
**Replies:** 7\
**Last updated:** [October 8, 2021, 10:31pm UTC](https://discourse.julialang.org/t/how-to-register-breaking-changes/69451 "2021-10-08T22:31:21Z")

</div>

I made some breaking changes to one of my package and consequently incremented the version number of 0.1 instead of 0.0.1, but this is not recognized as such by the bot so now my pull request has to be merged manually. W…

---

## [What does Dict{T} mean?](https://discourse.julialang.org/t/what-does-dict-t-mean/69455)

<div class="topic-metadata">

**Author:** [@Alex\_Tantos](https://discourse.julialang.org/u/Alex_Tantos)\
**Replies:** 4\
**Last updated:** [October 8, 2021, 10:07pm UTC](https://discourse.julialang.org/t/what-does-dict-t-mean/69455 "2021-10-08T22:07:54Z")

</div>

Hi! Here is the tiny project I have in mind so that I get my hands a bit dirty. I would like to extend the functionality of StatsBase.countmap() so that is accepts the Dictionary type aside from the Dict inbuilt data ty…

---

## [Matrix Multiplication 10x+ Speedup](https://discourse.julialang.org/t/matrix-multiplication-10x-speedup/69452)

<div class="topic-metadata">

**Author:** [@laut](https://discourse.julialang.org/u/laut)\
**Replies:** 1\
**Last updated:** [October 8, 2021, 9:22pm UTC](https://discourse.julialang.org/t/matrix-multiplication-10x-speedup/69452 "2021-10-08T21:22:12Z")

</div>

Researchers at MIT’s Computer Science & Artificial Intelligence Lab (CSAIL) have open-sourced Multiply-ADDitioN-lESS (MADDNESS), an algorithm that speeds up machine learning using approximate matrix multiplication (AMM).…

---

## [Read multiple variables from binary file at once](https://discourse.julialang.org/t/read-multiple-variables-from-binary-file-at-once/69409)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 6\
**Last updated:** [October 8, 2021, 8:51pm UTC](https://discourse.julialang.org/t/read-multiple-variables-from-binary-file-at-once/69409 "2021-10-08T20:51:36Z")

</div>

Hi all, if a binary file contains, e.g. many intergers, how can I elegantly read them at once, Given the total number is known? The most naive way to read them: open(filename) do f a = read(f, Int32) …

---

## [While loop to evaluate until conditions are false](https://discourse.julialang.org/t/while-loop-to-evaluate-until-conditions-are-false/69446)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 5\
**Last updated:** [October 8, 2021, 7:56pm UTC](https://discourse.julialang.org/t/while-loop-to-evaluate-until-conditions-are-false/69446 "2021-10-08T19:56:53Z")

</div>

Hi, I’ve been stumped for a while now and think I am overthinking this. I want to have a vector that excludes a certain value (in this case 2) AND each element is unique (no repeats). My thought is that while my two con…

---

## [Using LightGraphs to find shortest path for eikonal solution](https://discourse.julialang.org/t/using-lightgraphs-to-find-shortest-path-for-eikonal-solution/69324)

<div class="topic-metadata">

**Author:** [@apattyn](https://discourse.julialang.org/u/apattyn)\
**Replies:** 1\
**Last updated:** [October 8, 2021, 7:18pm UTC](https://discourse.julialang.org/t/using-lightgraphs-to-find-shortest-path-for-eikonal-solution/69324 "2021-10-08T19:18:19Z")

</div>

I was using FastMarching.jl to solve the eikonal equation for a given speed image, however the built-in shortestpath(…) function doesn’t give the correct solution - e.g. in a homogeneous speed image the shortest path b/w…

---

## [Advice on Troubleshooting](https://discourse.julialang.org/t/advice-on-troubleshooting/69394)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 2\
**Last updated:** [October 8, 2021, 5:54pm UTC](https://discourse.julialang.org/t/advice-on-troubleshooting/69394 "2021-10-08T17:54:24Z")

</div>

What are ways to map a long function to find common errors, like not having end for an if statement, or not mapping nested if statements, whlie loops, etc?

---

## [Iterate through iterator starting and ending at a specified value](https://discourse.julialang.org/t/iterate-through-iterator-starting-and-ending-at-a-specified-value/69444)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 3\
**Last updated:** [October 8, 2021, 5:25pm UTC](https://discourse.julialang.org/t/iterate-through-iterator-starting-and-ending-at-a-specified-value/69444 "2021-10-08T17:25:16Z")

</div>

I have an iterator. How do I iterator through a selection of it? E.g. it = Iterators.product(\[\[1,2,3\],\[1,2\]\]...) foreach(x-\>println(x),it) iterates through all 6 values. But say I want to iterate starting with the 2nd…

---

## [How to completely remove a package](https://discourse.julialang.org/t/how-to-completely-remove-a-package/69422)

<div class="topic-metadata">

**Author:** [@Johncowk](https://discourse.julialang.org/u/Johncowk)\
**Replies:** 3\
**Last updated:** [October 8, 2021, 4:46pm UTC](https://discourse.julialang.org/t/how-to-completely-remove-a-package/69422 "2021-10-08T16:46:36Z")

</div>

I tried removing the pacakge with rm packagename, which seems to have de-installed the package, but I see that it is still there in \\.julia\\packages\\ Last time I manually remove a directory from \\.julia\\packages\\, it ca…

---

## [Extract @formula / model formula from GLM object](https://discourse.julialang.org/t/extract-formula-model-formula-from-glm-object/66610)

<div class="topic-metadata">

**Author:** [@guysutton](https://discourse.julialang.org/u/guysutton)\
**Replies:** 2\
**Last updated:** [October 8, 2021, 3:28pm UTC](https://discourse.julialang.org/t/extract-formula-model-formula-from-glm-object/66610 "2021-10-08T15:28:56Z")

</div>

I am trying to extract the model formula from a fitted GLM object, with little success. In the dummy example below, I would like to get the following back, for example: Y ~ X \[i.e. the information stored inside @formula(…

---

## [Transpose Plot Layout](https://discourse.julialang.org/t/transpose-plot-layout/69267)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 3\
**Last updated:** [October 8, 2021, 3:19pm UTC](https://discourse.julialang.org/t/transpose-plot-layout/69267 "2021-10-08T15:19:57Z")

</div>

I am using Plots for plotting and tried out subplots today. I wanted to plot 4 rows of plots and 2 columns. The code I am using is: # plot data p = Array{Plots.Plot}(undef, 8) n = 0 for i = 1:8 …

---

## [Mutating fields of an array of structs originating from C](https://discourse.julialang.org/t/mutating-fields-of-an-array-of-structs-originating-from-c/69375)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 2\
**Last updated:** [October 8, 2021, 3:12pm UTC](https://discourse.julialang.org/t/mutating-fields-of-an-array-of-structs-originating-from-c/69375 "2021-10-08T15:12:07Z")

</div>

I am calling a C library that returns a pointer to an array of structs. My goal is to make views that are arrays of the field values, much like StructArrays does. However, StructArrays does not let to mutate the under…

---

## [Read a file separated by blank lines?](https://discourse.julialang.org/t/read-a-file-separated-by-blank-lines/69430)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 5\
**Last updated:** [October 8, 2021, 3:01pm UTC](https://discourse.julialang.org/t/read-a-file-separated-by-blank-lines/69430 "2021-10-08T15:01:21Z")

</div>

I have a file containing several multi-line blocks of text separate by blank lines. A blank line may contain just a line break or also some space. Is there something similar to readline() which allows me to read in these…

---

## [Placing variables in array makes a copy of the variables?](https://discourse.julialang.org/t/placing-variables-in-array-makes-a-copy-of-the-variables/69397)

<div class="topic-metadata">

**Author:** [@nlaws](https://discourse.julialang.org/u/nlaws)\
**Replies:** 13\
**Last updated:** [October 8, 2021, 2:43pm UTC](https://discourse.julialang.org/t/placing-variables-in-array-makes-a-copy-of-the-variables/69397 "2021-10-08T14:43:51Z")

</div>

Maybe this is a scoping issue? I am trying to define defaults in an outer constructor by looping over a list of variables and setting defaults if they are NaN as follows: julia\> struct S x::Float64 end julia\> function …

---

## [Call blocking C function](https://discourse.julialang.org/t/call-blocking-c-function/69427)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 2\
**Last updated:** [October 8, 2021, 2:43pm UTC](https://discourse.julialang.org/t/call-blocking-c-function/69427 "2021-10-08T14:43:10Z")

</div>

I am trying to create a task that asynchronously accepts connection on a TCP socket initialized by external C code, something like this (simplified): #include \<stdio.h\> #include \<sys/types.h\> #include \<sys/socket.h\> #in…

---

## [Exponentiation (\`^\`) on a non-US keyboard](https://discourse.julialang.org/t/exponentiation-on-a-non-us-keyboard/69361)

<div class="topic-metadata">

**Author:** [@met-j](https://discourse.julialang.org/u/met-j)\
**Replies:** 16\
**Last updated:** [October 8, 2021, 2:36pm UTC](https://discourse.julialang.org/t/exponentiation-on-a-non-us-keyboard/69361 "2021-10-08T14:36:05Z")

</div>

I am lost. What changed so the simple algebra like 2ˆ2 does not work anymore (Julia v1.6.3) in the REPL (on MacOS)? And how would I draw the power of a int or a float? I get julia\> 2ˆ2 ERROR: UndefVarError: ˆ2 not de…

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

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