Recent submissions

Comment · 3 years ago
Very good youtube channel, if anyone is wondering
Comment · 6 years ago
A nice example of Japanese stroke order mattering are two of the katakana, ツ and シ. The difference is that the former starts at the top left and the strokes move right, then down and across to the left. The latter starts at the top left and moves down, then up and across to the right. It can be hard to tell what one you are looking at in practice if you don't know this.

I think cursive used to serve the same function, which I basically conjecture from the fact that older people tend to be significantly better at reading cursive than me.

Comment · 6 years ago
Fun book.

"When mass produced, the cost of self-tuning options will be small compared to the price of a quality piano. You might think that this would put piano tuners out of work but that will not be the case because the number of pianos will increase (because of this book), ..."

That's confidence in the method, right there.

Comment · 7 years ago
Steam only hosts the code incidentally. It manages your licenses. This is a big difference, and it's one publishers are free to work around if they wanted to.
Comment · 7 years ago
When you write like this a lot, you end up talking like it, too.
Comment · 7 years ago
The claim isn't never--it's for installing a small set of apps that you don't change for more or less the entire lifetime of your device.
Comment · 7 years ago
Sorry, I'm not accusing you of anything. By strided accesses I mean when you access elements of an array sequentially using some step size. Think loops with `i += stride` instead of `i++`. In the wikipedia pseudocode this is done implicitly using the 's' parameter. Notice that, in the version you implemented, you split the input into even and odd parts explicitly; you can achieve the same end by accessing the input array in a certain order as you are performing the mathematical operations. This is what the wikipedia pseudocode does. If you've seen other versions of the FFT with a bit reversal step, this is also where that comes in.

Check this out (javascript):

  function permute1(x) { 
      if (x.length == 1) return x;
      let even = [];
      let odd = []; 
      for (let i = 0; i < x.length; i += 2) { 
           even[i / 2] = x[i];
           odd[i / 2] = x[i + 1];
      }
      return [].concat(permute1(even), permute1(odd));
  }

  function permute2(x, offset, stride) {
      if (!offset) offset = 0;
      if (!stride) stride = 1;
      if (stride >= x.length) return [x[offset]];
      return [].concat(permute2(x, offset, stride * 2), permute2(x, offset + stride, stride * 2));
  }
  
  function permute3(x) {
      let result = [];
      for (let i = 0; i < x.length; i++) {
          let k = i;
          // pretend 32-bit ints
          k = ((k >> 1) & 0x55555555) | ((k & 0x55555555) << 1);
          k = ((k >> 2) & 0x33333333) | ((k & 0x33333333) << 2);
          k = ((k >> 4) & 0x0F0F0F0F) | ((k & 0x0F0F0F0F) << 4);
          k = ((k >> 8) & 0x00FF00FF) | ((k & 0x00FF00FF) << 8);
          k = ( k >> 16             ) | ( k               << 16); 
          k = k >> (64 - Math.log2(x.length));
          if (k < 0) k += x.length; // fix up due to signed ints
          result[i] = x[k];
      }
      return result;
  }
For arrays with power of two sizes, these perform the same permutation (but fail differently for non power of two sizes). Note that, with permute1, we effectively iterate over the entire input log2(n) times, so this is an O(nlogn) algorithm!

edit: also, i think i may have misunderstood the relationship between your js version and your lambdatalk version. They seem to be the same to me?

Comment · 7 years ago
You copy rather than use strided accesses. It's the same algorithm.
Comment · 7 years ago
Comment · 8 years ago
Just a run of the mill human interest story about the checks notes CIA????
Comment · 8 years ago
For people who are eager to think this is a don't-assume-gender charade: try misgendering a cis person next time you're out, and see how much they don't care. _You_ are who this is for
Comment · 8 years ago
Mozart had extensive education and training????
Comment · 8 years ago
> 4. Teach Changes of Variables

As someone who has basically no formal training in mathematics outside what's required for undergraduate computer science this is a big one. The first time I saw it I was blown away. Everyone who knows of it seems to treat it as natural as breathing, and not worth the exposition

Comment · 8 years ago
Comment · 8 years ago
My experience with notebooks matches the one presented here. For me the most disappointing thing is that notebooks are JSON, and not just marked up .pys. The cons of this decision outweighs the pros for me.

One thing though--one of the best books I've read, Trefethen's ATAP, was written as a collection of .m files, which when run would produce a pdf of each chapter. The .m files were filled with small formatting details that were simply omitted from the generated book. The slides suggest something equivalent is not possible with notebooks. That's unfortunate.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton