# General Usage

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

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

**Page:** 897

---

## [Parsing times with microseconds](https://discourse.julialang.org/t/parsing-times-with-microseconds/20366)

<div class="topic-metadata">

**Author:** [@a5vzener](https://discourse.julialang.org/u/a5vzener)\
**Replies:** 0\
**Last updated:** [February 1, 2019, 9:20pm UTC](https://discourse.julialang.org/t/parsing-times-with-microseconds/20366 "2019-02-01T21:20:25Z")

</div>

I am trying to use Julia to analyze some disk I/O data. My Mac provides timestamps like 12:52:22.631949 I want to create a Time object but the extra microseconds (949) appear to cause the parser to choke. tf = DateFor…

---

## [With\_repetitions\_permutations v0.6 VS v1](https://discourse.julialang.org/t/with-repetitions-permutations-v0-6-vs-v1/20245)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 12\
**Last updated:** [February 1, 2019, 8:52pm UTC](https://discourse.julialang.org/t/with-repetitions-permutations-v0-6-vs-v1/20245 "2019-02-01T20:52:22Z")

</div>

Hello, I am trying to update to v1.0 the code with\_repetitions\_permutations found on rosettacode that was build for Julia v0.6. This function simply gives all possible permutations with repetition (function that I did…

---

## [Convert string to package name](https://discourse.julialang.org/t/convert-string-to-package-name/20355)

<div class="topic-metadata">

**Author:** [@b-han](https://discourse.julialang.org/u/b-han)\
**Replies:** 3\
**Last updated:** [February 1, 2019, 5:52pm UTC](https://discourse.julialang.org/t/convert-string-to-package-name/20355 "2019-02-01T17:52:58Z")

</div>

I’m trying to write a section of script that autonomously loads dependencies from a Julia package list. It is easy to deal with the Pkg.install part with: for pkg in PKG\_LIST if !in(pkg,keys(Pkg.installed())) …

---

## [Package warmup / SnoopCompile](https://discourse.julialang.org/t/package-warmup-snoopcompile/20266)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 6\
**Last updated:** [February 1, 2019, 12:08pm UTC](https://discourse.julialang.org/t/package-warmup-snoopcompile/20266 "2019-02-01T12:08:07Z")

</div>

Looking at SnoopCompile.jl I was wondering whether I could write a simple “hint” file that would pre-compile the standard paths in the program making loading the package a bit slower but hopefully the first call faster. …

---

## [Trivial code change causes vectorization failure](https://discourse.julialang.org/t/trivial-code-change-causes-vectorization-failure/20299)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 3\
**Last updated:** [February 1, 2019, 9:03am UTC](https://discourse.julialang.org/t/trivial-code-change-causes-vectorization-failure/20299 "2019-02-01T09:03:11Z")

</div>

I am porting a few approximate math functions that I’ve used before that vectorized well, but noticed that with Julia the direct translation fails to vectorize. However, a trivial change (expanding s = f \* f) makes Juli…

---

## [Error message on julia travis: symbol lookup error: MbedTLS undefined symbol](https://discourse.julialang.org/t/error-message-on-julia-travis-symbol-lookup-error-mbedtls-undefined-symbol/20317)

<div class="topic-metadata">

**Author:** [@konkam](https://discourse.julialang.org/u/konkam)\
**Replies:** 2\
**Last updated:** [January 31, 2019, 6:02pm UTC](https://discourse.julialang.org/t/error-message-on-julia-travis-symbol-lookup-error-mbedtls-undefined-symbol/20317 "2019-01-31T18:02:40Z")

</div>

Hello, I am currently getting an error on Travis that I cannot reproduce on my computer. All tests seem to pass, but the build on Travis finishes with: julia: symbol lookup error: /home/travis/.julia/packages/MbedTLS/X…

---

## [Reading '¤' separated value file with readdlm](https://discourse.julialang.org/t/reading-separated-value-file-with-readdlm/20305)

<div class="topic-metadata">

**Author:** [@plapplop](https://discourse.julialang.org/u/plapplop)\
**Replies:** 5\
**Last updated:** [January 31, 2019, 4:51pm UTC](https://discourse.julialang.org/t/reading-separated-value-file-with-readdlm/20305 "2019-01-31T16:51:00Z")

</div>

I was given a CSV file to study, it contains strings (words enclosed with ") separated by the currency sign '¤' (don’t ask me why…), and when I used readdlm to load its content, the first quote sign is considered to belo…

---

## [Confused about change in axes() for v1.1](https://discourse.julialang.org/t/confused-about-change-in-axes-for-v1-1/20318)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 1\
**Last updated:** [January 31, 2019, 4:18pm UTC](https://discourse.julialang.org/t/confused-about-change-in-axes-for-v1-1/20318 "2019-01-31T16:18:53Z")

</div>

I was surprised to see that I got a new error in 1.1 that did not occur in 1.0. The culprit was this change in axes: driscoll@~\\\> julia-1.0 \_ | | |\_| | | | (\_| | | Version 1.0.3 (2018-12-18) \_/ |\\\_\_'…

---

## [How to convert element type of a container?](https://discourse.julialang.org/t/how-to-convert-element-type-of-a-container/20293)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 5\
**Last updated:** [January 30, 2019, 11:56pm UTC](https://discourse.julialang.org/t/how-to-convert-element-type-of-a-container/20293 "2019-01-30T23:56:43Z")

</div>

Suppose I have a container, a, could be a Tuple, a Vector, or a user-defined subtype of AbstractArray. Now I want to convert every element of a to another type, e.g., from Ints to Float64. For example, I write a rough fu…

---

## [JULIA\_PKGDIR and Julia-0.7](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672)

<div class="topic-metadata">

**Author:** [@abobroff](https://discourse.julialang.org/u/abobroff)\
**Replies:** 17\
**Last updated:** [January 30, 2019, 10:57pm UTC](https://discourse.julialang.org/t/julia-pkgdir-and-julia-0-7/11672 "2019-01-30T22:57:59Z")

</div>

How do I assign my own directory for packages in Julia - 0.7.0 (analogue of the definition of JULIA\_PKGDIR in file juliars.jl for Julia-0.6)? Windows 8, 10.

---

## [Jupyter can't find Julia 1.0.3 Kernel in Windows](https://discourse.julialang.org/t/jupyter-cant-find-julia-1-0-3-kernel-in-windows/20276)

<div class="topic-metadata">

**Author:** [@Frank\_Kampas](https://discourse.julialang.org/u/Frank_Kampas)\
**Replies:** 11\
**Last updated:** [January 30, 2019, 9:03pm UTC](https://discourse.julialang.org/t/jupyter-cant-find-julia-1-0-3-kernel-in-windows/20276 "2019-01-30T21:03:25Z")

</div>

I get a long list of errors ending in “file not found” when I click on the kernel icon.

---

## [Selector syntax in the Cascadia package](https://discourse.julialang.org/t/selector-syntax-in-the-cascadia-package/20287)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 2\
**Last updated:** [January 30, 2019, 8:51pm UTC](https://discourse.julialang.org/t/selector-syntax-in-the-cascadia-package/20287 "2019-01-30T20:51:48Z")

</div>

I’m doing a bit of webscraping, patterned after that in the DataDepsGenerators package, using Gumbo and Cascadia. I don’t quite understand the syntax of the selector expressions in Cascadia and I haven’t been able to fi…

---

## [Question about deprecation of support for abstract arrays in distributions](https://discourse.julialang.org/t/question-about-deprecation-of-support-for-abstract-arrays-in-distributions/20289)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [January 30, 2019, 8:25pm UTC](https://discourse.julialang.org/t/question-about-deprecation-of-support-for-abstract-arrays-in-distributions/20289 "2019-01-30T20:25:06Z")

</div>

I work with a lot of custom distribution functions and it is often convenient and more performant to pass an array to the logpdf function rather than dot vectorization. The reason is that I can reuse intermediate calcul…

---

## [Websocket version 1.0 simple examples for local host](https://discourse.julialang.org/t/websocket-version-1-0-simple-examples-for-local-host/20238)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [January 30, 2019, 4:38pm UTC](https://discourse.julialang.org/t/websocket-version-1-0-simple-examples-for-local-host/20238 "2019-01-30T16:38:41Z")

</div>

Can someone please give me an easy example of this?

---

## [A(i,j) instead of A\[i,j\] leads to weird behavior](https://discourse.julialang.org/t/a-i-j-instead-of-a-i-j-leads-to-weird-behavior/20196)

<div class="topic-metadata">

**Author:** [@murphyk](https://discourse.julialang.org/u/murphyk)\
**Replies:** 5\
**Last updated:** [January 30, 2019, 3:31pm UTC](https://discourse.julialang.org/t/a-i-j-instead-of-a-i-j-leads-to-weird-behavior/20196 "2019-01-30T15:31:13Z")

</div>

Consider the code below. function dummy() A = zeros(2,2) for i=1:2 for j=1:2 A(i,j) = rand() # should be A\[i,j\] end end return A end It returns julia\> A=dummy() A (generic f…

---

## [JuliaDB - left join with string error](https://discourse.julialang.org/t/juliadb-left-join-with-string-error/20279)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 0\
**Last updated:** [January 30, 2019, 2:48pm UTC](https://discourse.julialang.org/t/juliadb-left-join-with-string-error/20279 "2019-01-30T14:48:12Z")

</div>

Hi all, I ran into an issue overnight in loading some data via JuliaDB where, with a left join on a common column in two tables, you can get an access to undefined reference exception with string columns being joined. I…

---

## [Recursive Iterators (or some other way to do this)](https://discourse.julialang.org/t/recursive-iterators-or-some-other-way-to-do-this/20216)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 2\
**Last updated:** [January 30, 2019, 2:29pm UTC](https://discourse.julialang.org/t/recursive-iterators-or-some-other-way-to-do-this/20216 "2019-01-30T14:29:57Z")

</div>

Hi, I am experimenting with some custom iterators, and I’m wondering why this particular construction does not work as I would think (it returns nothing): struct TreeNodeLeaves{T \<: TreeNode} node::T end function i…

---

## [Julia stand-alone app?](https://discourse.julialang.org/t/julia-stand-alone-app/20277)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [January 30, 2019, 2:20pm UTC](https://discourse.julialang.org/t/julia-stand-alone-app/20277 "2019-01-30T14:20:24Z")

</div>

I was thinking to develop some app to model the movement of cars on a road network. What I’d like to d is, I have several buildings and several cars on the map and I can use mouse to drag and drop the cars to certain loc…

---

## [Dynamic creation of similar structs](https://discourse.julialang.org/t/dynamic-creation-of-similar-structs/20247)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 11\
**Last updated:** [January 30, 2019, 1:24pm UTC](https://discourse.julialang.org/t/dynamic-creation-of-similar-structs/20247 "2019-01-30T13:24:55Z")

</div>

Julia does not permit such syntax but what I want is basically struct A{T, 2} x::T y::T end struct A{T, 3} x::T y::T z::T end struct A{T, 4} x::T y::T z::T w::T end i.e., the numb…

---

## [Segfault on exit](https://discourse.julialang.org/t/segfault-on-exit/19987)

<div class="topic-metadata">

**Author:** [@oyamad](https://discourse.julialang.org/u/oyamad)\
**Replies:** 1\
**Last updated:** [January 30, 2019, 1:24pm UTC](https://discourse.julialang.org/t/segfault-on-exit/19987 "2019-01-30T13:24:28Z")

</div>

I have written some code that adds new functionalities to a Julia library that wraps a C library. The code executes fine, in that it generates outcomes as expected, but on exit of Julia it leads to a segmentation fault w…

---

## [How does code integration in docs work?](https://discourse.julialang.org/t/how-does-code-integration-in-docs-work/20272)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 4\
**Last updated:** [January 30, 2019, 12:37pm UTC](https://discourse.julialang.org/t/how-does-code-integration-in-docs-work/20272 "2019-01-30T12:37:42Z")

</div>

Was just browsing the TimeSeries.jl docs (which are broken), in which code is integrated and somehow generated by actually running the code and putting both code and outputs inline. They seem to be using some sort of ma…

---

## [Slow insert at end of large array (Solved)](https://discourse.julialang.org/t/slow-insert-at-end-of-large-array-solved/20264)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 7\
**Last updated:** [January 30, 2019, 9:14am UTC](https://discourse.julialang.org/t/slow-insert-at-end-of-large-array-solved/20264 "2019-01-30T09:14:07Z")

</div>

Why is inserting an element at the end of an array (with enough room – as evidenced by the lack of allocations) so slow? julia\> a0 = repeat(\[1\], 10^9); julia\> @btime insert!(a,1,10^9 + 1) evals=1 setup=(a=sizehint!(dee…

---

## [How to programmatically access documentation for fields of a composite type?](https://discourse.julialang.org/t/how-to-programmatically-access-documentation-for-fields-of-a-composite-type/20160)

<div class="topic-metadata">

**Author:** [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Replies:** 10\
**Last updated:** [January 30, 2019, 7:54am UTC](https://discourse.julialang.org/t/how-to-programmatically-access-documentation-for-fields-of-a-composite-type/20160 "2019-01-30T07:54:40Z")

</div>

Assuming code like this: "This is a struct" struct Bla "it has a field" a\_field end bla = Bla(42) How do I access the documentation of Bla.a\_field from within a program (I know how to get it at the REPL)? I can…

---

## [Performance help for this short matrix function?](https://discourse.julialang.org/t/performance-help-for-this-short-matrix-function/20240)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 11\
**Last updated:** [January 30, 2019, 7:50am UTC](https://discourse.julialang.org/t/performance-help-for-this-short-matrix-function/20240 "2019-01-30T07:50:39Z")

</div>

I’m computing regularized optimal transport distances as described in https://papers.nips.cc/paper/4927-sinkhorn-distances-lightspeed-computation-of-optimal-transport.pdf The code is quite short: using LinearAlgebra f…

---

## [GR build issue](https://discourse.julialang.org/t/gr-build-issue/20259)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 2\
**Last updated:** [January 30, 2019, 5:56am UTC](https://discourse.julialang.org/t/gr-build-issue/20259 "2019-01-30T05:56:01Z")

</div>

Has anyone seen this GR build problem before? I got this on a user’s desktop running Windows 7. C a n n o t s t a r t W i n d o w s P o w e r S h e l l v e r s i o n 3 b e c a u s e i t i s n o t c …

---

## [Loading custom models: dynamic code evaluation?](https://discourse.julialang.org/t/loading-custom-models-dynamic-code-evaluation/20258)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 5\
**Last updated:** [January 30, 2019, 5:52am UTC](https://discourse.julialang.org/t/loading-custom-models-dynamic-code-evaluation/20258 "2019-01-30T05:52:40Z")

</div>

I’m trying to implement the following or similar architecture, and would really like to hear some advice on how to do it correctly/better/… Basically, there is going to be many user-defined models, which I think are rea…

---

## [Working with ASTs](https://discourse.julialang.org/t/working-with-asts/19646)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 65\
**Last updated:** [January 30, 2019, 3:44am UTC](https://discourse.julialang.org/t/working-with-asts/19646 "2019-01-30T03:44:57Z")

</div>

Hello all, For Soss.jl I’d like a cleaner way of manipulating and reasoning about ASTs. Currently a Model is nearly just an expression: hello = @model μ begin σ ~ HalfCauchy() x ~ Normal(μ, σ) end builds juli…

---

## [Is there a way to update a column of a dataframe to an array in julia?](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 4\
**Last updated:** [January 30, 2019, 3:29am UTC](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244 "2019-01-30T03:29:34Z")

</div>

this seems easy, but I can not find any answers. can anyone please let me know?

---

## [Calling guard function causes millions of allocs while running inner function doesn't](https://discourse.julialang.org/t/calling-guard-function-causes-millions-of-allocs-while-running-inner-function-doesnt/20228)

<div class="topic-metadata">

**Author:** [@ShnitzelKiller](https://discourse.julialang.org/u/ShnitzelKiller)\
**Replies:** 4\
**Last updated:** [January 30, 2019, 1:16am UTC](https://discourse.julialang.org/t/calling-guard-function-causes-millions-of-allocs-while-running-inner-function-doesnt/20228 "2019-01-30T01:16:46Z")

</div>

I’ve followed the performance tips to implement a function guard for setting up objects to be accessed in the inner loop of an algorithm, as follows: function fast\_marching!(grid::Matrix{T}, h::Real, maxdist::Real=1) wh…

---

## [Having a problem with macros](https://discourse.julialang.org/t/having-a-problem-with-macros/20249)

<div class="topic-metadata">

**Author:** [@threadedblue](https://discourse.julialang.org/u/threadedblue)\
**Replies:** 1\
**Last updated:** [January 29, 2019, 11:39pm UTC](https://discourse.julialang.org/t/having-a-problem-with-macros/20249 "2019-01-29T23:39:45Z")

</div>

All, I appear not to be understanding macros. Question: Why is my variable not being resolved when it’s called from within a macro? Thanks in advance Here is my macro: macro SW1(criteria) return println(""" "$c…

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

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