Better HN
topnewbestaskshowjobs
Log inSign up

hellabites

4 karma · joined Feb 23, 2014 (12y ago) · 19 submissions

Submissions

comment 7y ago · link · parent

Just because I like GNU parallel:

    parallel -kj1 'f="{}"; [[ -f "${f/data/A}" ]] || echo $f' ::: *_data.csv

comment 7y ago · link · parent

This is better relative to the `sed` solution as it handles the `0000` case well.

comment 7y ago · link · parent

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 7y ago · link · parent

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 7y ago · link · parent

My cat perpetually wants to go outside.

comment 8y ago · link · parent

Gold had intrinsic value before electronics, but for basically the same reason: it's immutable.

The bitcoin blockchain is also immutable.

comment 9y ago · link · parent

Github flavored markdown does do tables (in a manner that's almost equivalent to org): https://github.com/adam-p/markdown-here/wiki/Markdown-Cheats...

comment 10y ago · link · parent

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 10y ago · link · parent

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 10y ago · link · parent

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 10y ago · link · parent

Gravity is the result of an appropriately accelerating frame (i.e. the curvature of spacetime).

comment 10y ago · link · parent

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 10y ago · link · parent

Disappointed by the lack of 1337.

comment 10y ago · link · parent

They claim that it has an unlimited number of write cycles.

comment 12y ago · link · parent

Don't know why this is being downvoted. It's important for scientists to use the correct, well-established terms when discussing their research. This is most true for formal publications.

Velocity is a vector quantity--it describes a directional rate of change. Speed is the magnitude of the velocity. When they use the term velocity, they mean speed. For example, even in the abstract:

"along trajectories determined by the direction and velocity of the wind"

Velocity has a direction! The use of direction in this sentence is redundant to anyone that has had a college level physics course. This trend of using "velocity" instead of "speed" continues through the entire paper. I find this very upsetting.

Of course, it may seem pedantic, but good science is pedantic.

I'm surprised that it made it through peer-review like this.

comment 12y ago · link · parent

They use the term velocity to mean speed a lot :(.

comment 12y ago · link · parent

No, but I am very thankful for your posted workaround.