# General Usage

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

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

**Page:** 827

---

## [String constructor vs string function](https://discourse.julialang.org/t/string-constructor-vs-string-function/29501)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 4\
**Last updated:** [October 5, 2019, 2:42am UTC](https://discourse.julialang.org/t/string-constructor-vs-string-function/29501 "2019-10-05T02:42:03Z")

</div>

Context: I have two enums as follows: @enum HouseSize SMALL\_HOUSE MEDIUM\_HOUSE LARGE\_HOUSE @enum HouseEfficiency LOW\_EFFICIENCY MEDIUM\_EFFICIENCY HIGH\_EFFICIENCY If I just had the HouseSize enum, then I could simplify…

---

## [Clearing workspace](https://discourse.julialang.org/t/clearing-workspace/29465)

<div class="topic-metadata">

**Author:** [@ASF](https://discourse.julialang.org/u/ASF)\
**Replies:** 7\
**Last updated:** [October 5, 2019, 2:04am UTC](https://discourse.julialang.org/t/clearing-workspace/29465 "2019-10-05T02:04:53Z")

</div>

Im currently on v1.1.1 using iJulia/Jupyter - i cant find a working method for garbage collection - workspace() and gc() aren’t recognized in REPL or iJulia. Any suggestions?

---

## [Single legend multiple plots - Plots, pyplot()](https://discourse.julialang.org/t/single-legend-multiple-plots-plots-pyplot/29486)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 5\
**Last updated:** [October 4, 2019, 6:47pm UTC](https://discourse.julialang.org/t/single-legend-multiple-plots-plots-pyplot/29486 "2019-10-04T18:47:08Z")

</div>

Hi, I am putting together 4 scatter plots that contain the same variables, so I would like 1 unique legend at the bottom of the plot. The following code generates one legend per graph s1 = scatter(collect(1:10),collect…

---

## [Reading HDF4 Files](https://discourse.julialang.org/t/reading-hdf4-files/29470)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 6\
**Last updated:** [October 4, 2019, 4:41pm UTC](https://discourse.julialang.org/t/reading-hdf4-files/29470 "2019-10-04T16:41:14Z")

</div>

Hi! As someone who needs to read in HDF4 files from TRMM and MODIS, I am trying to find a workaround in Julia using PyCall. However, I’m having some problems with loading the data. fhdf = pyhdf.SDS(“3B42.20130909.00.7…

---

## [Elevator pitch](https://discourse.julialang.org/t/elevator-pitch/29457)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 20\
**Last updated:** [October 4, 2019, 3:38pm UTC](https://discourse.julialang.org/t/elevator-pitch/29457 "2019-10-04T15:38:46Z")

</div>

How would one explain the compile/run model of Julia? As indicated in the title of this topic, in one minute or less. Evidently, I do have some ideas, but I’m sure someone can do it better, and so I am looking for ideas.…

---

## [Where to find this charmming start.jl file from my julia installation path?](https://discourse.julialang.org/t/where-to-find-this-charmming-start-jl-file-from-my-julia-installation-path/29484)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 5\
**Last updated:** [October 4, 2019, 12:25pm UTC](https://discourse.julialang.org/t/where-to-find-this-charmming-start-jl-file-from-my-julia-installation-path/29484 "2019-10-04T12:25:24Z")

</div>

Hi. I was trying to locate this start.jl file. From software Atom, after clicking Julia pane, and then open julia home, I got this .julia location Then, I tried open startup file pane, and nothing happened. I search t…

---

## [Sharing args/Arrays among different modules written in different MyFiles.jl as FORTRAN](https://discourse.julialang.org/t/sharing-args-arrays-among-different-modules-written-in-different-myfiles-jl-as-fortran/29135)

<div class="topic-metadata">

**Author:** [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Replies:** 12\
**Last updated:** [October 4, 2019, 11:32am UTC](https://discourse.julialang.org/t/sharing-args-arrays-among-different-modules-written-in-different-myfiles-jl-as-fortran/29135 "2019-10-04T11:32:43Z")

</div>

I am writing large hydrological models. After computing for e.g. Arrays/args depicting for e.g. the different vegetaion, I would like to make available all these constants Arrays within all the modules written in differe…

---

## [Pkg.add with a URL](https://discourse.julialang.org/t/pkg-add-with-a-url/29475)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [October 4, 2019, 10:08am UTC](https://discourse.julialang.org/t/pkg-add-with-a-url/29475 "2019-10-04T10:08:33Z")

</div>

Is there some reason why we have to do Pkg.add(PackageSpec(url="https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl")) instead of Pkg.add("https://github.com/PetrKryslUCSD/FinEtoolsHeatDiff.jl") ? Couldn’t this con…

---

## [Large programs: structuring modules & include such that to increase performance and readability](https://discourse.julialang.org/t/large-programs-structuring-modules-include-such-that-to-increase-performance-and-readability/29102)

<div class="topic-metadata">

**Author:** [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Replies:** 14\
**Last updated:** [October 4, 2019, 9:43am UTC](https://discourse.julialang.org/t/large-programs-structuring-modules-include-such-that-to-increase-performance-and-readability/29102 "2019-10-04T09:43:59Z")

</div>

I am writing a large hydrological model for which I require to divide the program in many modules incorporated in individual files. I am questioning what will be an efficient and readable approach to share the modules a…

---

## [Why does a package .ji file go stale?](https://discourse.julialang.org/t/why-does-a-package-ji-file-go-stale/29473)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [October 4, 2019, 8:49am UTC](https://discourse.julialang.org/t/why-does-a-package-ji-file-go-stale/29473 "2019-10-04T08:49:49Z")

</div>

Every time I start Julia, Gadfly wants to recompile again: \[ Info: Recompiling stale cache file C:\\Users\\PetrKrysl\\.julia\\compiled\\v1.3\\Gadfly\\DvECm.ji for Gadfly \[c91e804a-d5a3-530f-b6f0-dfbca275c004\] Why does the ca…

---

## [Threaded screen I/O](https://discourse.julialang.org/t/threaded-screen-i-o/29474)

<div class="topic-metadata">

**Author:** [@ckoe-bccms](https://discourse.julialang.org/u/ckoe-bccms)\
**Replies:** 0\
**Last updated:** [October 4, 2019, 7:40am UTC](https://discourse.julialang.org/t/threaded-screen-i-o/29474 "2019-10-04T07:40:55Z")

</div>

Hello everybody, I was trying the threading in 1.3rc2 and there are some questions regarding (screen) I/O which came up and which I could not directly answer using google. Apparently @printf does not “lock” the screen,…

---

## [Evaluating Expr Error: UndefVarError: = not defined](https://discourse.julialang.org/t/evaluating-expr-error-undefvarerror-not-defined/29458)

<div class="topic-metadata">

**Author:** [@Alex\_Ellison](https://discourse.julialang.org/u/Alex_Ellison)\
**Replies:** 4\
**Last updated:** [October 3, 2019, 6:36pm UTC](https://discourse.julialang.org/t/evaluating-expr-error-undefvarerror-not-defined/29458 "2019-10-03T18:36:24Z")

</div>

With a hand-crafted Expr, I can initialize a new variable like so: julia\> a = :(x=1) :(x = 1) julia\> eval(a) 1 julia\> x 1 julia\> However, if I evaluate a comparably simple Expr generated from the Reduce algebra lib…

---

## [DataFrames: reading vector from \*.csv file to dataframe column](https://discourse.julialang.org/t/dataframes-reading-vector-from-csv-file-to-dataframe-column/29409)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 2\
**Last updated:** [October 3, 2019, 12:59pm UTC](https://discourse.julialang.org/t/dataframes-reading-vector-from-csv-file-to-dataframe-column/29409 "2019-10-03T12:59:29Z")

</div>

Dear community, I want to read a csv file with several values including vectors to a data frame. My file looks like: myInt; myString; myVec 1 ; foo ; \[1,2,3\] The column myVec is, however, interpreted as string …

---

## [Converting string to concrete type](https://discourse.julialang.org/t/converting-string-to-concrete-type/29434)

<div class="topic-metadata">

**Author:** [@MaxPauer](https://discourse.julialang.org/u/MaxPauer)\
**Replies:** 6\
**Last updated:** [October 3, 2019, 12:25pm UTC](https://discourse.julialang.org/t/converting-string-to-concrete-type/29434 "2019-10-03T12:25:07Z")

</div>

Suppose I have an abstract type, and some concrete types, that are easily converted to strings. For simplicity, let’s make them tag types. abstract type AbstractTag end struct TagA \<: AbstractTag end struct TagB \<: Ab…

---

## [What exactly is this XML\_Parse in the LibExpat package?](https://discourse.julialang.org/t/what-exactly-is-this-xml-parse-in-the-libexpat-package/29399)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [October 3, 2019, 12:11pm UTC](https://discourse.julialang.org/t/what-exactly-is-this-xml-parse-in-the-libexpat-package/29399 "2019-10-03T12:11:15Z")

</div>

Hi, I hope this is not a too naive question. I get confused about “XML\_Parse” in LibExpat package. The following is the function where it is actually used. function parsefile(filename::AbstractString,callbacks::XPCallb…

---

## [Streaming large xml files using LibExpat package downloaded from GitHub](https://discourse.julialang.org/t/streaming-large-xml-files-using-libexpat-package-downloaded-from-github/25254)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [October 3, 2019, 12:09pm UTC](https://discourse.julialang.org/t/streaming-large-xml-files-using-libexpat-package-downloaded-from-github/25254 "2019-10-03T12:09:27Z")

</div>

Hi, I was trying to figure out the source code of the LibExpat package. The following is the part which confuses me. mutable struct XPCallbacks start\_cdata::Function end\_cdata::Function comment:…

---

## [JuMP optimization with registered function](https://discourse.julialang.org/t/jump-optimization-with-registered-function/29445)

<div class="topic-metadata">

**Author:** [@Matthew\_Overlin](https://discourse.julialang.org/u/Matthew_Overlin)\
**Replies:** 0\
**Last updated:** [October 3, 2019, 11:14am UTC](https://discourse.julialang.org/t/jump-optimization-with-registered-function/29445 "2019-10-03T11:14:53Z")

</div>

I am trying to use JuMP for parameter estimation. In my julia script, I have a line “JuMP.register(model, :fun\_to\_min, 24, fun\_to\_min, autodiff=true);” That is, I have “fun\_to\_min” which takes 24 parameters and returns…

---

## [Testing on Travis with nightly/Windows 64-bit doesn't work](https://discourse.julialang.org/t/testing-on-travis-with-nightly-windows-64-bit-doesnt-work/29441)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [October 3, 2019, 10:34am UTC](https://discourse.julialang.org/t/testing-on-travis-with-nightly-windows-64-bit-doesnt-work/29441 "2019-10-03T10:34:17Z")

</div>

1.31s$ git clone --depth=50 --branch=master https://github.com/PetrKryslUCSD/FinEtools.jl.git PetrKryslUCSD/FinEtools.jl 0.08s Setting environment variables from repository settings $ export DOCUMENTER\_KEY=\[secure\] $ exp…

---

## [Pkg installs Homebrew to a Linux box as a dependency](https://discourse.julialang.org/t/pkg-installs-homebrew-to-a-linux-box-as-a-dependency/29438)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 1\
**Last updated:** [October 3, 2019, 9:25am UTC](https://discourse.julialang.org/t/pkg-installs-homebrew-to-a-linux-box-as-a-dependency/29438 "2019-10-03T09:25:40Z")

</div>

@jheinen noticed in Fastest way to draw on Gtk.jl 'canvas' with plots produced from Plots.jl? - #12 by jheinen that Homebrew is installed automatically as a dependency even if running in Linux OS. I tested this with a f…

---

## [Support for test/dev/staging/prod deps environments in Pkg](https://discourse.julialang.org/t/support-for-test-dev-staging-prod-deps-environments-in-pkg/29437)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 0\
**Last updated:** [October 3, 2019, 8:58am UTC](https://discourse.julialang.org/t/support-for-test-dev-staging-prod-deps-environments-in-pkg/29437 "2019-10-03T08:58:20Z")

</div>

I’ve been tweaking a lot with PackageCompiler this week and the issue which consistently broke all my attempts to use PackageCompiler is that the tests of the packages that PackageCompiler works with include dependencies…

---

## [Fixing old code and ran into SetObjective error](https://discourse.julialang.org/t/fixing-old-code-and-ran-into-setobjective-error/29377)

<div class="topic-metadata">

**Author:** [@ajimithing](https://discourse.julialang.org/u/ajimithing)\
**Replies:** 5\
**Last updated:** [October 3, 2019, 1:31am UTC](https://discourse.julialang.org/t/fixing-old-code-and-ran-into-setobjective-error/29377 "2019-10-03T01:31:01Z")

</div>

I am working through an old code, and having to change a bunch of stuff to work with the new JuMP package. (ex. replacing {} with (), replacing @DefVar with variable, replacing AddConstraint with constraint, etc.) I’ve …

---

## [Anonymous iterators?](https://discourse.julialang.org/t/anonymous-iterators/29426)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 4\
**Last updated:** [October 3, 2019, 12:30am UTC](https://discourse.julialang.org/t/anonymous-iterators/29426 "2019-10-03T00:30:06Z")

</div>

i was reading in the Discourse Slack when someone asked about some syntax equivalent to the yield keyword in python. in Julia, the syntax ´for i in iter´ is lowered to iterate(iter::IterType) and iterate(iter::IterType,s…

---

## [Custom updating binary operator](https://discourse.julialang.org/t/custom-updating-binary-operator/29301)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 5\
**Last updated:** [October 2, 2019, 9:21pm UTC](https://discourse.julialang.org/t/custom-updating-binary-operator/29301 "2019-10-02T21:21:00Z")

</div>

I have defined union for a custom set type. Base.union(a::MySet, b::MySet) = ... Then the following work as expected: union(a, b) a ∪ b Is it possible for the updating operator a ∪= b to have the expected interpretat…

---

## [Can this language be used as a gameserver?](https://discourse.julialang.org/t/can-this-language-be-used-as-a-gameserver/29423)

<div class="topic-metadata">

**Author:** [@girng](https://discourse.julialang.org/u/girng)\
**Replies:** 4\
**Last updated:** [October 2, 2019, 6:54pm UTC](https://discourse.julialang.org/t/can-this-language-be-used-as-a-gameserver/29423 "2019-10-02T18:54:33Z")

</div>

I currently am an avid user of Crystal. I fell in love with its syntax and network wrappers. Setting up a TCP Server is super simple, same for storing clients in an Hash, etc. Also the JSON.parse/.to\_json methods they h…

---

## [Adding packages over SSH](https://discourse.julialang.org/t/adding-packages-over-ssh/29406)

<div class="topic-metadata">

**Author:** [@cshenton](https://discourse.julialang.org/u/cshenton)\
**Replies:** 4\
**Last updated:** [October 2, 2019, 2:05pm UTC](https://discourse.julialang.org/t/adding-packages-over-ssh/29406 "2019-10-02T14:05:26Z")

</div>

I’m distributing a Julia package internal to my company and want an easy workflow for users to add package dependencies to their Julia projects. I can’t use Pkg for this because the default way of adding non registered …

---

## [Finding a conditioned row in a dataframe](https://discourse.julialang.org/t/finding-a-conditioned-row-in-a-dataframe/29347)

<div class="topic-metadata">

**Author:** [@Dervis](https://discourse.julialang.org/u/Dervis)\
**Replies:** 4\
**Last updated:** [October 2, 2019, 1:56pm UTC](https://discourse.julialang.org/t/finding-a-conditioned-row-in-a-dataframe/29347 "2019-10-02T13:56:11Z")

</div>

Dear all, I am trying to find the index (row number) of specific row that I am conditioning from a large dataset (33000 rows x 9 columns). The columns of the dataset are date(year, month, day) & time(hour, min, sec) & …

---

## [Extracting row of DataFrame directly as NamedTuple?](https://discourse.julialang.org/t/extracting-row-of-dataframe-directly-as-namedtuple/29380)

<div class="topic-metadata">

**Author:** [@ethanminfang](https://discourse.julialang.org/u/ethanminfang)\
**Replies:** 4\
**Last updated:** [October 2, 2019, 1:41pm UTC](https://discourse.julialang.org/t/extracting-row-of-dataframe-directly-as-namedtuple/29380 "2019-10-02T13:41:43Z")

</div>

Hi all, I guess that’s a stupid question(?) I simulated a model with different sets of parameters. To save time (not repeated run the same code with different parameters), I saved the parameters into dataframe row by r…

---

## [Analyzing unbalanced panel / Autocorrelation](https://discourse.julialang.org/t/analyzing-unbalanced-panel-autocorrelation/29407)

<div class="topic-metadata">

**Author:** [@Dom-DC](https://discourse.julialang.org/u/Dom-DC)\
**Replies:** 0\
**Last updated:** [October 2, 2019, 1:23pm UTC](https://discourse.julialang.org/t/analyzing-unbalanced-panel-autocorrelation/29407 "2019-10-02T13:23:32Z")

</div>

Hi, I have a DataFrame containing an unbalanced panel data set with individual-year observations characterized by an :id and :year. I would like to compute the autocorrelation of variable X at the individual :id level b…

---

## [Uncaught TypeError: Cannot read property 'get' of undefined](https://discourse.julialang.org/t/uncaught-typeerror-cannot-read-property-get-of-undefined/29401)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [October 2, 2019, 1:09pm UTC](https://discourse.julialang.org/t/uncaught-typeerror-cannot-read-property-get-of-undefined/29401 "2019-10-02T13:09:46Z")

</div>

Hi, I got this error all of a sudden. Could anyone please let me know more about it…

---

## [A weird error when use two \`in\` in a for loop](https://discourse.julialang.org/t/a-weird-error-when-use-two-in-in-a-for-loop/29394)

<div class="topic-metadata">

**Author:** [@anon56330260](https://discourse.julialang.org/u/anon56330260)\
**Replies:** 2\
**Last updated:** [October 2, 2019, 8:02am UTC](https://discourse.julialang.org/t/a-weird-error-when-use-two-in-in-a-for-loop/29394 "2019-10-02T08:02:38Z")

</div>

MWE: function blur7!(in::Array{T,2},bv::Array{T,2}) where T m,n = size(in) bh = Array{T,2}(undef,32,2) for tx in in 1:32:m #here are two \`in\`s bh\[i+1,1\] = in\[tx,1\] end end m = 5 n = 5 A = colle…

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

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