Would it be fun to have a thread where people share really fancy one liners? I think so - I think it’d be a great way to show off some of Julia to newcomers but also share some cool code. I’ll kick the thread off with 2-3,

```
"""
SquareEuclideanDistance(X)
Returns the squared Grahm aka the euclidean distance matrix of `X`.
Note: Tamas Paap correctly showed this should be two lines for performance.
"""
SquareEuclideanDistance(X) = ( sum(X .^ 2, dims = 2) .+ sum(X .^ 2, dims = 2)') .- (2 * X * X')
```

Source: https://github.com/caseykneale/ChemometricsTools.jl/blob/master/src/DistanceMeasures.jl

```
"""
SquareEuclideanDistance(X, Y)
Returns the squared euclidean distance matrix of X and Y such that the columns are the samples in Y.
"""
SquareEuclideanDistance(X, Y) = ( sum(X .^ 2, dims = 2) .+ sum(Y .^ 2, dims = 2)') .- (2 * X * Y')
```

Source: https://github.com/caseykneale/ChemometricsTools.jl/blob/master/src/DistanceMeasures.jl

```
"""
Sinc interpolation
Y - vector of a line shape
S - Sampled domain of Y
Up - Upsampled X vector
"""
SincInterpolation(Y, S, Up) = sinc.( (Up .- S') ./ (S[2] - S[1]) ) * Y
```

Refactored From: https://gist.github.com/endolith/1297227#file-sinc_interp-m

Note: Please include sources for where they came from if they aren’t you’re own effort!