# General Usage

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

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

**Page:** 996

---

## [Why will we have to say fieldnames(typeof(v)) instead of fieldnames(v)?](https://discourse.julialang.org/t/why-will-we-have-to-say-fieldnames-typeof-v-instead-of-fieldnames-v/9129)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 50\
**Last updated:** [February 20, 2018, 12:20am UTC](https://discourse.julialang.org/t/why-will-we-have-to-say-fieldnames-typeof-v-instead-of-fieldnames-v/9129 "2018-02-20T00:20:26Z")

</div>

Sorry, I can’t understand these type of changes. On 0.7 we now get Warning: \`fieldnames(v)\` is deprecated, use \`fieldnames(typeof(v))\` instead. And when the deprecation stage is over one will get only a, +/- comprehens…

---

## [Normalizing the columns of an SMatrix](https://discourse.julialang.org/t/normalizing-the-columns-of-an-smatrix/9160)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 4\
**Last updated:** [February 19, 2018, 11:21pm UTC](https://discourse.julialang.org/t/normalizing-the-columns-of-an-smatrix/9160 "2018-02-19T23:21:58Z")

</div>

I have an SMatrix of dimension (D, k). What I want to do is to normalize each column of this matrix, as if they were individual vectors. What I do at the moment is always carry around with me a Vector\[SVector\], and do: …

---

## [Where are CHOLMOD and sparse linear algebra operations in 0.7?](https://discourse.julialang.org/t/where-are-cholmod-and-sparse-linear-algebra-operations-in-0-7/9185)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 4\
**Last updated:** [February 19, 2018, 10:19pm UTC](https://discourse.julialang.org/t/where-are-cholmod-and-sparse-linear-algebra-operations-in-0-7/9185 "2018-02-19T22:19:18Z")

</div>

It seems that sparse linear algebra source files in 0.7 are no longer in the base folder of the Julia distribution but have been moved to the site folder. What is the significance of this change? My 0.6 code has the fo…

---

## [convert julia date to milliseconds](https://discourse.julialang.org/t/convert-julia-date-to-milliseconds/9182)

<div class="topic-metadata">

**Author:** [@howcani](https://discourse.julialang.org/u/howcani)\
**Replies:** 2\
**Last updated:** [February 19, 2018, 9:59pm UTC](https://discourse.julialang.org/t/convert-julia-date-to-milliseconds/9182 "2018-02-19T21:59:54Z")

</div>

How can I convert date in string format “2018-02-19” (y-m-d) to milliseconds so that I can use it for jcall setDate(long milliseconds)?

---

## [PCA example from documentation -- not running](https://discourse.julialang.org/t/pca-example-from-documentation-not-running/8900)

<div class="topic-metadata">

**Author:** [@burfel](https://discourse.julialang.org/u/burfel)\
**Replies:** 6\
**Last updated:** [February 19, 2018, 6:21pm UTC](https://discourse.julialang.org/t/pca-example-from-documentation-not-running/8900 "2018-02-19T18:21:58Z")

</div>

Hello, I am trying to get dimensionality reduction methods running on a sample dataset and I am constantly running into dependency issues. I use Julia 0.6.2. For instance: http://multivariatestatsjl.readthedocs.io/en…

---

## [Parametric type in an variable length Tuple?](https://discourse.julialang.org/t/parametric-type-in-an-variable-length-tuple/9109)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 10\
**Last updated:** [February 19, 2018, 2:07pm UTC](https://discourse.julialang.org/t/parametric-type-in-an-variable-length-tuple/9109 "2018-02-19T14:07:35Z")

</div>

I have a problem where I have a struct of parametrically typed functions contained in another struct - to make user selected functions available and type stable. This is fine for one set of functions, but I need N sets o…

---

## [Condition on a whole array](https://discourse.julialang.org/t/condition-on-a-whole-array/9148)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 6\
**Last updated:** [February 19, 2018, 12:48pm UTC](https://discourse.julialang.org/t/condition-on-a-whole-array/9148 "2018-02-19T12:48:18Z")

</div>

Hi, I have a fairly simple question that would like to sort out with your kind help :slight\_smile: The fact is that I like quite a lot the conditional syntax {something} ? true : false which works great for short deci…

---

## [Defining function inside a macro](https://discourse.julialang.org/t/defining-function-inside-a-macro/9139)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 7\
**Last updated:** [February 18, 2018, 7:38pm UTC](https://discourse.julialang.org/t/defining-function-inside-a-macro/9139 "2018-02-18T19:38:03Z")

</div>

What am I doing wrong? It’s giving me a syntax error… Thanks # @makefn "fn" :hello macro makefn(prefix, name) quote fn = prefix \* "\_" \* name function $(fn) println("hello") end …

---

## [Two questions about filtering](https://discourse.julialang.org/t/two-questions-about-filtering/9142)

<div class="topic-metadata">

**Author:** [@piever](https://discourse.julialang.org/u/piever)\
**Replies:** 3\
**Last updated:** [February 18, 2018, 5:34pm UTC](https://discourse.julialang.org/t/two-questions-about-filtering/9142 "2018-02-18T17:34:04Z")

</div>

The first question is about filtering to remove missing data. There seems to be a major (500x) performance difference between using Iterators.filter(!ismissing, v) and skipmissing (in favor of the latter) and I wanted to…

---

## [Vectorization and Minor Random Number Issues](https://discourse.julialang.org/t/vectorization-and-minor-random-number-issues/9137)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 5\
**Last updated:** [February 18, 2018, 3:49pm UTC](https://discourse.julialang.org/t/vectorization-and-minor-random-number-issues/9137 "2018-02-18T15:49:32Z")

</div>

Consider the following code: srand(1234); x = zeros(2); y = zeros(2); A = 3.5; y.=x.+ A \* randn.() srand(1234); x = zeros(2); y = zeros(2); B = 3.5; y.=x.+ A .\* randn.() The first piece produces 2-element Array{Float6…

---

## [Improve performance of function that produces and hcats SMatrices](https://discourse.julialang.org/t/improve-performance-of-function-that-produces-and-hcats-smatrices/9140)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 3\
**Last updated:** [February 18, 2018, 11:23am UTC](https://discourse.julialang.org/t/improve-performance-of-function-that-produces-and-hcats-smatrices/9140 "2018-02-18T11:23:00Z")

</div>

I have two functions, which for our MWE could be the following: using BenchmarkTools, StaticArrays @inline function f(x, p, n) @inbounds x1, x2, x3 = x\[1\], x\[2\], x\[3\] SVector( 3.8\*x1\*(1-x1) - 0.05\*(x2+0.35)\*(1-2…

---

## [Compiling and building binaries from your julia code](https://discourse.julialang.org/t/compiling-and-building-binaries-from-your-julia-code/5687)

<div class="topic-metadata">

**Author:** [@viralbshah](https://discourse.julialang.org/u/viralbshah)\
**Replies:** 49\
**Last updated:** [February 16, 2018, 11:01pm UTC](https://discourse.julialang.org/t/compiling-and-building-binaries-from-your-julia-code/5687 "2018-02-16T23:01:38Z")

</div>

I put together a repository on how to compile binaries and shared libraries from your user code - with lots of help from Jameson. https://github.com/JuliaComputing/static-julia The instructions are in the README, and a…

---

## [Help decoding this deprecation](https://discourse.julialang.org/t/help-decoding-this-deprecation/9130)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 4\
**Last updated:** [February 17, 2018, 5:37pm UTC](https://discourse.julialang.org/t/help-decoding-this-deprecation/9130 "2018-02-17T17:37:58Z")

</div>

Sorry, IMO, another complicate it evolution example. How do I write the new correct form? julia\> contains(==, fieldnames(GMT.GMTgrid), Symbol("z")) ┌ Warning: \`contains(eq::Function, itr, x)\` is deprecated, use \`any((y…

---

## [Hash Mismatch on Latest Sundials](https://discourse.julialang.org/t/hash-mismatch-on-latest-sundials/9128)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 5\
**Last updated:** [February 17, 2018, 4:04pm UTC](https://discourse.julialang.org/t/hash-mismatch-on-latest-sundials/9128 "2018-02-17T16:04:11Z")

</div>

After doing a Pkg.update() yesterday, I got: INFO: Could not locate libsundials\_sunlinsolklu inside /Users/gideonsimpson/.julia/v0.6/Sundials/deps/usr/lib INFO: Destination file /Users/gideonsimpson/.julia/v0.6/Sundials…

---

## [Problem in loading Module due to BITLOCKER encryption](https://discourse.julialang.org/t/problem-in-loading-module-due-to-bitlocker-encryption/9049)

<div class="topic-metadata">

**Author:** [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Replies:** 1\
**Last updated:** [February 17, 2018, 3:14pm UTC](https://discourse.julialang.org/t/problem-in-loading-module-due-to-bitlocker-encryption/9049 "2018-02-17T15:14:27Z")

</div>

Hi All, I don't have access to admin account of my office laptop. I am using standard users account. I have few modules and I am calling them as follows: Method 1: juliaSriptPath=“C:/Julia Script/” push!(LOA…

---

## [How to remowe empty rows in Array{String,1}?](https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 3\
**Last updated:** [February 17, 2018, 1:46pm UTC](https://discourse.julialang.org/t/how-to-remowe-empty-rows-in-array-string-1/9125 "2018-02-17T13:46:58Z")

</div>

How to remowe empty rows in Array{String,1} ? '2993-element Array{String,1}: “” “” “” “” “” “some test” “” ’ Paul

---

## [Download error: 2148270088 ; Is posible to download this site?](https://discourse.julialang.org/t/download-error-2148270088-is-posible-to-download-this-site/9126)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 0\
**Last updated:** [February 17, 2018, 10:05am UTC](https://discourse.julialang.org/t/download-error-2148270088-is-posible-to-download-this-site/9126 "2018-02-17T10:05:53Z")

</div>

Is posible to download this site ? julia\> download(“http://gazeta.pl”) ERROR: automatic download failed (error: 2148270088): http://gazeta.pl Stacktrace: \[1\] download(::String, ::String) at .\\interactiveutil.jl:598 …

---

## [A Dict preserving the insertion order?](https://discourse.julialang.org/t/a-dict-preserving-the-insertion-order/9124)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 3\
**Last updated:** [February 17, 2018, 9:25am UTC](https://discourse.julialang.org/t/a-dict-preserving-the-insertion-order/9124 "2018-02-17T09:25:16Z")

</div>

Is there a dictionary which preserves the adding order. julia\> a = Dict{Symbol,Int}() Dict{Symbol,Int64} with 0 entries julia\> a\[:a\] =3 3 julia\> a Dict{Symbol,Int64} with 1 entry: :a =\> 3 julia\> a\[:x\] =2 2 julia\> …

---

## [Error building Julia on Linux (libkernel.la missing)](https://discourse.julialang.org/t/error-building-julia-on-linux-libkernel-la-missing/9120)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 0\
**Last updated:** [February 17, 2018, 12:31am UTC](https://discourse.julialang.org/t/error-building-julia-on-linux-libkernel-la-missing/9120 "2018-02-17T00:31:43Z")

</div>

Trying to build Julia on Linux but got into this error. Any idea? make\[2\]: Entering directory \`/home/tkwong/julia/deps/scratch/fftw-3.3.6-pl1-single' /bin/sh ./libtool --tag=CC --mode=link gcc -m64 -std=gnu99 -O3 …

---

## [Problem with split.(...)](https://discourse.julialang.org/t/problem-with-split/9118)

<div class="topic-metadata">

**Author:** [@ko56](https://discourse.julialang.org/u/ko56)\
**Replies:** 2\
**Last updated:** [February 16, 2018, 7:25pm UTC](https://discourse.julialang.org/t/problem-with-split/9118 "2018-02-16T19:25:24Z")

</div>

This is Julia 0.6.2. julia\> P = \[“{FRBRTXBLBB3|Gig8”, “0/0/16|TenGig/0/0/16,10G}”, “7/0/1|TenGig/7/0/1,10G,340}”\]; julia\> strip.(P, \[‘{’,‘}’\]) ERROR: DimensionMismatch(“arrays could not be broadcast to a common size”) …

---

## [Vectorization and passing a matrix as an argument](https://discourse.julialang.org/t/vectorization-and-passing-a-matrix-as-an-argument/9114)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [February 16, 2018, 4:22pm UTC](https://discourse.julialang.org/t/vectorization-and-passing-a-matrix-as-an-argument/9114 "2018-02-16T16:22:38Z")

</div>

I have an energy type function that I’ve written: function energy(r,A) return 0.5 \* dot(r, A\*r) end where r is an n dimensional array and A is an nxn matrix which may or may not be sparse. Evaluating this on a sin…

---

## [Julia remember gitlab credentials?](https://discourse.julialang.org/t/julia-remember-gitlab-credentials/9111)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 3\
**Last updated:** [February 16, 2018, 4:07pm UTC](https://discourse.julialang.org/t/julia-remember-gitlab-credentials/9111 "2018-02-16T16:07:25Z")

</div>

How can I have Julia remember my Gitlab credentials? It keeps asking whenever I do Pkg.update().

---

## [Pointwise function application to nested arrays](https://discourse.julialang.org/t/pointwise-function-application-to-nested-arrays/9083)

<div class="topic-metadata">

**Author:** [@axsk](https://discourse.julialang.org/u/axsk)\
**Replies:** 3\
**Last updated:** [February 16, 2018, 1:07pm UTC](https://discourse.julialang.org/t/pointwise-function-application-to-nested-arrays/9083 "2018-02-16T13:07:42Z")

</div>

I cannot find a convenient way to map a function over arrays of arrays. For a simple array I can use the syntax f.(x): x=\[1,2\] exp.(x) For nested arrays though, x=\[\[1,2\],\[3,4\]\] exp.(x) I end up with the deprecation …

---

## [Why this constructor is extremly slow? Infinity Loop in Varargs function](https://discourse.julialang.org/t/why-this-constructor-is-extremly-slow-infinity-loop-in-varargs-function/9101)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 2\
**Last updated:** [February 16, 2018, 5:32am UTC](https://discourse.julialang.org/t/why-this-constructor-is-extremly-slow-infinity-loop-in-varargs-function/9101 "2018-02-16T05:32:40Z")

</div>

This constructor receives a wrong type actually but I do not receive any error, it seems that the compiler is in some infinite loop… I cannot figure out why? I guess I made some mistake, cause this happens on both v0.6 a…

---

## [Possible bug/inaccurate deprecation message](https://discourse.julialang.org/t/possible-bug-inaccurate-deprecation-message/9096)

<div class="topic-metadata">

**Author:** [@jgoldfar](https://discourse.julialang.org/u/jgoldfar)\
**Replies:** 2\
**Last updated:** [February 16, 2018, 2:34am UTC](https://discourse.julialang.org/t/possible-bug-inaccurate-deprecation-message/9096 "2018-02-16T02:34:13Z")

</div>

Not sure if this is a bug, planned to be fixed, an unavoidable consequence of the stdlib split, or something else, but I noticed this issue: module ParentMod using DelimitedFiles readdlm(joinpath(@\_\_DIR\_\_, "data.txt"),…

---

## [Correct way of modyfing argument](https://discourse.julialang.org/t/correct-way-of-modyfing-argument/9094)

<div class="topic-metadata">

**Author:** [@bbrunaud](https://discourse.julialang.org/u/bbrunaud)\
**Replies:** 6\
**Last updated:** [February 16, 2018, 12:00am UTC](https://discourse.julialang.org/t/correct-way-of-modyfing-argument/9094 "2018-02-16T00:00:22Z")

</div>

Hello, I would like to write a function that is meant to run inside another function (or standalone), that modifies one of the variables of the namespace. An example would be: k = 1 function dob(k) for i in 1:5 …

---

## [Constructors and \`cfunction\`](https://discourse.julialang.org/t/constructors-and-cfunction/9067)

<div class="topic-metadata">

**Author:** [@danielmatz](https://discourse.julialang.org/u/danielmatz)\
**Replies:** 8\
**Last updated:** [February 15, 2018, 9:37pm UTC](https://discourse.julialang.org/t/constructors-and-cfunction/9067 "2018-02-15T21:37:14Z")

</div>

I just tried to get a C function pointer to a constructor, and was surprised when I got an error: julia\> struct Thing x::Int end julia\> cfunction(Thing, Ref{Thing}, (Int,)) ERROR: closures are not yet c-c…

---

## [Plotting thousands of polygons](https://discourse.julialang.org/t/plotting-thousands-of-polygons/9066)

<div class="topic-metadata">

**Author:** [@mforets](https://discourse.julialang.org/u/mforets)\
**Replies:** 7\
**Last updated:** [February 15, 2018, 9:20pm UTC](https://discourse.julialang.org/t/plotting-thousands-of-polygons/9066 "2018-02-15T21:20:50Z")

</div>

Would you recommend some specific configuration for efficiently plotting a large number (say 20k) polygons? Now we use a custom Plots recipe with a seriestype := :shape and a loop like ... for i in indices # loop o…

---

## [Error on imshow](https://discourse.julialang.org/t/error-on-imshow/9069)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 10\
**Last updated:** [February 15, 2018, 7:29pm UTC](https://discourse.julialang.org/t/error-on-imshow/9069 "2018-02-15T19:29:49Z")

</div>

I asked on slack’s random channel as well but does anyone know why I’m getting errors from a simple ImageView.imshow (issue)?

---

## [charset=Windows-1250, Gumbo, parsing html , Hoow to keep orginal text](https://discourse.julialang.org/t/charset-windows-1250-gumbo-parsing-html-hoow-to-keep-orginal-text/9084)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 1\
**Last updated:** [February 15, 2018, 6:04pm UTC](https://discourse.julialang.org/t/charset-windows-1250-gumbo-parsing-html-hoow-to-keep-orginal-text/9084 "2018-02-15T18:04:12Z")

</div>

I am using this code to parsing html pages: ’ using Gumbo using AbstractTrees url=“http://rp.pl” getpage(url) = parsehtml(String(read(download(url)))) text\_only(doc::HTMLDocument) = text\_only(doc.root) text\_only(f…

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

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