# General Usage

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

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

**Page:** 1009

---

## [View way slower than copy?](https://discourse.julialang.org/t/view-way-slower-than-copy/7722)

<div class="topic-metadata">

**Author:** [@tlnagy](https://discourse.julialang.org/u/tlnagy)\
**Replies:** 7\
**Last updated:** [December 14, 2017, 12:39pm UTC](https://discourse.julialang.org/t/view-way-slower-than-copy/7722 "2017-12-14T12:39:24Z")

</div>

I’m trying to compute the median of a 3D image along the :position axis, but I found copying the slice is way faster than a view? Why is that? The two functions below are identical expect for one has a copy operation ver…

---

## [Concise multiple do-block](https://discourse.julialang.org/t/concise-multiple-do-block/7736)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 5\
**Last updated:** [December 14, 2017, 11:18am UTC](https://discourse.julialang.org/t/concise-multiple-do-block/7736 "2017-12-14T11:18:13Z")

</div>

Hello, Is there a concise way of opening multiple files simultaneously in a do-block construct? This only to save indents, really. open("one") do fd1 open("two") do fd2 open("out", "w") do out ## …

---

## [Is there a name in \`Base\` for \`f-\>(x-\>f(x...))\`](https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [December 14, 2017, 10:43am UTC](https://discourse.julialang.org/t/is-there-a-name-in-base-for-f-x-f-x/7761 "2017-12-14T10:43:26Z")

</div>

Sometimes I need to transform functions that take multiple arguments into one which takes a tuple. Eg g does this below: julia\> g(f) = x-\>f(x...) g (generic function with 1 method) julia\> f(a,b,c) = a + b + c f (generi…

---

## [Error building IJulia under 0.7 master](https://discourse.julialang.org/t/error-building-ijulia-under-0-7-master/7760)

<div class="topic-metadata">

**Author:** [@merl-dev](https://discourse.julialang.org/u/merl-dev)\
**Replies:** 4\
**Last updated:** [December 14, 2017, 10:40am UTC](https://discourse.julialang.org/t/error-building-ijulia-under-0-7-master/7760 "2017-12-14T10:40:54Z")

</div>

The suggested fix does not help. \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: https://docs.julialang.org \_ \_ \_| |\_ \_\_ \_ | Type "?help" for help. |…

---

## [A question on hashes](https://discourse.julialang.org/t/a-question-on-hashes/7742)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 3\
**Last updated:** [December 14, 2017, 10:04am UTC](https://discourse.julialang.org/t/a-question-on-hashes/7742 "2017-12-14T10:04:13Z")

</div>

For an algorithm of mine, I am looking at hashes in order to reset (srand) the random number generator. Now if I am iteratively applying hash, i.e. hash(x,hash(y,hash(z,hash(a)))). But the results seem to differ even th…

---

## [Registering new package with METADATA.jl](https://discourse.julialang.org/t/registering-new-package-with-metadata-jl/7758)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 5\
**Last updated:** [December 14, 2017, 9:35am UTC](https://discourse.julialang.org/t/registering-new-package-with-metadata-jl/7758 "2017-12-14T09:35:24Z")

</div>

Hi, I’m trying to register a new package for online prediction to metadata. I’m using attobot for registration, and after I tagged v0.1.0, attobot opened a PR(https://github.com/JuliaLang/METADATA.jl/pull/12470). Even t…

---

## [Strange interaction between \`Channel()\` and pipes](https://discourse.julialang.org/t/strange-interaction-between-channel-and-pipes/7623)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 7\
**Last updated:** [December 14, 2017, 9:33am UTC](https://discourse.julialang.org/t/strange-interaction-between-channel-and-pipes/7623 "2017-12-14T09:33:47Z")

</div>

Hello, I am trying to make a generator for reading a list of \`files’, where a file may be an actual file or a subprocess. For the interface it is nice if the result can be a file descriptor, as the interpretation of th…

---

## [Git and Pkg3](https://discourse.julialang.org/t/git-and-pkg3/7739)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [December 13, 2017, 6:22pm UTC](https://discourse.julialang.org/t/git-and-pkg3/7739 "2017-12-13T18:22:47Z")

</div>

This is not an issue, but a usage question about Pkg3, so even though it is work in progress I hope it is OK to ask here. My understanding is that one of the great innovations of Pkg3 is that it does not need to clone r…

---

## [HTTPParser](https://discourse.julialang.org/t/httpparser/7738)

<div class="topic-metadata">

**Author:** [@xanmartini](https://discourse.julialang.org/u/xanmartini)\
**Replies:** 1\
**Last updated:** [December 13, 2017, 1:22pm UTC](https://discourse.julialang.org/t/httpparser/7738 "2017-12-13T13:22:24Z")

</div>

Hello everyone… I’m having some issues with HttpParser… The following error is displayed … INFO: Building HttpParser INFO: Attempting to create directory /home/alexandre/.julia/v0.6/HttpParser/deps/downloads INFO: Dir…

---

## [How to lock a file?](https://discourse.julialang.org/t/how-to-lock-a-file/7735)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 0\
**Last updated:** [December 13, 2017, 10:35am UTC](https://discourse.julialang.org/t/how-to-lock-a-file/7735 "2017-12-13T10:35:08Z")

</div>

How to lock a file from julia? This came up here.

---

## [Mistake in the \`SubArray\` doc?](https://discourse.julialang.org/t/mistake-in-the-subarray-doc/7732)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 2\
**Last updated:** [December 13, 2017, 7:46am UTC](https://discourse.julialang.org/t/mistake-in-the-subarray-doc/7732 "2017-12-13T07:46:46Z")

</div>

I’m looking at this section where A is a Array{Float64, 3} and S1 = view(A, :, 5, 2:6). I’m then confused by the explanation follows: If in our example above A is a Array{Float64, 3}, our S1 case above would be a SubAr…

---

## [Stand alone binary executable](https://discourse.julialang.org/t/stand-alone-binary-executable/5026)

<div class="topic-metadata">

**Author:** [@alfred](https://discourse.julialang.org/u/alfred)\
**Replies:** 19\
**Last updated:** [December 12, 2017, 6:59pm UTC](https://discourse.julialang.org/t/stand-alone-binary-executable/5026 "2017-12-12T18:59:07Z")

</div>

Hello, I usually have pyInstaller in hand to help me out with the distribution of my Python projects. It also allows me some sort of protection with my commercial Python scripts (my company keeps the source code private…

---

## [Memory allocations are not very understandable](https://discourse.julialang.org/t/memory-allocations-are-not-very-understandable/7696)

<div class="topic-metadata">

**Author:** [@rvlander](https://discourse.julialang.org/u/rvlander)\
**Replies:** 26\
**Last updated:** [December 12, 2017, 4:34pm UTC](https://discourse.julialang.org/t/memory-allocations-are-not-very-understandable/7696 "2017-12-12T16:34:28Z")

</div>

I am having a hard time understanding how memory is managed by Julia. Why do the following lines allocate memory at all? - function winsMilestone(topSide, bottomSide, justPlayedCard::Player) 827581056 if (…

---

## [How to filter keys of a dictionary without depwarn?](https://discourse.julialang.org/t/how-to-filter-keys-of-a-dictionary-without-depwarn/7711)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 2\
**Last updated:** [December 12, 2017, 4:17pm UTC](https://discourse.julialang.org/t/how-to-filter-keys-of-a-dictionary-without-depwarn/7711 "2017-12-12T16:17:59Z")

</div>

How to filter keys of a dictionary without depwarn? julia\> using Iterators; Iterators.filter(iseven, keys(Dict())) WARNING: filter(flt, itr) is deprecated, use Iterators.filter(flt, itr) instead.

---

## [V = \[1,2,3\]; v .== v' returns boolean matrix?](https://discourse.julialang.org/t/v-1-2-3-v-v-returns-boolean-matrix/7707)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 3\
**Last updated:** [December 12, 2017, 2:46pm UTC](https://discourse.julialang.org/t/v-1-2-3-v-v-returns-boolean-matrix/7707 "2017-12-12T14:46:26Z")

</div>

I find this a bit weird. julia\> v = \[1,2,3\]; v .== v' 3×3 BitArray{2}: true false false false true false false false true Why this returns a matrix? I’d expect a simple vector.

---

## [Problem with permuting dimensions of multi dimensional arrays](https://discourse.julialang.org/t/problem-with-permuting-dimensions-of-multi-dimensional-arrays/7692)

<div class="topic-metadata">

**Author:** [@maxtremblay](https://discourse.julialang.org/u/maxtremblay)\
**Replies:** 7\
**Last updated:** [December 12, 2017, 2:46pm UTC](https://discourse.julialang.org/t/problem-with-permuting-dimensions-of-multi-dimensional-arrays/7692 "2017-12-12T14:46:22Z")

</div>

Hello, I have a problem when I want to reshape and permute dimensions of an array of 2^16 elements that doesn’t appear with an array of 2^n elements with n \< 16. Does someone have an idea of the source of the problem? …

---

## [Can you get a deeper look into an \`include\` catch\_stacktrace()?](https://discourse.julialang.org/t/can-you-get-a-deeper-look-into-an-include-catch-stacktrace/7703)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 0\
**Last updated:** [December 12, 2017, 9:43am UTC](https://discourse.julialang.org/t/can-you-get-a-deeper-look-into-an-include-catch-stacktrace/7703 "2017-12-12T09:43:54Z")

</div>

If you do something like: include("file\_with\_missing\_dependency.jl") you get a warning like: ERROR: LoadError: LoadError: UndefVarError: SomeUnloadedVar not defined Stacktrace: \[1\] include\_from\_node1(::String) at ./l…

---

## [Imap (from IterTools.jl) doesn't preserve type](https://discourse.julialang.org/t/imap-from-itertools-jl-doesnt-preserve-type/7683)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 6\
**Last updated:** [December 12, 2017, 8:28am UTC](https://discourse.julialang.org/t/imap-from-itertools-jl-doesnt-preserve-type/7683 "2017-12-12T08:28:50Z")

</div>

Hello, I don’t really know if that a bug or a limitation but imap from IterTools.jl doesn’t preserve type julia\> itr = imap(x-\>2\*x, 1:10) julia\> collect(itr) 10-element Array{Any,1}: 2 4 6 8 10 12 14 16 18…

---

## [Unrecommended style of programming in Julia for type stability?](https://discourse.julialang.org/t/unrecommended-style-of-programming-in-julia-for-type-stability/7672)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 17\
**Last updated:** [December 12, 2017, 2:48am UTC](https://discourse.julialang.org/t/unrecommended-style-of-programming-in-julia-for-type-stability/7672 "2017-12-12T02:48:06Z")

</div>

In light of performance of captured variables in closures · Issue #15276 · JuliaLang/julia · GitHub, is the following style of programming generally despised in Julia, or is it expected to be fixed in some future version…

---

## [Saving current julia/package information for reproducible research](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505)

<div class="topic-metadata">

**Author:** [@bisraelsen](https://discourse.julialang.org/u/bisraelsen)\
**Replies:** 7\
**Last updated:** [December 12, 2017, 2:38am UTC](https://discourse.julialang.org/t/saving-current-julia-package-information-for-reproducible-research/505 "2017-12-12T02:38:16Z")

</div>

Hi all does anyone have a “best practice” for archiving the current julia package state for the purposes of reproducible research. What I have in mind is being able to save off a file with the required packages and asso…

---

## [Alternative to tic() and toc()](https://discourse.julialang.org/t/alternative-to-tic-and-toc/7693)

<div class="topic-metadata">

**Author:** [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Replies:** 5\
**Last updated:** [December 11, 2017, 6:51pm UTC](https://discourse.julialang.org/t/alternative-to-tic-and-toc/7693 "2017-12-11T18:51:54Z")

</div>

What’s an easy-to-type alternative to tic() and toc(), for timing a sequence of commands (or anything else, really), which are disappearing soon? Sort of like this: julia-0.6\> t = now() 2017-12-11T16:11:31.365 ... ...…

---

## [Mutable structs in parallel, is this a bug?](https://discourse.julialang.org/t/mutable-structs-in-parallel-is-this-a-bug/7694)

<div class="topic-metadata">

**Author:** [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Replies:** 2\
**Last updated:** [December 11, 2017, 6:30pm UTC](https://discourse.julialang.org/t/mutable-structs-in-parallel-is-this-a-bug/7694 "2017-12-11T18:30:53Z")

</div>

Hello, I ran into this today, if you have a module with a mutable struct: module container2 export cont2 mutable struct cont2 a end end When the fields of the mutable struct are changed on the master node, this chang…

---

## [Performant creation of vector of SVectors given a known formula](https://discourse.julialang.org/t/performant-creation-of-vector-of-svectors-given-a-known-formula/7648)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 17\
**Last updated:** [December 11, 2017, 1:22pm UTC](https://discourse.julialang.org/t/performant-creation-of-vector-of-svectors-given-a-known-formula/7648 "2017-12-11T13:22:32Z")

</div>

I want to create a vector of SVectors. I have to create all SVectors on the spot, given a formula that I know, and given also the dimensionality I know. The dimensionality can also be type-parameter, there is no problem …

---

## [Precision and adding](https://discourse.julialang.org/t/precision-and-adding/7690)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 5\
**Last updated:** [December 11, 2017, 12:35pm UTC](https://discourse.julialang.org/t/precision-and-adding/7690 "2017-12-11T12:35:23Z")

</div>

I am using Julia .6.1 and get a odd result when adding across columns of an array with specific values. Consider: x = \[.10 .20;.10 .30\] x\[:,1\] + x\[:,2\] Output: Float64\[2\] 0.30000000000000004 0.400 Julia .5 provides …

---

## [Query.jl: "type UnionAll has no field parameters"](https://discourse.julialang.org/t/query-jl-type-unionall-has-no-field-parameters/7673)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 1\
**Last updated:** [December 10, 2017, 9:25pm UTC](https://discourse.julialang.org/t/query-jl-type-unionall-has-no-field-parameters/7673 "2017-12-10T21:25:58Z")

</div>

I am playing around with Query.jl. I have a big dataset with many observations per day. I would like to group the observations together by observation date and then compute mean and variance of one indicator. I use the f…

---

## [INFO: Computing test dependencies ... forever](https://discourse.julialang.org/t/info-computing-test-dependencies-forever/7543)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 7\
**Last updated:** [December 10, 2017, 7:18pm UTC](https://discourse.julialang.org/t/info-computing-test-dependencies-forever/7543 "2017-12-10T19:18:25Z")

</div>

I start my test and see this: INFO: Computing test dependencies for Juniper... forever. I killed all julia processes but no change. If I restart my computer it works a couple of times and then stops again. Any idea?

---

## [Convert to and from Int24](https://discourse.julialang.org/t/convert-to-and-from-int24/7670)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [December 10, 2017, 6:00pm UTC](https://discourse.julialang.org/t/convert-to-and-from-int24/7670 "2017-12-10T18:00:57Z")

</div>

I am want to try an Int24 type, purely for storage. It is easy to declare one with primitive type Int24 \<: Signed 24 end but I am not sure how to access its value. I only need conversion to and from Int32, but I don’t…

---

## [Is \`Vector{UInt8}(string)\` the fastest way to convert String to bytes?](https://discourse.julialang.org/t/is-vector-uint8-string-the-fastest-way-to-convert-string-to-bytes/7642)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 19\
**Last updated:** [December 10, 2017, 12:24pm UTC](https://discourse.julialang.org/t/is-vector-uint8-string-the-fastest-way-to-convert-string-to-bytes/7642 "2017-12-10T12:24:30Z")

</div>

Is Vecotr{UInt8}(string) the fastest way to convert String to bytes? From my testing, it seems to perform ok const M = 100\_000\_000; const K = 100 const s = rand(\[@sprintf "id%03d" k for k in 1:K\], M) function ghi(s::Ve…

---

## [How to add row to JuliaDB table?](https://discourse.julialang.org/t/how-to-add-row-to-juliadb-table/7637)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 5\
**Last updated:** [December 10, 2017, 11:21am UTC](https://discourse.julialang.org/t/how-to-add-row-to-juliadb-table/7637 "2017-12-10T11:21:50Z")

</div>

I know it’s supposed to be slow, but how do you add a row to a JuliaDB table? // assume you start w/ t = table(\[1,2,3\], \[4,5,6\], names=\[:x, :y\]) The closest docs I could find are: ANN: JuliaDB.jl https://github.com/J…

---

## [IJulia build changing conda channel for some python packages within conda environment](https://discourse.julialang.org/t/ijulia-build-changing-conda-channel-for-some-python-packages-within-conda-environment/7665)

<div class="topic-metadata">

**Author:** [@Copper](https://discourse.julialang.org/u/Copper)\
**Replies:** 0\
**Last updated:** [December 10, 2017, 1:19am UTC](https://discourse.julialang.org/t/ijulia-build-changing-conda-channel-for-some-python-packages-within-conda-environment/7665 "2017-12-10T01:19:59Z")

</div>

When building the IJulia package which is set up to make use of the Conda package and Anaconda most up to date Python 3 installation (with specific sub enviroment ‘conda\_jl’ I designated for Julia to be precise), some (8…

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

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