# General Usage

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

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

**Page:** 1028

---

## [A bug in tuple type-inferencing, or a subtlety?](https://discourse.julialang.org/t/a-bug-in-tuple-type-inferencing-or-a-subtlety/5806)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 4\
**Last updated:** [September 10, 2017, 11:32pm UTC](https://discourse.julialang.org/t/a-bug-in-tuple-type-inferencing-or-a-subtlety/5806 "2017-09-10T23:32:12Z")

</div>

In the code below, test\_inf2 does not work (see the error message that follows), and yet test\_inf1 and test\_inf3 are fine. Is this a bug in the type-inference system? Note that for my actual code, the solution presente…

---

## [Creating symbols inside of macros](https://discourse.julialang.org/t/creating-symbols-inside-of-macros/5812)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 3\
**Last updated:** [September 10, 2017, 9:27pm UTC](https://discourse.julialang.org/t/creating-symbols-inside-of-macros/5812 "2017-09-10T21:27:25Z")

</div>

How to create symbols (and new types) inside of macros? macro mymacro(arg) quote structname = Symbol($arg,"ext") struct structname end end end In this example, I am expecting a call @mymacro "Foo" to de…

---

## [Overriding a method in a different module](https://discourse.julialang.org/t/overriding-a-method-in-a-different-module/5805)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 5\
**Last updated:** [September 10, 2017, 7:12pm UTC](https://discourse.julialang.org/t/overriding-a-method-in-a-different-module/5805 "2017-09-10T19:12:10Z")

</div>

Hi everyone, I am having trouble calling a method that I have overridden. Here is an example: module XXX export hello function hello() println("XXX") end end using XXX t = function XXX.hello() println("yyy…

---

## [How to understand Type](https://discourse.julialang.org/t/how-to-understand-type/5810)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 3\
**Last updated:** [September 10, 2017, 6:40pm UTC](https://discourse.julialang.org/t/how-to-understand-type/5810 "2017-09-10T18:40:18Z")

</div>

I find Type is frequently used in some codes. However, no documentation is provided: help?\> Type search: Type typeof TypeVar TypeName typemin typemax TypedSlot typejoin TypeError typeassert No documentation found. …

---

## [Date, time, and duration from a video file](https://discourse.julialang.org/t/date-time-and-duration-from-a-video-file/5799)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 1\
**Last updated:** [September 9, 2017, 9:47pm UTC](https://discourse.julialang.org/t/date-time-and-duration-from-a-video-file/5799 "2017-09-09T21:47:11Z")

</div>

I need to get the original date and time as well as duration from video files. It looks like the only option to accomplish this right now is via external tools (see here). But can anyone here point me to the right direc…

---

## [Regex doesn't match end of line with both carriage return and line feed](https://discourse.julialang.org/t/regex-doesnt-match-end-of-line-with-both-carriage-return-and-line-feed/5795)

<div class="topic-metadata">

**Author:** [@danielmatz](https://discourse.julialang.org/u/danielmatz)\
**Replies:** 2\
**Last updated:** [September 9, 2017, 4:03pm UTC](https://discourse.julialang.org/t/regex-doesnt-match-end-of-line-with-both-carriage-return-and-line-feed/5795 "2017-09-09T16:03:17Z")

</div>

I was trying to use the Regex feature where ^ and $ match the start and end of individual lines instead of the whole string, and I noticed that: $ match(r"does$"m, "this does\\r\\nnot work") $ match(r"does$"m, "this does…

---

## [Performant way to create ntuple?](https://discourse.julialang.org/t/performant-way-to-create-ntuple/5783)

<div class="topic-metadata">

**Author:** [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Replies:** 2\
**Last updated:** [September 8, 2017, 8:53pm UTC](https://discourse.julialang.org/t/performant-way-to-create-ntuple/5783 "2017-09-08T20:53:09Z")

</div>

Consider the following simplified code for Julia 0.6: using BenchmarkTools @noinline g(x) = x\[1\] function f1(M, ::Type{Val{N}}) where N s = 0 for j = 1:M x = ntuple(i -\> i + j, Val{N}) s += g(x)…

---

## [Are mutable structs fundamentally slower?](https://discourse.julialang.org/t/are-mutable-structs-fundamentally-slower/5786)

<div class="topic-metadata">

**Author:** [@sg-s](https://discourse.julialang.org/u/sg-s)\
**Replies:** 8\
**Last updated:** [September 8, 2017, 6:44pm UTC](https://discourse.julialang.org/t/are-mutable-structs-fundamentally-slower/5786 "2017-09-08T18:44:00Z")

</div>

I’m writing a simulation that solves a system of N differential equations. I’m using fixed step Euler integration, so it’s always a simply for loop that iterates over many times. I have two implementations, and one is 4X…

---

## [How to specify package requirements for unmereged PRs?](https://discourse.julialang.org/t/how-to-specify-package-requirements-for-unmereged-prs/5757)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 8\
**Last updated:** [September 8, 2017, 1:31pm UTC](https://discourse.julialang.org/t/how-to-specify-package-requirements-for-unmereged-prs/5757 "2017-09-08T13:31:21Z")

</div>

A package I’m writing relies on a bunch of other registered packages. I have a few issues with a couple of them. I’ve submitted PRs to fix those issues. While this works locally on my machine (because I can have those pa…

---

## [Benchmark different Julia versions?](https://discourse.julialang.org/t/benchmark-different-julia-versions/5782)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 0\
**Last updated:** [September 8, 2017, 11:15am UTC](https://discourse.julialang.org/t/benchmark-different-julia-versions/5782 "2017-09-08T11:15:23Z")

</div>

Is there any benchmark graphic showing the evolution of the speed of the different Julia versions up to v0.7?

---

## [@. macro for element-wise operations and array slicing](https://discourse.julialang.org/t/macro-for-element-wise-operations-and-array-slicing/5761)

<div class="topic-metadata">

**Author:** [@ckoe-bccms](https://discourse.julialang.org/u/ckoe-bccms)\
**Replies:** 8\
**Last updated:** [September 8, 2017, 9:22am UTC](https://discourse.julialang.org/t/macro-for-element-wise-operations-and-array-slicing/5761 "2017-09-08T09:22:47Z")

</div>

Hello everybody, I have a larger expression involving purely element-wise operations on vector elements. Using functions like abs(), log10() requires the use of dot-syntax in julia 0.6 unless one ignores the depreciati…

---

## [kron(::SparseVector,::SparseVector) returns a dense vector](https://discourse.julialang.org/t/kron-sparsevector-sparsevector-returns-a-dense-vector/5778)

<div class="topic-metadata">

**Author:** [@magzpavz](https://discourse.julialang.org/u/magzpavz)\
**Replies:** 1\
**Last updated:** [September 8, 2017, 4:19am UTC](https://discourse.julialang.org/t/kron-sparsevector-sparsevector-returns-a-dense-vector/5778 "2017-09-08T04:19:10Z")

</div>

hello, noobie here kron (Kronecker product) does not have a method defined for SparseVector (though it does for SparseMatrixCSC), and so it gives a dense result. I’ve written myself a kron method which is mostly just co…

---

## [Sending Custom Packets over Raw Socket (e.g. custom ICMP payload, etc.)](https://discourse.julialang.org/t/sending-custom-packets-over-raw-socket-e-g-custom-icmp-payload-etc/5772)

<div class="topic-metadata">

**Author:** [@PriceHardman](https://discourse.julialang.org/u/PriceHardman)\
**Replies:** 0\
**Last updated:** [September 7, 2017, 10:27pm UTC](https://discourse.julialang.org/t/sending-custom-packets-over-raw-socket-e-g-custom-icmp-payload-etc/5772 "2017-09-07T22:27:57Z")

</div>

Hello, My apologies in advance if this is not the correct category for this question. I’m interested in trying to write a ping or traceroute-like tool in Julia (partly for my own edification, but also for use in networ…

---

## [Help with ccall to clib functions](https://discourse.julialang.org/t/help-with-ccall-to-clib-functions/5749)

<div class="topic-metadata">

**Author:** [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)\
**Replies:** 23\
**Last updated:** [September 7, 2017, 10:18pm UTC](https://discourse.julialang.org/t/help-with-ccall-to-clib-functions/5749 "2017-09-07T22:18:17Z")

</div>

Hi, I’m trying to implement some routines from termios in clib. I have created the constants to represent the many #defines in the c header file, but I need help with a couple items (please). So, here’s a bit of the cod…

---

## [Machine code discrepancy between Julia and C](https://discourse.julialang.org/t/machine-code-discrepancy-between-julia-and-c/5771)

<div class="topic-metadata">

**Author:** [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Replies:** 2\
**Last updated:** [September 7, 2017, 9:55pm UTC](https://discourse.julialang.org/t/machine-code-discrepancy-between-julia-and-c/5771 "2017-09-07T21:55:04Z")

</div>

I’m seeing an extra instruction in the machine code generated by Julia compared to the same thing from C and clang for a very simple function. Can anyone explain? I’m trying to devise a good example illustrating code int…

---

## [What is the current status of how variables are initialized?](https://discourse.julialang.org/t/what-is-the-current-status-of-how-variables-are-initialized/5770)

<div class="topic-metadata">

**Author:** [@tparker](https://discourse.julialang.org/u/tparker)\
**Replies:** 2\
**Last updated:** [September 7, 2017, 9:51pm UTC](https://discourse.julialang.org/t/what-is-the-current-status-of-how-variables-are-initialized/5770 "2017-09-07T21:51:33Z")

</div>

There appears to be a lively ongoing debate about how elements of arrays should be inititialized, begun here and continued here. As I understand it, arrays of pointer types have their elements initialized to #undef. Arra…

---

## [Parallel Computing](https://discourse.julialang.org/t/parallel-computing/5768)

<div class="topic-metadata">

**Author:** [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Replies:** 0\
**Last updated:** [September 7, 2017, 7:51pm UTC](https://discourse.julialang.org/t/parallel-computing/5768 "2017-09-07T19:51:15Z")

</div>

Hello, Please let me the code to know the status of each process and their id in parallel computing. Thanks,

---

## [Performance issue with use of eltype()?](https://discourse.julialang.org/t/performance-issue-with-use-of-eltype/5764)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 7\
**Last updated:** [September 7, 2017, 6:28pm UTC](https://discourse.julialang.org/t/performance-issue-with-use-of-eltype/5764 "2017-09-07T18:28:57Z")

</div>

I am at a loss to explain the performance difference between these two functions. Can someone help? julia\> function foo(a::AbstractVector) T = eltype(a) c = Set{T}\[Set{T}() for x in a\] r…

---

## [Scale Window/Plot Size using PyPlot](https://discourse.julialang.org/t/scale-window-plot-size-using-pyplot/5762)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 1\
**Last updated:** [September 7, 2017, 3:28pm UTC](https://discourse.julialang.org/t/scale-window-plot-size-using-pyplot/5762 "2017-09-07T15:28:19Z")

</div>

I would like to plot something using PyPlot, change the size of the window and then save it. Through stretching the window a bit in one direction, the overall plot looks better and nothing overlaps. Since I have to do th…

---

## [Gtk pixbuf errors on a mac](https://discourse.julialang.org/t/gtk-pixbuf-errors-on-a-mac/5754)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [September 7, 2017, 2:43pm UTC](https://discourse.julialang.org/t/gtk-pixbuf-errors-on-a-mac/5754 "2017-09-07T14:43:48Z")

</div>

I’m running into tons of errors and warnings when using Gtk.jl functions on a mac. Things like pixbuf and “the installation is broken”. Any ideas what’s wrong? I’m sorry about the vagueness, but this is happening in a u…

---

## [ETL and data analytics tools with Julia](https://discourse.julialang.org/t/etl-and-data-analytics-tools-with-julia/5756)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 0\
**Last updated:** [September 7, 2017, 10:59am UTC](https://discourse.julialang.org/t/etl-and-data-analytics-tools-with-julia/5756 "2017-09-07T10:59:11Z")

</div>

Hello. What ETL and/or data analytics GUI tools such as Knime, Rapidminer, Pentahoo… or any other alternative can be configured to be used with Julia? I would like to be able to create my own Julia code using a ETL G…

---

## [Fonts after plot export as pdf](https://discourse.julialang.org/t/fonts-after-plot-export-as-pdf/5741)

<div class="topic-metadata">

**Author:** [@jonas-kr](https://discourse.julialang.org/u/jonas-kr)\
**Replies:** 7\
**Last updated:** [September 7, 2017, 9:06am UTC](https://discourse.julialang.org/t/fonts-after-plot-export-as-pdf/5741 "2017-09-07T09:06:27Z")

</div>

Currently, I’m trying to export a plot to a pdf file using PlotlyJS. This works as expected as long as the fonts aren’t changed. The following example works fine (except I’ve to rebuild Cairo every time I run julia): u…

---

## [Module Not Reloading](https://discourse.julialang.org/t/module-not-reloading/5723)

<div class="topic-metadata">

**Author:** [@albi3ro](https://discourse.julialang.org/u/albi3ro)\
**Replies:** 6\
**Last updated:** [September 7, 2017, 4:19am UTC](https://discourse.julialang.org/t/module-not-reloading/5723 "2017-09-07T04:19:44Z")

</div>

I had a personal module that worked back in Julia 0.4.8 and I am in the process of updating it to Julia 0.6. I’ve updated all the syntax, but I have to change the name of the module from “Lattices” to “Lattices2” to get…

---

## [Help with ccall to a clib function](https://discourse.julialang.org/t/help-with-ccall-to-a-clib-function/5747)

<div class="topic-metadata">

**Author:** [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)\
**Replies:** 8\
**Last updated:** [September 7, 2017, 3:21am UTC](https://discourse.julialang.org/t/help-with-ccall-to-a-clib-function/5747 "2017-09-07T03:21:48Z")

</div>

Hi, I’m trying to implement some routines from termios in clib. I have created the constants to represent the many #defines in the c header file, but I need help with a couple items (please). So, here’s a bit of the cod…

---

## [Why is there a performance difference between global and local variables in non-interactive Julia programs?](https://discourse.julialang.org/t/why-is-there-a-performance-difference-between-global-and-local-variables-in-non-interactive-julia-programs/5753)

<div class="topic-metadata">

**Author:** [@tparker](https://discourse.julialang.org/u/tparker)\
**Replies:** 4\
**Last updated:** [September 7, 2017, 12:25am UTC](https://discourse.julialang.org/t/why-is-there-a-performance-difference-between-global-and-local-variables-in-non-interactive-julia-programs/5753 "2017-09-07T00:25:44Z")

</div>

I’ve found two places in the documentation that say that local is better than than global in terms of performance: Performance Tips says A global variable might have its value, and therefore its type, change at any poi…

---

## [Filtering DateTime range efficiently](https://discourse.julialang.org/t/filtering-datetime-range-efficiently/5727)

<div class="topic-metadata">

**Author:** [@Jan\_Dolinsky](https://discourse.julialang.org/u/Jan_Dolinsky)\
**Replies:** 0\
**Last updated:** [September 5, 2017, 2:10pm UTC](https://discourse.julialang.org/t/filtering-datetime-range-efficiently/5727 "2017-09-05T14:10:15Z")

</div>

Hi, I am studying how to work DateTime in Julia. The design is very intuitive. Well done! The possibility to create a DateTime range is particularly interesting. Imagine a range as follows: a = DateTime(2017, 1, 1, 0,…

---

## [Are there any results comparing ForwardDiff to an operator overloading approach in C++?](https://discourse.julialang.org/t/are-there-any-results-comparing-forwarddiff-to-an-operator-overloading-approach-in-c/5742)

<div class="topic-metadata">

**Author:** [@vgdev](https://discourse.julialang.org/u/vgdev)\
**Replies:** 5\
**Last updated:** [September 6, 2017, 7:59pm UTC](https://discourse.julialang.org/t/are-there-any-results-comparing-forwarddiff-to-an-operator-overloading-approach-in-c/5742 "2017-09-06T19:59:54Z")

</div>

Does there exist any benchmark results indicating the performance of ForwardDiff.jl compared to overloading approaches in C++ (i.e. FADBAD++) ?

---

## [Track allocation is not working on windows when the folder has an umlaut (like ä) in its name](https://discourse.julialang.org/t/track-allocation-is-not-working-on-windows-when-the-folder-has-an-umlaut-like-a-in-its-name/5679)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 2\
**Last updated:** [September 6, 2017, 5:42am UTC](https://discourse.julialang.org/t/track-allocation-is-not-working-on-windows-when-the-folder-has-an-umlaut-like-a-in-its-name/5679 "2017-09-06T05:42:10Z")

</div>

On my machine no \*.mem files are created in this situation. I am in Windows 10 with julia 0.6. Can someone possible either “prove me wrong” or confirm the statement in the title? I used track-allocation=user

---

## [Does it matter where in the code a function is defined?](https://discourse.julialang.org/t/does-it-matter-where-in-the-code-a-function-is-defined/5737)

<div class="topic-metadata">

**Author:** [@tparker](https://discourse.julialang.org/u/tparker)\
**Replies:** 2\
**Last updated:** [September 6, 2017, 12:26am UTC](https://discourse.julialang.org/t/does-it-matter-where-in-the-code-a-function-is-defined/5737 "2017-09-06T00:26:02Z")

</div>

The documentation for “Metaprogramming” says “Calling any function that is defined after the body of the generated function … should not be attempted.” I can’t find any other mention of whether it matters where in the co…

---

## [Dir does not work in the console?](https://discourse.julialang.org/t/dir-does-not-work-in-the-console/5732)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 4\
**Last updated:** [September 5, 2017, 7:54pm UTC](https://discourse.julialang.org/t/dir-does-not-work-in-the-console/5732 "2017-09-05T19:54:50Z")

</div>

I use Julia with the Atom console on Win 10. DIR does not work for some reason. Is this expected, or is this a bug?

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

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