News for hackers. Stuff that matters.
Re:Fourier series visualisation with D3.js by maaaats on Monday April 07, 2014 @06:16PM (#7549969)

  function FT(A, N, φ) {
    φ = φ || 0;
    return function(x) {
      var n = -1, y = 0;
      while (++n < N) {
        y += A[n] * Math.sin(τ * (n + 1) * x + φ);
      }
      return y;
    }
  }
hehe, seems annoying to type. Copy&paste everytime one of them is needed?
Re:Fourier series visualisation with D3.js by rbonvall on Monday April 07, 2014 @08:45PM (#7550700)
In Vim using digraphs:

    Ctrl-K f *   →   φ
    Ctrl-K t *   →   τ
In general:

    Ctrl-K <latin letter> * → <greek equivalent>
Re:Fourier series visualisation with D3.js by pseut on Tuesday April 08, 2014 @01:26AM (#7551566)
I love Vim's digraphs!

In emacs it's

    C-| tex
then

    \phi → φ
etc, which can be quite a bit more typing but can be easier to remember if you already know the TeX instructions for everything.

Now we just need to convince other editors to add something similar...

Re:Fourier series visualisation with D3.js by mickeyp on Tuesday April 08, 2014 @05:52AM (#7552391)
I think you mean C-u C-\ and then change the input type to tex.

There are other ways of inputting digraphs: C-x 8 RET lets you enter the name of any unicode symbol.

I wrote about the many ways of inputting digraphs and unicode here:

http://www.masteringemacs.org/articles/2010/10/13/diacritics...

Re:Fourier series visualisation with D3.js by pseut on Tuesday April 08, 2014 @12:18PM (#7554334)
You're right, thanks. But C-u doesn't seem to be necessary, unless I have a strange setup.
Re:Fourier series visualisation with D3.js by Kroem3r on Monday April 07, 2014 @07:45PM (#7550468)
search and replace as the last launch step