HNHacker News
TopNewBestAskShowJobs

gp7

180 karma · joined January 3, 2015

submissionscomments
gp7··on Data-Driven Science and Engineering 2nd Edition [pdf]
Very good youtube channel, if anyone is wondering
gp7··on Japanese rules for writing your ABCs are surprisingly strict
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.

gp7··on How to play the guitar by ear, for mathematicians and physicists (2000) [pdf]
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.

gp7··on Google shuts down its blog management tool just 10 months after launch
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.
gp7··on The 'Dark Ages' Weren't as Dark as We Thought
When you write like this a lot, you end up talking like it, too.
gp7··on Start with a Website, Not a Mobile App
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.
gp7··on Show HN: A minimal FFT code
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?

gp7··on Show HN: A minimal FFT code
You copy rather than use strided accesses. It's the same algorithm.
gp7··on Show HN: A minimal FFT code
The code is mostly equivalent to the recursive form found in the wikipedia article on the cooley-tukey algorithm. This is a good one to learn from, as its not only a simple formulation but it forms the basis of modern optimised FFTs such as FFTW (source[1], from the authors of FFTW).

As an aside, I also find the non-recursive, breadth-first, form easy to derive thru a process of code transformations of the depth-first form; explanations that start breadth-first are somewhat bewildering

[1] https://cnx.org/contents/ulXtQbN7@15/Implementing-FFTs-in-Pr...

gp7··on Operation Ajax: How the CIA’s first attempt at regime change nearly failed
Just a run of the mill human interest story about the checks notes CIA????
gp7··on Fearful of bias, Google blocks gender-based pronouns from new AI tool
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
gp7··on Papers of Srinivasa Ramanujan (1887-1920), mathematician
Mozart had extensive education and training????
gp7··on A First Course in Differential Equations for Scientists and Engineers
> 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

gp7··on Stop using strncpy already (2013)
Two years after this post, the Linux kernel added strscpy, the api of which is equivalent to the safe strncpy in this post. Internally, it stops copying once it reaches the null terminator.

https://lwn.net/Articles/659214/

gp7··on JupyterCon: I don't like Notebooks [slides]
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.

gp7··on The Ripper: The disturbing Visceral Games project that never was
Well, there was the Manhunt games, which always represented the worst side of Rockstar North to me.
gp7··on Using John Varney's rhythm wheel to differentiate 3/4 and 6/8 time signatures
That’s fair, but my assumption was that someone reading my reply would also have read the others, and I didn’t want to repeat what has already been said.
gp7··on Using John Varney's rhythm wheel to differentiate 3/4 and 6/8 time signatures
Time signatures are about writing and reading music. A beat being in 3 or 6 is independent from the time signature, which is whatever the transcriber thought best (you can always count a song in 6 in 3.) A piece in 4 might have pervasive use of triplets, so it would make it more readable to notate in 12/8 rather than 4/4, but there is no triplet-pervasiveness threshold for when to prefer one over the other. Likewise, it would be foolish to have the stress in a waltz occur on the 1st and 4th, then 3rd, then 2nd beat of the bar (this happens if you notate one in 4), but any enterprising composer would be able to thwart any rules you cared to come up with to codify that without much effort.

So: the time signature just describes how many times to count within a bar/measure, and what subdivision (that corresponds to a certain notation) you are counting. For communicating to another musician the rhythm of a song you'd just drop the subdivision part, because it's only relevant to notation.

gp7··on A PhD should be about improving society, not chasing academic kudos
Bizarre. This is coming from someone presumably embedded in the grant-writing machine that is modern academia. How do grant proposals justify their cost, exactly? Academia would be healthier if some back slaps at the next conference was all it took I think
gp7··on Why programmers are not paid in proportion to their productivity (2009)
I'm clever and stupid.
gp7··on Neural Style Transfer for Musical Melodies
Reverb of a static room at a point is as simple as that. Rooms with moving obstructions, with moving noise generators, at moving points, that's harder.
gp7··on YouTube gets material design
I can't quite describe it but the use of #F00 just looks wrong to me. Over saturated somehow
gp7··on Ask HN: What are your favourite developer blogs?
https://fgiesen.wordpress.com Most of his posts end up on the first page of hn. In fact there is one right now

http://nullprogram.com/ makes C look fun

gp7··on Making Your Own Custom USB Cables
I've had on/off problems for a couple years now with a usb powered audio interface (focusrite 2i2) causing popping sounds from speakers--recognisable as a DC thump but happening every few hours. Once I fixed it by using a powered usb hub, but a change in PC hardware made it come back. Eventually I found a support post from the manufacturer saying that you had to use the provided USB cable, and that others weren't supported. I'd changed mine for ergonomic reasons (it's short as hell) and this turned out to be the problem.

I've been wanting to know exactly what's different about the usb cable for a while. And if other devices expecting a standard cable might have problems using it.

gp7··on Gedit is unmaintained, some thoughts
C++'s rng is bad because it's very easy to set them up incorrectly, and people mostly do. See http://www.pcg-random.org/posts/cpp-seeding-surprises.html
gp7··on C++ Coding Guidelines (2014)
Compile time is a huge factor in maintainability!
gp7··on Windows 7, not XP, was the reason WCry spread so widely
I'm glad to hear I'm not the only person who's shot themselves in the foot by following apt-gets recommendations
gp7··on [dead]
Drudge is tweeting about this. Notable because it's apparently the only thing he's ever tweeted about and was simply:

  ROGER AILES DEAD
gp7··on Approximating sin(x) to 5 ULP with Chebyshev polynomials
This page crashes my chrome tab!!

Anyway, anyone interested enough in this to be reading this comment thread should go look up approximation theory and approximation practice by trefethen [0], which is a very very good book, that covers chebyshev polynomials in a very clear way. The real party trick you get out of it, though, is that by taking samples of functions at the roots of chebyshev basis polynomials and applying the discrete cosine transform, you can get a set of chebyshev coefficients to approximate a function in O(n log n) time

[0] https://people.maths.ox.ac.uk/trefethen/ATAP/

gp7··on Fourier transform – A math tool used in optics, MP3s, JPEGs and more (2013)
I made the fairly stupid mistake of shadowing the x-as-input and the x being integrated over in this post, but the gist is similar
Page 1 of 3Next →