Recent submissions

Comment · 7 years ago
Just because I like GNU parallel:

    parallel -kj1 'f="{}"; [[ -f "${f/data/A}" ]] || echo $f' ::: *_data.csv
Comment · 7 years ago
This is better relative to the `sed` solution as it handles the `0000` case well.
Comment · 7 years ago
I didn't realize Zsh (and Bash) was capable of removing zero padding in that way.

Everybody has there own style, but I would prefer to print the missing file pattern and avoid loops.

If you have GNU parallel installed (works in bash)

     parallel -kj1 '! [[ -f "{}" ]] && echo {} || :' ::: $(jot -w %04d_A.csv - 1 501)
or if preferred

     parallel -kj1 '! [[ -f "{}" ]] && echo {} || :' ::: {0001..0500}_A.csv
Comment · 7 years ago
Just for fun some bash:

    for k in $(seq -f %04.f 1 501); do 
        f="${k}_A.csv"
        ! [[ -f "$f" ]] && echo $f || :
    done
or more succinctly,

    for k in {0001..0501}_A.csv; do
        ! [[ -f "$f" ]] && echo $f || :
    done
and if you have GNU parallel installed:

    parallel -kj1 '! [[ -f "{}" ]] && echo {} || :' ::: {0001..0501}_A.csv
Comment · 7 years ago
My cat perpetually wants to go outside.
Comment · 8 years ago
Gold had intrinsic value before electronics, but for basically the same reason: it's immutable.

The bitcoin blockchain is also immutable.

Comment · 9 years ago
Comment · 10 years ago
Your algorithm had a bit of a typo--you want to subtract (resp. add) to calculate the odd and even parts of a function.

If you don't have a nearly symmetric span of x values, you may need to do extrapolation to obtain one, which may be difficult.

I brought up Fourier analysis not as a means to replace the decomposition described in the blog, but to connect it. I think it's neat that Fourier transformations can be viewed as a parity decomposition.

Comment · 10 years ago
This can be rather difficult for general data where an explicit equation isn't obvious (even though it'll work quite often as pointed out by johncolanduoni below).

[I think it's neat that] for sufficiently smooth and periodic data, a Fourier transform will do exactly this (decompose a function into its even and odd parts)!

Comment · 10 years ago
Two fluids with a density difference and a velocity gradient usually have a common force acting upon them, e.g. gravity, which enforces so-said interface. Perturbations to the average interface are restored via this force, and these perturbations are called gravity waves.

KH Instabilities give rise to gravity waves.

Comment · 10 years ago
Gravity is the result of an appropriately accelerating frame (i.e. the curvature of spacetime).
Comment · 10 years ago
Name seems fine to me.

From the first paragraph of the wiki-page:

In fluid dynamics, gravity waves are waves generated in a fluid medium or at the interface between two media when the force of gravity or buoyancy tries to restore equilibrium. An example of such an interface is that between the atmosphere and the ocean, which gives rise to wind waves.

Comment · 10 years ago
Disappointed by the lack of 1337.
Comment · 10 years ago
They claim that it has an unlimited number of write cycles.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton