# General Usage

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

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

**Page:** 952

---

## [REPL Trailing Semicolon Behavior](https://discourse.julialang.org/t/repl-trailing-semicolon-behavior/13672)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 9\
**Last updated:** [August 20, 2018, 12:03am UTC](https://discourse.julialang.org/t/repl-trailing-semicolon-behavior/13672 "2018-08-20T00:03:14Z")

</div>

Question: when does a trailing ‘;’ suppress output? using DataFrames, CategoricalArrays df= DataFrame( nm= \[ 1, 2, 3 \] ) df\[:nm\]= recode( df\[:nm\], 9801=\>(-4) ); ## why does trailing ; not suppress output?? df; …

---

## [Looping over float-range is faster than looping over int-range?](https://discourse.julialang.org/t/looping-over-float-range-is-faster-than-looping-over-int-range/13704)

<div class="topic-metadata">

**Author:** [@DNF](https://discourse.julialang.org/u/DNF)\
**Replies:** 9\
**Last updated:** [August 19, 2018, 9:30pm UTC](https://discourse.julialang.org/t/looping-over-float-range-is-faster-than-looping-over-int-range/13704 "2018-08-19T21:30:25Z")

</div>

I came across a micro-benchmark online, with some weird performance characteristics. Here is the function, benchmarking on MacOS, Julia version 1.0.0: function g(N) s = 0. for k = 1:N+1 s = s + (-1)^(k+…

---

## [BioSequences upgrade works on 1.0 but not 0.7](https://discourse.julialang.org/t/biosequences-upgrade-works-on-1-0-but-not-0-7/13708)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 4\
**Last updated:** [August 19, 2018, 8:31pm UTC](https://discourse.julialang.org/t/biosequences-upgrade-works-on-1-0-but-not-0-7/13708 "2018-08-19T20:31:56Z")

</div>

Hi, We’ve been upgrading BioSequences for julia 0.7/1.0 at this PR: https://github.com/BioJulia/BioSequences.jl/pull/41 I’ve managed to get tests on TravisCI passing for julia 1.0 but oddly not 0.7. The error that thro…

---

## [Using ODBC error on 1.0](https://discourse.julialang.org/t/using-odbc-error-on-1-0/13157)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 5\
**Last updated:** [August 19, 2018, 5:02pm UTC](https://discourse.julialang.org/t/using-odbc-error-on-1-0/13157 "2018-08-19T17:02:22Z")

</div>

This was working in Julia 0.6, but doesn’t seem to work anymore. Can someone help me figure out if there is something I’m doing wrong? julia\> using ODBC \[ Info: Precompiling ODBC \[be6f12e9-ca4f-5eb2-a339-a4f995cc0291\] …

---

## [Adding single-file Julia module to path in v1.0](https://discourse.julialang.org/t/adding-single-file-julia-module-to-path-in-v1-0/13695)

<div class="topic-metadata">

**Author:** [@cdacosta](https://discourse.julialang.org/u/cdacosta)\
**Replies:** 5\
**Last updated:** [August 19, 2018, 3:57am UTC](https://discourse.julialang.org/t/adding-single-file-julia-module-to-path-in-v1-0/13695 "2018-08-19T03:57:39Z")

</div>

I have a single-file module which I would like to add to my loading path. Previously in Julia 0.6, I had this in my ~/.bashrc: if \[ -n "$JULIA\_LOAD\_PATH" \]; then export JULIA\_LOAD\_PATH=$MODULEPATH:${JULIA\_LOAD\_PATH}…

---

## [How to delete precompile cache?](https://discourse.julialang.org/t/how-to-delete-precompile-cache/13622)

<div class="topic-metadata">

**Author:** [@ckoe-bccms](https://discourse.julialang.org/u/ckoe-bccms)\
**Replies:** 19\
**Last updated:** [August 19, 2018, 8:10am UTC](https://discourse.julialang.org/t/how-to-delete-precompile-cache/13622 "2018-08-19T08:10:49Z")

</div>

Hello, I played around with precompilation of my own modules some time ago, but do not use it any more for my own modules and have removed all \_precompile\_ whatever from the sources. Now, I suddenly get this error messa…

---

## [Type name clashes](https://discourse.julialang.org/t/type-name-clashes/13689)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 2\
**Last updated:** [August 19, 2018, 7:19am UTC](https://discourse.julialang.org/t/type-name-clashes/13689 "2018-08-19T07:19:11Z")

</div>

I just noticed this: Works: module Foo struct Array end end Fails with ERROR: cannot assign variable Core.Array from module Foo: module Foo dump(Array) struct Array end end Is the conclusion that adding a type that …

---

## [Reading JLD 1 files in 0.7](https://discourse.julialang.org/t/reading-jld-1-files-in-0-7/13682)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [August 19, 2018, 6:18am UTC](https://discourse.julialang.org/t/reading-jld-1-files-in-0-7/13682 "2018-08-19T06:18:11Z")

</div>

JLD doesn’t seem to work with 0.7/1.0. I have a bunch of files in the original .jld format. Without rolling back to an older Julia installation, is there a way to load them?

---

## [Iterate sequentially over several collections](https://discourse.julialang.org/t/iterate-sequentially-over-several-collections/13687)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 7\
**Last updated:** [August 19, 2018, 6:11am UTC](https://discourse.julialang.org/t/iterate-sequentially-over-several-collections/13687 "2018-08-19T06:11:45Z")

</div>

I have two collections with the same eltype, say c1 = 1:3 and c2 = 5:7. I would like to be able to write a generator over the joined collections, something like (i for i in joincol(c1, c2)) so that this becomes a gener…

---

## [Pkg 0.7.0 replacement for Pkg.status()](https://discourse.julialang.org/t/pkg-0-7-0-replacement-for-pkg-status/11712)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 18\
**Last updated:** [August 18, 2018, 10:00pm UTC](https://discourse.julialang.org/t/pkg-0-7-0-replacement-for-pkg-status/11712 "2018-08-18T22:00:40Z")

</div>

Is there a map from the old Pkg.\* functions to the new Pkg manager in 0.7.0? For example, how do I find out which Missings package I have installed? advice appreciated. /iaw

---

## [Not Sharing variables between Jupyter Notebook nbincludes](https://discourse.julialang.org/t/not-sharing-variables-between-jupyter-notebook-nbincludes/13598)

<div class="topic-metadata">

**Author:** [@tawheeler](https://discourse.julialang.org/u/tawheeler)\
**Replies:** 4\
**Last updated:** [August 19, 2018, 12:46am UTC](https://discourse.julialang.org/t/not-sharing-variables-between-jupyter-notebook-nbincludes/13598 "2018-08-19T00:46:56Z")

</div>

I have a set of jupyter notebooks that I would like to execute in a test so as to ensure that they all run: for file in readdir(NOTEBOOK\_DIR) if splitext(file)\[2\] == ".ipynb" println("Running ", file) …

---

## [Type check in if statements vs. multiple dispatch](https://discourse.julialang.org/t/type-check-in-if-statements-vs-multiple-dispatch/13692)

<div class="topic-metadata">

**Author:** [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Replies:** 2\
**Last updated:** [August 18, 2018, 11:29pm UTC](https://discourse.julialang.org/t/type-check-in-if-statements-vs-multiple-dispatch/13692 "2018-08-18T23:29:54Z")

</div>

I was wondering if if statements based on types are optimized at compile time. Here are few ways of writing the same code. Is any of them better than the rest? Is the extra cost only a couple of if statements at run time…

---

## [Clone and checkout my fork, on travis-CI?](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637)

<div class="topic-metadata">

**Author:** [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Replies:** 6\
**Last updated:** [August 18, 2018, 9:51pm UTC](https://discourse.julialang.org/t/clone-and-checkout-my-fork-on-travis-ci/13637 "2018-08-18T21:51:51Z")

</div>

I updated a registered package I need to work with v0.7, and made a pull request. On my fork this is branch julia07fixes. Can I get Travis-CI to download this version when testing another package of mine? (Which is 0.7 …

---

## [Strange warning in 0.7](https://discourse.julialang.org/t/strange-warning-in-0-7/13678)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [August 18, 2018, 9:15pm UTC](https://discourse.julialang.org/t/strange-warning-in-0-7/13678 "2018-08-18T21:15:48Z")

</div>

I am migrating my code to 0.7, and have the following warnings left: WARNING: using PyPlot.axes in module Main conflicts with an existing identifier. ┌ Warning: \`Array{T}(m::Int) where T\` is deprecated, use \`Array{T}(un…

---

## [Using isdefined in 0.6 and 0.7 without warnings](https://discourse.julialang.org/t/using-isdefined-in-0-6-and-0-7-without-warnings/13669)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [August 18, 2018, 8:52pm UTC](https://discourse.julialang.org/t/using-isdefined-in-0-6-and-0-7-without-warnings/13669 "2018-08-18T20:52:16Z")

</div>

Hello, I want to rewrite the following line of code in a way that works without warning in 0.6 and 0.7: !isdefined(:SAMPLETIME) && const SAMPLETIME = 0.005 The macro @isdefined works on 0.7, but not on 0.6. Any idea? …

---

## [Pkg: adding private packages with private dependencies](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505)

<div class="topic-metadata">

**Author:** [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Replies:** 14\
**Last updated:** [August 18, 2018, 7:51pm UTC](https://discourse.julialang.org/t/pkg-adding-private-packages-with-private-dependencies/13505 "2018-08-18T19:51:04Z")

</div>

I have several packages hosted on an internal Gitlab server. I have kept public dependencies in REQUIRE files for these packages, but I have relied on doing Pkg.clone(...) manually to add the internal dependencies (for v…

---

## [Run another Julia with the same Pkg environment?](https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 3\
**Last updated:** [August 18, 2018, 7:48pm UTC](https://discourse.julialang.org/t/run-another-julia-with-the-same-pkg-environment/13668 "2018-08-18T19:48:01Z")

</div>

In my tests I run a script in another Julia run("julia myscript.jl") and my script starts with using Distributions which gives me a : ERROR: LoadError: ArgumentError: Module Distributions not found in current path. How…

---

## [Type Inference Bug with StaticArrays?](https://discourse.julialang.org/t/type-inference-bug-with-staticarrays/13664)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 2\
**Last updated:** [August 18, 2018, 4:44pm UTC](https://discourse.julialang.org/t/type-inference-bug-with-staticarrays/13664 "2018-08-18T16:44:09Z")

</div>

Consider this simplified example (possibility not quite minimal…) test1(x::AbstractVector{TI}, y) where {TI \<: Integer} = max.(floor.(TI, x /y), one(TI)) then note the Any in the type signature of the output: julia\> t…

---

## [Allocations on multi threaded matrix operations (caused by BigFloats)](https://discourse.julialang.org/t/allocations-on-multi-threaded-matrix-operations-caused-by-bigfloats/12697)

<div class="topic-metadata">

**Author:** [@DavidBerghaus](https://discourse.julialang.org/u/DavidBerghaus)\
**Replies:** 25\
**Last updated:** [August 18, 2018, 4:04pm UTC](https://discourse.julialang.org/t/allocations-on-multi-threaded-matrix-operations-caused-by-bigfloats/12697 "2018-08-18T16:04:27Z")

</div>

I wrote a small test code that changes matrix elements and stores them in the “old” matrix, so no new allocations should be made. I then compiled the code with @allocated to measure the allocations made: - func…

---

## [Varargs performance](https://discourse.julialang.org/t/varargs-performance/13578)

<div class="topic-metadata">

**Author:** [@alee](https://discourse.julialang.org/u/alee)\
**Replies:** 5\
**Last updated:** [August 18, 2018, 3:49pm UTC](https://discourse.julialang.org/t/varargs-performance/13578 "2018-08-18T15:49:10Z")

</div>

I’m experiencing some poor performance when using varargs. I can work around it by writing more code, but would really like to understand what the specific issue is. Here is an attempt at a minimal working example, indi…

---

## [Julia v1.0.0 - Semicolon and right-bracket prefixes not working in Jupyter notebook yet](https://discourse.julialang.org/t/julia-v1-0-0-semicolon-and-right-bracket-prefixes-not-working-in-jupyter-notebook-yet/13504)

<div class="topic-metadata">

**Author:** [@ronubi](https://discourse.julialang.org/u/ronubi)\
**Replies:** 10\
**Last updated:** [August 18, 2018, 12:10pm UTC](https://discourse.julialang.org/t/julia-v1-0-0-semicolon-and-right-bracket-prefixes-not-working-in-jupyter-notebook-yet/13504 "2018-08-18T12:10:14Z")

</div>

I realize that there are bound to be issues with the latest release, and that I may not have set up everything correctly with the new Pkg system, but I was pleasantly surprised that I could $ julia100 # my symlink for J…

---

## [Pkg can't load packages present in Manifest.toml?](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636)

<div class="topic-metadata">

**Author:** [@tlnagy](https://discourse.julialang.org/u/tlnagy)\
**Replies:** 11\
**Last updated:** [August 18, 2018, 11:08am UTC](https://discourse.julialang.org/t/pkg-cant-load-packages-present-in-manifest-toml/13636 "2018-08-18T11:08:08Z")

</div>

I was playing around with Julia 1.0 and noticed a weird behavior. Given I have an environment that looks like this (v1.0) pkg\> st Status \`~/.julia/environments/v1.0/Project.toml\` \[a81c6b42\] Compose v0.6.0+ \[\`~/.ju…

---

## [KeyError: key "repo-rev" not found (v0.7)](https://discourse.julialang.org/t/keyerror-key-repo-rev-not-found-v0-7/11777)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 12\
**Last updated:** [August 18, 2018, 10:26am UTC](https://discourse.julialang.org/t/keyerror-key-repo-rev-not-found-v0-7/11777 "2018-08-18T10:26:36Z")

</div>

Trying to run pkg\> status and I’m getting a very unclear error message. I assume something is not right with one of the dependencies, I have no idea which, what to do next or where the problem is. (Genie) pkg\> status Pr…

---

## [Unable to serialize SharedArrays](https://discourse.julialang.org/t/unable-to-serialize-sharedarrays/13646)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 3\
**Last updated:** [August 18, 2018, 5:58am UTC](https://discourse.julialang.org/t/unable-to-serialize-sharedarrays/13646 "2018-08-18T05:58:07Z")

</div>

I use Serialization.serialize() function to write julia objects on disk since I found it more efficient than other formats (like JLD2) and it’s for short term shortage so I can use the the same Julia runtime to read it b…

---

## [Error: Pkg.build("WinRPM")](https://discourse.julialang.org/t/error-pkg-build-winrpm/13626)

<div class="topic-metadata">

**Author:** [@wowotuo](https://discourse.julialang.org/u/wowotuo)\
**Replies:** 0\
**Last updated:** [August 17, 2018, 1:49pm UTC](https://discourse.julialang.org/t/error-pkg-build-winrpm/13626 "2018-08-17T13:49:41Z")

</div>

julia:1.0 win10 julia\> Pkg.build(“WinRPM”) Building LibCURL → C:\\Users\\wowotuo\\.julia\\packages\\LibCURL\\Qs5og\\deps\\build.log ┌ Error: Error building LibCURL: │ ʹ�á�2���������á�DownloadFile��ʱ�����쳣:���޷�l�ӵ�Զ�̷����� │…

---

## [Where T \<: Any](https://discourse.julialang.org/t/where-t-any/13592)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 8\
**Last updated:** [August 18, 2018, 12:27am UTC](https://discourse.julialang.org/t/where-t-any/13592 "2018-08-18T00:27:26Z")

</div>

I am trying to rewrite julia\> function permutations(v::Vector{T}) where T \<: Any nbase= length(v) results= Vector{Vector{T}}(0) for it=0:(nbase^nbase-1) …

---

## [How to apply a formula to a predefined dataframe's column](https://discourse.julialang.org/t/how-to-apply-a-formula-to-a-predefined-dataframes-column/13594)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 5\
**Last updated:** [August 18, 2018, 12:14am UTC](https://discourse.julialang.org/t/how-to-apply-a-formula-to-a-predefined-dataframes-column/13594 "2018-08-18T00:14:30Z")

</div>

input\_string = "3.0 + log(x1) + 5.0\*x2" my\_data = DataFrame(x1 = rand(10), x2 = rand(10)) function my\_function(df::DataFrame, formula::String) #want: 3 + log.(my\_data\[:x1\]) + 5.0\*my\_data\[:x2\] end Below I give an attem…

---

## [Converting Float64 into String but in scientific notation](https://discourse.julialang.org/t/converting-float64-into-string-but-in-scientific-notation/13644)

<div class="topic-metadata">

**Author:** [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Replies:** 3\
**Last updated:** [August 18, 2018, 12:09am UTC](https://discourse.julialang.org/t/converting-float64-into-string-but-in-scientific-notation/13644 "2018-08-18T00:09:06Z")

</div>

I’m trying to export some data onto a tex file. But, the numbers are often huge and I want to represent the using the scientific notation. I’ve been searching the forums for a solution, but couldn’t find one. What I exp…

---

## [Null function pointer in a function creaded with @eval](https://discourse.julialang.org/t/null-function-pointer-in-a-function-creaded-with-eval/13202)

<div class="topic-metadata">

**Author:** [@yutaka](https://discourse.julialang.org/u/yutaka)\
**Replies:** 7\
**Last updated:** [August 17, 2018, 11:22pm UTC](https://discourse.julialang.org/t/null-function-pointer-in-a-function-creaded-with-eval/13202 "2018-08-17T23:22:53Z")

</div>

I am trying to modify AMD.jl to support Julia 0.7.0. This is a wrapper package to call C functions using ccall. The function pointers are defined as follows. global const \_libamd = Libdl.dlopen("libamd") global const \_a…

---

## [Hot loop updating array elements with product over other array](https://discourse.julialang.org/t/hot-loop-updating-array-elements-with-product-over-other-array/13609)

<div class="topic-metadata">

**Author:** [@stst](https://discourse.julialang.org/u/stst)\
**Replies:** 15\
**Last updated:** [August 17, 2018, 10:05pm UTC](https://discourse.julialang.org/t/hot-loop-updating-array-elements-with-product-over-other-array/13609 "2018-08-17T22:05:22Z")

</div>

How can one improve performance of the following MWE (using 1.0.0)? function bg\_sim\_mwe(nB=100,nSamples=100) e = 0.9 p = 0.8 nt = 100 t = range(0,stop=5.0,length=nt) V(ph) = 1.0 - p + p\*(cos(ph) +…

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

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