# General Usage

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

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

**Page:** 861

---

## [ExcelReaders issue never happened before](https://discourse.julialang.org/t/excelreaders-issue-never-happened-before/24880)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 5\
**Last updated:** [June 4, 2019, 2:18am UTC](https://discourse.julialang.org/t/excelreaders-issue-never-happened-before/24880 "2019-06-04T02:18:38Z")

</div>

Hi, I have used ExcelReaders.jl for a while without any problem. Few days ago it started showing the error “key open\_workbook not found”. I have always read files using readxlsheet(“data.xls”,“Sheet1”)

---

## [How do you move the ylabel away from the yaxis? Changing the margins doesn't help](https://discourse.julialang.org/t/how-do-you-move-the-ylabel-away-from-the-yaxis-changing-the-margins-doesnt-help/23710)

<div class="topic-metadata">

**Author:** [@Shea\_Fitzgerald](https://discourse.julialang.org/u/Shea_Fitzgerald)\
**Replies:** 1\
**Last updated:** [June 4, 2019, 2:14am UTC](https://discourse.julialang.org/t/how-do-you-move-the-ylabel-away-from-the-yaxis-changing-the-margins-doesnt-help/23710 "2019-06-04T02:14:14Z")

</div>

Here’s my sample: using Plots using Plots.PlotMeasures fo = font(18) gr(titlefont=fo, guidefont=fo, tickfont=fo, legendfont=fo, show = true, size=(700,200)) plot( plot(\[0.01,0.02,0.03,0.04\],label = L"\\sigma\_E") …

---

## [ANN: Strided.jl , a high-level dense array acceleration package](https://discourse.julialang.org/t/ann-strided-jl-a-high-level-dense-array-acceleration-package/16434)

<div class="topic-metadata">

**Author:** [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Replies:** 17\
**Last updated:** [June 4, 2019, 1:26am UTC](https://discourse.julialang.org/t/ann-strided-jl-a-high-level-dense-array-acceleration-package/16434 "2019-06-04T01:26:40Z")

</div>

Dear Julia users, I have recently registered a package called Strided.jl that can speed up certain tasks with dense arrays. Its primary use is when you combine arrays whose memory layout is strided but with strides that…

---

## [Global scope: the meaning of the first-hit rule](https://discourse.julialang.org/t/global-scope-the-meaning-of-the-first-hit-rule/24845)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 12\
**Last updated:** [June 3, 2019, 5:15pm UTC](https://discourse.julialang.org/t/global-scope-the-meaning-of-the-first-hit-rule/24845 "2019-06-03T17:15:40Z")

</div>

I would like to figure out the following example: x = 1 for i in 1:3 x += 1 end println("x = $(x)") This fragment pasted into the repl fails, ERROR: UndefVarError: x not defined. I think the scoping rules are that…

---

## [How to read a gzipped HTTP response?](https://discourse.julialang.org/t/how-to-read-a-gzipped-http-response/24854)

<div class="topic-metadata">

**Author:** [@anon67531922](https://discourse.julialang.org/u/anon67531922)\
**Replies:** 4\
**Last updated:** [June 3, 2019, 4:31pm UTC](https://discourse.julialang.org/t/how-to-read-a-gzipped-http-response/24854 "2019-06-03T16:31:56Z")

</div>

Hi, I’m working with a third-party API and apparently Accept-Encoding: identity is not possible, so I am receiving a gzipped response body whether I like it or not. I’ve been looking at TranscodingStreams.jl for a whil…

---

## [Mapping Vector{MyType} to a DataFrame](https://discourse.julialang.org/t/mapping-vector-mytype-to-a-dataframe/24797)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 13\
**Last updated:** [June 3, 2019, 3:24pm UTC](https://discourse.julialang.org/t/mapping-vector-mytype-to-a-dataframe/24797 "2019-06-03T15:24:57Z")

</div>

I have a vector with a custom type (struct). Suppose I want the data in a DataFrame. Can I do this more efficiently than below? (i.e. without copying data) Of course, I could generate a DataFrame in the beginning (inst…

---

## [Change float into color or change array of Floats into colormap](https://discourse.julialang.org/t/change-float-into-color-or-change-array-of-floats-into-colormap/24861)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 2\
**Last updated:** [June 3, 2019, 3:09pm UTC](https://discourse.julialang.org/t/change-float-into-color-or-change-array-of-floats-into-colormap/24861 "2019-06-03T15:09:40Z")

</div>

Hi, I want to change array of Floats(Calculated Values of Magnetic Induction) into colormap in cimgui app. I want something like this(matlab colormaps). I wrote simillar question here. I just thinked how to achieve this…

---

## [Removing label from a contour plot](https://discourse.julialang.org/t/removing-label-from-a-contour-plot/24891)

<div class="topic-metadata">

**Author:** [@srb](https://discourse.julialang.org/u/srb)\
**Replies:** 1\
**Last updated:** [June 3, 2019, 2:53pm UTC](https://discourse.julialang.org/t/removing-label-from-a-contour-plot/24891 "2019-06-03T14:53:35Z")

</div>

Hello, I am trying to remove the following labels from a contour plot, but I cannot find the attribute for it. This is the code to generate the plot: using Plots julia\> c(x,y) = x^2 + y^2 -1 c (generic function with 1…

---

## [Question about constant propagation and inference](https://discourse.julialang.org/t/question-about-constant-propagation-and-inference/24889)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 6\
**Last updated:** [June 3, 2019, 1:23pm UTC](https://discourse.julialang.org/t/question-about-constant-propagation-and-inference/24889 "2019-06-03T13:23:46Z")

</div>

I am puzzled by this julia\> test(flag) = flag ? 1.0 : 1 test (generic function with 2 methods) julia\> @code\_warntype test(true) Variables #self#::Core.Compiler.Const(test, false) flag::Bool Body::Union{Float64, In…

---

## [Improve error message on mapreduce (sum)?](https://discourse.julialang.org/t/improve-error-message-on-mapreduce-sum/24882)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 3\
**Last updated:** [June 3, 2019, 1:00pm UTC](https://discourse.julialang.org/t/improve-error-message-on-mapreduce-sum/24882 "2019-06-03T13:00:12Z")

</div>

hi is it worth filing an issue that this error message could be improved? julia\> x = rand(3,4) 3×4 Array{Float64,2}: 0.0393155 0.125126 0.019893 0.377598 0.785163 0.950731 0.968909 0.620597 0.999954 0.672…

---

## [How to change Julia GIT settings?](https://discourse.julialang.org/t/how-to-change-julia-git-settings/24730)

<div class="topic-metadata">

**Author:** [@Daneel](https://discourse.julialang.org/u/Daneel)\
**Replies:** 2\
**Last updated:** [June 3, 2019, 11:27am UTC](https://discourse.julialang.org/t/how-to-change-julia-git-settings/24730 "2019-06-03T11:27:45Z")

</div>

How can I change the GIT settings that Julia uses? It doesn’t seem to obey the .gitconfig file in my home directory. In my case I would like to change the default from https:// to git://. This is related to my other pr…

---

## [Clang.jl generates lower case structs](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 2\
**Last updated:** [June 3, 2019, 11:14am UTC](https://discourse.julialang.org/t/clang-jl-generates-lower-case-structs/24881 "2019-06-03T11:14:45Z")

</div>

I am trying to make a wrapper for a C-library and everything seems to work nicely except that Clang.jl emits the struct names in lower case. I guess I am missing something in the the generate.jl script?

---

## [PlotlyJS reverse x-axis](https://discourse.julialang.org/t/plotlyjs-reverse-x-axis/24874)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 1\
**Last updated:** [June 3, 2019, 9:42am UTC](https://discourse.julialang.org/t/plotlyjs-reverse-x-axis/24874 "2019-06-03T09:42:34Z")

</div>

For a line plot (with one line, sorted data) there should be four “options”: both the data and the x-axis can be sorted from high to low and vice versa. In the example below, I can easily reverse the ‘data’, but not the…

---

## [Append!() with two dataframe throws PooledArray error](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850)

<div class="topic-metadata">

**Author:** [@notpeerreviewed](https://discourse.julialang.org/u/notpeerreviewed)\
**Replies:** 4\
**Last updated:** [June 3, 2019, 8:07am UTC](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850 "2019-06-03T08:07:04Z")

</div>

Hi everyone, I’m very new to Julia and have been working through replicating a relatively simple R script in Julia 1.0. Currently it’s a data cleaning exercise and I’ve been using DataFrames and DataFramesMeta, as I am…

---

## [Unsatisfiable requirements detected for package ImageCore](https://discourse.julialang.org/t/unsatisfiable-requirements-detected-for-package-imagecore/24810)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 5\
**Last updated:** [June 3, 2019, 7:49am UTC](https://discourse.julialang.org/t/unsatisfiable-requirements-detected-for-package-imagecore/24810 "2019-06-03T07:49:34Z")

</div>

This started when I realized my ImageDraw was stuck on v0.1.0. So I tried adding its #master but was told ImageCore was holding it back, so I removed ImageDraw, tried to update ImageCore to #master, but got this: (v1.1)…

---

## [Some iterative solvers do not accept subarray argument?](https://discourse.julialang.org/t/some-iterative-solvers-do-not-accept-subarray-argument/24855)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 0\
**Last updated:** [June 2, 2019, 4:30pm UTC](https://discourse.julialang.org/t/some-iterative-solvers-do-not-accept-subarray-argument/24855 "2019-06-02T16:30:10Z")

</div>

Hi, I am surprised that IterativeSolvers.gauss\_seidel can take views for vector arguments while jacobi, sor and ssor cannot. Any reason for this ? function test() nx=ny=10 dx=dy=2 A=poissonSparse(nx,ny,dx,…

---

## [Automatic threshold](https://discourse.julialang.org/t/automatic-threshold/24790)

<div class="topic-metadata">

**Author:** [@GERSON\_EZEQUIEL\_HERN](https://discourse.julialang.org/u/GERSON_EZEQUIEL_HERN)\
**Replies:** 8\
**Last updated:** [June 2, 2019, 5:02pm UTC](https://discourse.julialang.org/t/automatic-threshold/24790 "2019-06-02T17:02:26Z")

</div>

good night friends. I’m working with some images (mandril and lighthouse) and I want to do the procedure as the diagram shows. Could someone help me … I’m not good at programming in Julia. And I would like to learn…

---

## [Use of variable in Julia REPL](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843)

<div class="topic-metadata">

**Author:** [@Mr.Robot](https://discourse.julialang.org/u/Mr.Robot)\
**Replies:** 4\
**Last updated:** [June 2, 2019, 1:38am UTC](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843 "2019-06-02T01:38:31Z")

</div>

Problem This issue has bothered me for a long time. Previously I thought it was related to my program, but the following example shows it should not. As could be seen in the snapshot The REPL does have access to varia…

---

## [Issue with StaticArrays and PDMP](https://discourse.julialang.org/t/issue-with-staticarrays-and-pdmp/24392)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 16\
**Last updated:** [June 1, 2019, 12:34pm UTC](https://discourse.julialang.org/t/issue-with-staticarrays-and-pdmp/24392 "2019-06-01T12:34:14Z")

</div>

Dear All, I am trying to make PiecewiseDeterministicMarkovProcesses.jl (I am the creator) work with StaticArrays.jl. To this end, I try running the example file by appending using StaticArrays sxc0 = @MVector \[ 1.0 \] s…

---

## [Importing modules from function](https://discourse.julialang.org/t/importing-modules-from-function/24834)

<div class="topic-metadata">

**Author:** [@oli](https://discourse.julialang.org/u/oli)\
**Replies:** 2\
**Last updated:** [June 1, 2019, 12:05pm UTC](https://discourse.julialang.org/t/importing-modules-from-function/24834 "2019-06-01T12:05:37Z")

</div>

Hi, I’m working on a project at the moment that involves many packages and modules, as well as many different files. I have a “setup.jl” file that adds all the packages (Pkg.add("Pkg\_name"); using Pkg\_name;) and include…

---

## [Circle data structures to implement sequential allocations in Julia](https://discourse.julialang.org/t/circle-data-structures-to-implement-sequential-allocations-in-julia/24808)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [June 1, 2019, 3:36am UTC](https://discourse.julialang.org/t/circle-data-structures-to-implement-sequential-allocations-in-julia/24808 "2019-06-01T03:36:47Z")

</div>

Hi. I need to implement a simple task, which is to choose the available (means it is currently un-used) server from a bunch of given servers based on a sequential ordering, i.e., the server which has not been used for th…

---

## [Is this a bug with Cholesky?](https://discourse.julialang.org/t/is-this-a-bug-with-cholesky/16970)

<div class="topic-metadata">

**Author:** [@spinkney](https://discourse.julialang.org/u/spinkney)\
**Replies:** 6\
**Last updated:** [June 1, 2019, 2:57am UTC](https://discourse.julialang.org/t/is-this-a-bug-with-cholesky/16970 "2019-06-01T02:57:17Z")

</div>

I have a matrix called “post\_var” that fails with a cholesky decomposition but when I copy and paste the matrix and run cholseky on that it works. Can someone check out what’s going on? The original code was from a 2014…

---

## [ADD IJulia installation: Julia 1.1 failed, 1.0.3 works](https://discourse.julialang.org/t/add-ijulia-installation-julia-1-1-failed-1-0-3-works/20147)

<div class="topic-metadata">

**Author:** [@sloggers](https://discourse.julialang.org/u/sloggers)\
**Replies:** 31\
**Last updated:** [May 31, 2019, 10:37pm UTC](https://discourse.julialang.org/t/add-ijulia-installation-julia-1-1-failed-1-0-3-works/20147 "2019-05-31T22:37:51Z")

</div>

I tried adding Blosc and ZMQ manually (both “works meaning error-free”) but same error as below: \_ \_ \_ ( )\_ | Documentation: https://docs.julialang.org ( ) | ( ) ( ) | \_ \_ | | \_\_ \_ | Type “?” for help, “\]?” for Pk…

---

## [Julia protips](https://discourse.julialang.org/t/julia-protips/16749)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 55\
**Last updated:** [May 31, 2019, 7:06pm UTC](https://discourse.julialang.org/t/julia-protips/16749 "2019-05-31T19:06:19Z")

</div>

I’m not a Julia pro by any stretch of the imagination but I just found something that wasn’t obvious and blew my mind in a very small way, and I figure there are probably other little things like this that people are dis…

---

## [JuliaDB flatten multiple columns](https://discourse.julialang.org/t/juliadb-flatten-multiple-columns/24804)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 7\
**Last updated:** [May 31, 2019, 5:39pm UTC](https://discourse.julialang.org/t/juliadb-flatten-multiple-columns/24804 "2019-05-31T17:39:02Z")

</div>

I want to “flatten” a table with multiple cells that contain vectors (these have equal lengths per table-row): t = table((group = \[1,1,2,2\], x = \[1,2,3,4\])) t2 = groupby(t, :group, usekey = true) do k, r (x2 = r.x .…

---

## [Replace behaving strange?](https://discourse.julialang.org/t/replace-behaving-strange/20008)

<div class="topic-metadata">

**Author:** [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Replies:** 6\
**Last updated:** [May 31, 2019, 5:00pm UTC](https://discourse.julialang.org/t/replace-behaving-strange/20008 "2019-05-31T17:00:19Z")

</div>

Initialize string array s = SubString{String}\["Julia", "uses", "multiple", "dispatch", "as", "a", "paradigm,", "making", "it", "easy", "to", "express", "many", "object-oriented", "and", "functional", "programming", "pat…

---

## [Modify variable in closure and type inference](https://discourse.julialang.org/t/modify-variable-in-closure-and-type-inference/24765)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 11\
**Last updated:** [May 31, 2019, 4:25pm UTC](https://discourse.julialang.org/t/modify-variable-in-closure-and-type-inference/24765 "2019-05-31T16:25:25Z")

</div>

I would like to have a closure modify a captured variable. Here is a simple example: function fancy\_iteration(f::F, itr) where {F} for pt in itr f(pt) end end function mysum(f, itr) sum = 0. fan…

---

## [Setting ENV for a shared library in \_\_init\_\_](https://discourse.julialang.org/t/setting-env-for-a-shared-library-in-init/24724)

<div class="topic-metadata">

**Author:** [@visr](https://discourse.julialang.org/u/visr)\
**Replies:** 6\
**Last updated:** [May 31, 2019, 2:23pm UTC](https://discourse.julialang.org/t/setting-env-for-a-shared-library-in-init/24724 "2019-05-31T14:23:31Z")

</div>

In this GDAL.jl PR I want to set an environment variable PROJ\_LIB that one of the underlying shared libraries uses to find resources. If I set this environment globally, in the shell, or in startup.jl with ENV\["PROJ\_LIB"…

---

## [Macro to print line number and time of execution (@time + line number)?](https://discourse.julialang.org/t/macro-to-print-line-number-and-time-of-execution-time-line-number/4919)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 17\
**Last updated:** [May 29, 2019, 8:35pm UTC](https://discourse.julialang.org/t/macro-to-print-line-number-and-time-of-execution-time-line-number/4919 "2019-05-29T20:35:43Z")

</div>

@time prints useful information about the time it took to evaluate a command. Is there a way to also print on the same line the line number where @time is located in a source file?

---

## [Warning: Method definition (::Type{SIM.simulation})() in module SIM at /home/Desktop/myFile.jl:57 overwritten at /home/Desktop/myFile.jl:57](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 5\
**Last updated:** [May 31, 2019, 1:23pm UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762 "2019-05-31T13:23:48Z")

</div>

The code works earlier. But when I run it this time, I got the above warning as indicated by the title. I checked the line 57 of the file myFile.jl, and only to find that it is the constructor definition inside of the mu…

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

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