# General Usage

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

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

**Page:** 719

---

## [Quoting special characters of a url in Cmd objects on Windows](https://discourse.julialang.org/t/quoting-special-characters-of-a-url-in-cmd-objects-on-windows/44324)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 5\
**Last updated:** [August 5, 2020, 1:26pm UTC](https://discourse.julialang.org/t/quoting-special-characters-of-a-url-in-cmd-objects-on-windows/44324 "2020-08-05T13:26:18Z")

</div>

To open a webpage using the default browser in the Windows command line you can use: \> start https://www.google.com/ This works from Julia too if you prefix it with cmd /c: julia\> run(\`cmd /c start https://www.google.…

---

## [Circular buffer package?](https://discourse.julialang.org/t/circular-buffer-package/44041)

<div class="topic-metadata">

**Author:** [@lwabeke](https://discourse.julialang.org/u/lwabeke)\
**Replies:** 3\
**Last updated:** [August 5, 2020, 12:45pm UTC](https://discourse.julialang.org/t/circular-buffer-package/44041 "2020-08-05T12:45:08Z")

</div>

I am working on some code that processes vectors of data of length 6000 elements. When I detect specific criteria, I want to reprocess the last 100 vectors to extract finer details. Thus I want to store the data in a for…

---

## [Abstract methods: pattern](https://discourse.julialang.org/t/abstract-methods-pattern/44327)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 2\
**Last updated:** [August 5, 2020, 12:31pm UTC](https://discourse.julialang.org/t/abstract-methods-pattern/44327 "2020-08-05T12:31:12Z")

</div>

I want to create a “module general” which provides an abstract type (fruit), to be subtyped in another “module specific”. In the “module general”, I want to provide operations on fruit in general, but which hae to rely …

---

## [Can I set @optlevel as a user per module or per function?](https://discourse.julialang.org/t/can-i-set-optlevel-as-a-user-per-module-or-per-function/44192)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 10\
**Last updated:** [August 5, 2020, 12:27pm UTC](https://discourse.julialang.org/t/can-i-set-optlevel-as-a-user-per-module-or-per-function/44192 "2020-08-05T12:27:11Z")

</div>

Specifically, I’m playing with rapidly updating plots in a Pluto environment and would like to increase the level of optimizations applied to Plots.jl as a user to see if it changes update rates.

---

## [@code\_warntype, for loops and spurious Union types](https://discourse.julialang.org/t/code-warntype-for-loops-and-spurious-union-types/44318)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 5\
**Last updated:** [August 5, 2020, 11:08am UTC](https://discourse.julialang.org/t/code-warntype-for-loops-and-spurious-union-types/44318 "2020-08-05T11:08:02Z")

</div>

If I define some function that includes a for loop and run @code\_warntype on it: function f() for i in 1:10 i end return end @code\_warntype f() The variables listed always contain a Union type: V…

---

## [Import XLSX data](https://discourse.julialang.org/t/import-xlsx-data/44302)

<div class="topic-metadata">

**Author:** [@dty](https://discourse.julialang.org/u/dty)\
**Replies:** 13\
**Last updated:** [August 5, 2020, 8:55am UTC](https://discourse.julialang.org/t/import-xlsx-data/44302 "2020-08-05T08:55:12Z")

</div>

using XLSX Cs=XLSX.readdata("E:\\\\Julia程序\\\\Cs.xlsx","Sheet1","A1:C24") The above is my code for importing xlsx file (), which is the data type of array (any, 2) and cannot be directly operated with matrix. How can I impo…

---

## [Data Races](https://discourse.julialang.org/t/data-races/44185)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 6\
**Last updated:** [August 5, 2020, 8:55am UTC](https://discourse.julialang.org/t/data-races/44185 "2020-08-05T08:55:05Z")

</div>

The updated multithreading docs for v"1.5" says in section “Data-race freedom”: … Additionally, Julia is not memory safe in the presence of a data race. Be very careful about reading a global variable (or closure var…

---

## [Capturing stdout/stderr from Pkg.test](https://discourse.julialang.org/t/capturing-stdout-stderr-from-pkg-test/44307)

<div class="topic-metadata">

**Author:** [@felipenoris](https://discourse.julialang.org/u/felipenoris)\
**Replies:** 1\
**Last updated:** [August 5, 2020, 5:26am UTC](https://discourse.julialang.org/t/capturing-stdout-stderr-from-pkg-test/44307 "2020-08-05T05:26:09Z")

</div>

Is it possible to call Pkg.test and make it capture all the output from the test process? I’m trying something like the code below, but the tests run in a sandbox so I guess that’s why I’m unable to capture the output. …

---

## [Interactive Tables with IJulia?](https://discourse.julialang.org/t/interactive-tables-with-ijulia/11793)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 1\
**Last updated:** [August 5, 2020, 2:00am UTC](https://discourse.julialang.org/t/interactive-tables-with-ijulia/11793 "2020-08-05T02:00:43Z")

</div>

I was looking for a way to have interactive tables in IJulia, and stumbled over this: https://github.com/quantopian/qgrid I wonder if IJulia bindings for the Qgrid widget would be possible? Or maybe something similar v…

---

## [Needs help to build LoopTools using BinaryBuilder](https://discourse.julialang.org/t/needs-help-to-build-looptools-using-binarybuilder/44260)

<div class="topic-metadata">

**Author:** [@fkguo](https://discourse.julialang.org/u/fkguo)\
**Replies:** 10\
**Last updated:** [August 5, 2020, 12:11am UTC](https://discourse.julialang.org/t/needs-help-to-build-looptools-using-binarybuilder/44260 "2020-08-05T00:11:28Z")

</div>

Hello, There is a package called LoopTools, for which I succeeded in building a .so shared lib locally that I can call in julia. Now I am trying to build it using BinaryBuilder.jl with the following code that was modif…

---

## [IJulia cannot connect to server](https://discourse.julialang.org/t/ijulia-cannot-connect-to-server/44279)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 1\
**Last updated:** [August 4, 2020, 7:08pm UTC](https://discourse.julialang.org/t/ijulia-cannot-connect-to-server/44279 "2020-08-04T19:08:20Z")

</div>

I am having trouble connecting to the notebook server with IJulia. When I type notebook(), IJulia starts in the browser. However, when I open a new file, it indicates “Connecting to kernel” at the top. After a few minute…

---

## [Passing function type parameters to a macro](https://discourse.julialang.org/t/passing-function-type-parameters-to-a-macro/44274)

<div class="topic-metadata">

**Author:** [@Alex\_Ellison](https://discourse.julialang.org/u/Alex_Ellison)\
**Replies:** 2\
**Last updated:** [August 4, 2020, 5:40pm UTC](https://discourse.julialang.org/t/passing-function-type-parameters-to-a-macro/44274 "2020-08-04T17:40:45Z")

</div>

Hey all, I would like to use macros to generate functions with different bodies based on the function’s type parameters. @generated is not an option since ultimately these need to work with CUDA.jl (as far as I can tell…

---

## [Best way of \`using\` without bring names into scope?](https://discourse.julialang.org/t/best-way-of-using-without-bring-names-into-scope/44272)

<div class="topic-metadata">

**Author:** [@afbarnard](https://discourse.julialang.org/u/afbarnard)\
**Replies:** 7\
**Last updated:** [August 4, 2020, 4:54pm UTC](https://discourse.julialang.org/t/best-way-of-using-without-bring-names-into-scope/44272 "2020-08-04T16:54:16Z")

</div>

Is there a way to use a module without bringing its names into scope? I don’t need to extend any methods. Specifically, using A brings type Foo into scope, but other code already defines Foo, so there is a name ambiguit…

---

## [Threading usage patterns: Worker pools for Agents.jl and SQLite.jl](https://discourse.julialang.org/t/threading-usage-patterns-worker-pools-for-agents-jl-and-sqlite-jl/44232)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 1\
**Last updated:** [August 4, 2020, 2:02pm UTC](https://discourse.julialang.org/t/threading-usage-patterns-worker-pools-for-agents-jl-and-sqlite-jl/44232 "2020-08-04T14:02:45Z")

</div>

I’ve got some code where I spawn off a thread to handle SQLite interaction, and then spawn off 4 threads to handle running Agents.jl simulations. My main function then goes and grabs a simulation description Tuple, put!…

---

## [PackageCompiler fails on example, windows/mingw](https://discourse.julialang.org/t/packagecompiler-fails-on-example-windows-mingw/44210)

<div class="topic-metadata">

**Author:** [@smthzch](https://discourse.julialang.org/u/smthzch)\
**Replies:** 1\
**Last updated:** [August 4, 2020, 2:36pm UTC](https://discourse.julialang.org/t/packagecompiler-fails-on-example-windows-mingw/44210 "2020-08-04T14:36:48Z")

</div>

I am getting an error from mingw of missing files when running create\_app on the demo application for PackageCompiler found MyApp Specifically: julia\> using PackageCompiler julia\> create\_app("MyApp", "MyCompiledApp") …

---

## [Stochastic Differential Equations -- basic question](https://discourse.julialang.org/t/stochastic-differential-equations-basic-question/44200)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [August 4, 2020, 1:26pm UTC](https://discourse.julialang.org/t/stochastic-differential-equations-basic-question/44200 "2020-08-04T13:26:20Z")

</div>

I’m making my first attempt of Stochastic Differential Equations using a SIR model, and follow the stochastic formulation described in Keeling and Rohani (2008): Modeling Infectious Diseases in Humans and Animals, Prince…

---

## [Module to use Int32](https://discourse.julialang.org/t/module-to-use-int32/43389)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 14\
**Last updated:** [August 4, 2020, 12:26pm UTC](https://discourse.julialang.org/t/module-to-use-int32/43389 "2020-08-04T12:26:21Z")

</div>

I have a discrete event simulation model in which all outcome values are integer. Currently, it defaults to Int64. Let’s say I want that to be Int32 (or even Int16) as outcome values must always be well under 2e9. Int ar…

---

## [Question about my data](https://discourse.julialang.org/t/question-about-my-data/44237)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 23\
**Last updated:** [August 4, 2020, 10:20am UTC](https://discourse.julialang.org/t/question-about-my-data/44237 "2020-08-04T10:20:58Z")

</div>

using CSV,Clustering,Statistics,DataFrames,TimeSeries,MarketData data=CSV.read("E:\\\\测试数据\\\\huizong15min.csv") heping\_1MX\_V\_35kV=convert(Array,data\[:,3\]) xiangshan\_1MX\_V\_35kV=convert(Array,data\[:,4\]) dafeng\_1MX\_V\_110kV=co…

---

## [Append rows to a JuliaDB table on disk](https://discourse.julialang.org/t/append-rows-to-a-juliadb-table-on-disk/44071)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 1\
**Last updated:** [August 4, 2020, 9:33am UTC](https://discourse.julialang.org/t/append-rows-to-a-juliadb-table-on-disk/44071 "2020-08-04T09:33:38Z")

</div>

I have streaming structured data that I’d like to write to disk either row-by-row or with a small amount of buffering. Is JuliaDB appropriate for this? I ultimately will want to do some data manipulation on the resulti…

---

## [Compare permutaion of two numbers efficiently?](https://discourse.julialang.org/t/compare-permutaion-of-two-numbers-efficiently/44195)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 32\
**Last updated:** [August 4, 2020, 9:12am UTC](https://discourse.julialang.org/t/compare-permutaion-of-two-numbers-efficiently/44195 "2020-08-04T09:12:20Z")

</div>

I’m trying to compare two numbers to check if they have identical digits but in different orders. I extracted the digits and sorted them, then I compare the two extracted vectors to check equality. This works fine, but I…

---

## [Does Julia has bitwise circular shift?](https://discourse.julialang.org/t/does-julia-has-bitwise-circular-shift/44220)

<div class="topic-metadata">

**Author:** [@Lucas\_Queiroz](https://discourse.julialang.org/u/Lucas_Queiroz)\
**Replies:** 6\
**Last updated:** [August 4, 2020, 7:28am UTC](https://discourse.julialang.org/t/does-julia-has-bitwise-circular-shift/44220 "2020-08-04T07:28:09Z")

</div>

This documentation page lists the logical and arithmetic shift, as well as the bitwise NOT, AND, OR and XOR. However, the circular shift is absent. Does Julia has a bitwise circular shift? If yes, where can I find it’s …

---

## [Why do we need both Base.view and Base.@view?](https://discourse.julialang.org/t/why-do-we-need-both-base-view-and-base-view/44219)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 13\
**Last updated:** [August 4, 2020, 2:54am UTC](https://discourse.julialang.org/t/why-do-we-need-both-base-view-and-base-view/44219 "2020-08-04T02:54:57Z")

</div>

There seems to be a big overlap in functionality of Base.view and Base.@view : a = collect(1:9) b = view(a, 3:6) c = @view a\[3:6\] b\[1\] = 0 c\[1\] = 3 b .= 7 c .= 1 sum(b) sum(c) Why do we need both?

---

## [Cleaning up old versions](https://discourse.julialang.org/t/cleaning-up-old-versions/44215)

<div class="topic-metadata">

**Author:** [@raoulg](https://discourse.julialang.org/u/raoulg)\
**Replies:** 3\
**Last updated:** [August 3, 2020, 11:26pm UTC](https://discourse.julialang.org/t/cleaning-up-old-versions/44215 "2020-08-03T23:26:10Z")

</div>

I’m kind of new to Julia and just updated to version 1.5 I noticed that my packages need to be reinstalled (eg \] add Plots). If I go to ~/.julia, there is almost 2GBs of data, mainly in ~/.julia/conda and ~/.julia/pack…

---

## [@Distributed: On worker 2 UndefVarError {{Module}}](https://discourse.julialang.org/t/distributed-on-worker-2-undefvarerror-module/42773)

<div class="topic-metadata">

**Author:** [@ok\_ok](https://discourse.julialang.org/u/ok_ok)\
**Replies:** 8\
**Last updated:** [July 14, 2020, 10:07am UTC](https://discourse.julialang.org/t/distributed-on-worker-2-undefvarerror-module/42773 "2020-07-14T10:07:29Z")

</div>

Hello, i want to run a for loop in parallel but using Threads.threads just made the Programm slower so i wanted to try @distributed module MyModule export start, loop\_inner, rec function start() return rec(...) en…

---

## [Aliasing structs breaks type stability](https://discourse.julialang.org/t/aliasing-structs-breaks-type-stability/44206)

<div class="topic-metadata">

**Author:** [@louie4825](https://discourse.julialang.org/u/louie4825)\
**Replies:** 2\
**Last updated:** [August 3, 2020, 5:02pm UTC](https://discourse.julialang.org/t/aliasing-structs-breaks-type-stability/44206 "2020-08-03T17:02:33Z")

</div>

Hi. I’ve defined some parametric structs like those defined in the Performance Tips section of the Julia manual. Since some of the structs had quite long names, I decided to alias them. I was struggling to wrap my head …

---

## [Is "include" safe to use inside a function?](https://discourse.julialang.org/t/is-include-safe-to-use-inside-a-function/10867)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 43\
**Last updated:** [August 3, 2020, 4:03pm UTC](https://discourse.julialang.org/t/is-include-safe-to-use-inside-a-function/10867 "2020-08-03T16:03:02Z")

</div>

Is the following safe to do? #testinclude.jl a = 2 julia\> function f() include("testinclude.jl") return a end f (generic function with 1 method) julia\> f() 2

---

## [\[solved\] Agents.jl spending 3/4 of its time doing something before it even starts to compute?](https://discourse.julialang.org/t/solved-agents-jl-spending-3-4-of-its-time-doing-something-before-it-even-starts-to-compute/44109)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 11\
**Last updated:** [August 3, 2020, 3:58pm UTC](https://discourse.julialang.org/t/solved-agents-jl-spending-3-4-of-its-time-doing-something-before-it-even-starts-to-compute/44109 "2020-08-03T15:58:41Z")

</div>

I’m running a simulation with 10000 agents in a continuous space. Even 4 time steps takes minutes… Netlogo can do a similar thing in milliseconds. So of course I hit the profiler: 131╎131 @Base/dict.jl:279; ht\_key…

---

## [Idiomatic way to specialise method over array shape/dims](https://discourse.julialang.org/t/idiomatic-way-to-specialise-method-over-array-shape-dims/44131)

<div class="topic-metadata">

**Author:** [@Plop](https://discourse.julialang.org/u/Plop)\
**Replies:** 8\
**Last updated:** [August 3, 2020, 2:58pm UTC](https://discourse.julialang.org/t/idiomatic-way-to-specialise-method-over-array-shape-dims/44131 "2020-08-03T14:58:54Z")

</div>

It seems that array dimensions is not included in the type definition (which is really reasonable). I was wondering if there was a mechanism in Julia to force method specialisation based on array dimensions. Typically, …

---

## [Help to check if an element in a Tables.jl is defined](https://discourse.julialang.org/t/help-to-check-if-an-element-in-a-tables-jl-is-defined/44110)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 6\
**Last updated:** [August 3, 2020, 2:12pm UTC](https://discourse.julialang.org/t/help-to-check-if-an-element-in-a-tables-jl-is-defined/44110 "2020-08-03T14:12:02Z")

</div>

Hi! I am trying to print tables that comply with Tables.jl specification. However, this tables can have undefined elements, such as: julia\> df = DataFrame(B=Int64.(1:9), A = Vector{Any}(undef, 9)) I am having a proble…

---

## [Ubuntu archive not updating?](https://discourse.julialang.org/t/ubuntu-archive-not-updating/44188)

<div class="topic-metadata">

**Author:** [@ldsands](https://discourse.julialang.org/u/ldsands)\
**Replies:** 3\
**Last updated:** [August 3, 2020, 1:59pm UTC](https://discourse.julialang.org/t/ubuntu-archive-not-updating/44188 "2020-08-03T13:59:14Z")

</div>

Hello everyone, Index of /ubuntu/pool/universe/j/julia which houses the Julia binaries that is used by apt-get on ubuntu has not been updated since April. Is there a reason for this? I figured I’d post this here first a…

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

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