HNHacker News
TopNewBestAskShowJobs

pfedak

244 karma · joined August 9, 2016

submissionscomments
pfedak··on 100x Faster Than Wi-Fi: Light-Based Networking Standard Released
To set the record straight for the above comment -

- it's true that there isn't a precise frequency needed for microwave ovens to heat food

- however, "polarity flipping" is just a description of electromagnetic radiation itself, and shooting enough EM radiation at food in a frequency range it absorbs will heat it up via dielectric heating

- microwaves have no relationship to any specific resonant frequency of water - the vibration frequencies are orders of magnitude higher https://en.wikipedia.org/wiki/Electromagnetic_absorption_by_... while rotation response inherently does not have a peak

- otherwise, yes, the motion of (polar) molecules induced by an electric field is indeed the mechanism of dielectric heating

pfedak··on Nour: Play with Your Food (from Panic)
Looks like a demo released on steam a few weeks ago: https://store.steampowered.com/app/1141050/Nour_Play_with_Yo...
pfedak··on Bit Hacking (with Go code)
Another interesting little go difference (along with other newer languages like rust, but not c/c++/c#/java/javascript) is making equality lower precedence than bitwise operators, so that var & 1 == 0 tests the lowest bit of var, which makes it more convenient for bit hacking.

This feels natural now, but other languages inherited a decision dating back to B, when logical operators like && and|| didn't exist, and the bitwise forms were used in their stead.

pfedak··on GPT-4 “discovered” the same sorting algorithm as AlphaDev by removing “mov S P”
Uh, I guess this got combined with the thread on https://twitter.com/DimitrisPapail/status/166684395282416846.... The original result is legit, this GPT tweet has a number of issues
pfedak··on GPT-4 “discovered” the same sorting algorithm as AlphaDev by removing “mov S P”
I posted a reply, but I think ultimately this is just a coincidence. There's a naïve reason that "mov S P" looks redundant ("just use S instead of P later"), but in typical GPT fashion, this is specious, and can't actually be done. It's essentially trying to swap two variables without using a temporary. If x86 had a conditional swap instruction, it could, but it doesn't, and just doing "cmp,cmov,cmov" can't handle it.

Another giveaway is that removing that line in the real optimization changes the output of the provided snippet if C < B. It feels like a hard sell to say GPT picked this line for that subtle reason based on information not provided, but explained it with something only correct at surface level.

pfedak··on Demystifying Tupper's Formula
This year's MIT Mystery Hunt had a puzzle requiring you to implement increasingly complicated image-generating formulas: https://puzzles.mit.edu/2023/puzzlefactory.place/puzzles/gra...
pfedak··on Rooms.xyz
Can be a fun linktree alternative at the very least. Spent way too long making https://rooms.xyz/pzf/noclip, the physics engine they expose has some unfortunate limitations but there's enough to have fun with.
pfedak··on The 2-MAXSAT Problem Can Be Solved in Polynomial Time
I had trouble with that too initially. I think that's actually fine: the representation the paper wants to use is that the variables in a path are the ones set to true, so omitting one means that variable must be false to satisfy the expression.

It does create issues with determining which expressions are satisfied, since two different paths can meet at a merged trie vertex higher up, which requires the extra bookkeeping that kills it.

pfedak··on The 2-MAXSAT Problem Can Be Solved in Polynomial Time
The conversion to DNF is fine. The original clauses map directly to pairs of new clauses, so fixing an assignment to the original variables V you can always satisfy the same number of the DNF clauses. You can do worse by choosing the wrong values for X, sure, but there's always a straightforward correspondence.
pfedak··on The 2-MAXSAT Problem Can Be Solved in Polynomial Time
Unsurprisingly, there's nothing here. Most of the paper describes a brute force search across all possible variable assignments in the form of a graph (with some pointless polynomial improvements like making it a trie), where you build a path of vertices representing each set of truth values that satisfies a given expression. This clearly has exponential size, which the author alludes to in the "improvements" section by noting it does "redundant work". This is addressed by collapsing the exponential graph down to have only one vertex for each variable*expression pair (if you ignore the trie) and adding exponentially many labels for the different paths to reach a given vertex. (incidentally, to the extent that it's described clearly, it seems like the improved layered graph would basically be the same as the original non-layered graph)

The final complexity discussion uses the graph size constraint gained by the "improvement" but doesn't consider how to handle the extra labeling meaningfully. Basically, the pre- and post-improvement algorithms put the exponential work in different spots, and the sloppiness of the algorithm description (I mean, really, why tell us you're using a stack for BFS and then have "determine the subset of satisfied constraints" as a step) makes it easy to ignore.

I'm also being a little generous with the algorithm itself. As described, some of the trie optimizations seem to make certain combinations of satisfied expressions impossible to notice, but I think it's not a big deal to make this part work. The properties of the trie structure (and of sorting the variables by occurrence, for that matter) don't seem to be used.

pfedak··on Sold a Story: How Teaching Kids to Read Went So Wrong
Sorry, I should have been clearer, totally agree about the podcast being a poorer source on the reality and history, and just not trustworthy on the big picture. The article you shared is a fantastic resource, but I would think better of it if it had laid out the sort of strong, pragmatic argument you made here about teachers' autonomy. The article really doesn't want to question the status quo, which would be fine for a historical overview, but feels incongruous with the constant needling of anyone who happens to be pushing phonics (whether because of concerns about dyslexia or neuroscience).

I also didn't mean to suggest those terms were invented by that article, just that they reflect the perspective of the people who use them. I'm assuming initial proponents of the "simple view of literacy" didn't describe it that way, just as we might call "whole language" something different if it ends up being discredited (cf. the focus on cueing in TFA).

pfedak··on Sold a Story: How Teaching Kids to Read Went So Wrong
That definitely comes through in the piece the parent linked, it's very much a narrative of fighting against misinformed outsiders pushing phonics for various research-based reasons, instead of just trusting teachers.
pfedak··on Sold a Story: How Teaching Kids to Read Went So Wrong
I'd dispute your characterization of the NEPC summary as well-reasoned. It's definitely a different perspective, but it's clear in a preference for valuing the experience and beliefs of "literacy scholars" over any sort of evidence that could contradict them. It does seems like a good view of the education institution's side of this argument.

It is careful to point out even minority criticism of phonics-centered instruction, while suggesting that disagreement with cueing approaches is a result of misunderstanding. It explicitly devalues "narrow" "experimental and quasi-experimental research" in favor of "decades of classroom-based and other forms of qualitative research" (how long has the experimental research been going on?). Even the naming feels slanted: the cueing approach gets called "whole language" or "balanced literacy" while opposing views start with "simple view of literacy". The "structured literacy" section ends with "although literacy researchers caution there is still much to learn about the brain and learning to read", while the cueing summary is free of similar caveats and emphasizes that it can adapt to individual students, as if other methods couldn't.

Ultimately it makes no actionable recommendations for what should actually be taught, except that no particular method should be mandated or banned, and that education should be "student-centered" (curious about the alternative...).

pfedak··on ChatGPT generated a puzzle game
I would have much preferred if the author spent more time giving an objective assessment of what ChatGPT had actually accomplished at each step.

The "Labyrinth Sudoku" description feels like a classic language model speciousness. It doesn't actually work: you can't fit the digits 1-9 if you can't use all the cells, and it hasn't modified sudoku rules in a way that makes paths relevant. Maybe you can come up with a way to salvage it, but ChatGPT didn't.

The initial rules for Sum Delete should be read with this in mind: it sounds reasonable, but there's no reason to trust that it can make a puzzle at all, let alone a good one. Also, unsurprisingly, the provided puzzle isn't solvable (the 25 column requires use of the 9 in the first row).

Similarly, I'd love a critical analysis of the initial code. Did it guarantee solvability? An awful lot can be swept under "improving the design".

pfedak··on A baffling scale transform on a chart of university course selection trends
The author's lack of mathematical literacy is pretty striking. I don't mean not realizing it was a log ratio, but presenting the raw percentage-to-pixel expression as if it were meaningful. Clearly the constant term and overall scale factor just depend on the basic dimensions of the plot, so ultimately the mapping they found is x-0.21x^2.

Beyond that, they were just picking a hypothesis without thinking how a bad plot could have been generated. It's interesting to note that the correct mapping, from their perspective, would have been the Taylor expansion of log(1+x), which would start x-x^2/2+x^3/3, so their goodness of fit metric (large R^2) wasn't a useful indicator, and there wasn't a meaningful place to cut off the degree.

pfedak··on We're getting “helpful” ChatGPT generated comments on the Svix GitHub repo
https://github.com/search?q=+commenter%3Aswarna1101

retrieves other issues that user has commented on. Some have code, but it's usually examples/boilerplate except when previous comments cited a relevant snippet.

pfedak··on Peter Norvig critically reviews AlphaCode’s code quality
One aspect of the solution which I haven't seen touched on is that this is a problem for which a straightforward greedy approach works. I know when I do competitive programming, "will greedy work?" is usually the first question; greedy strategies are natural (here there's the insight of going backwards, true), and often it's faster to just implement it and submit than actually prove it to myself.

The output doesn't give me much confidence that, if we tweaked the problem slightly to make the greedy approach not work (e.g. certain characters/positions can't be replaced with backspace), we'd still get a working solution out. We might get something that looked extremely similar to this, but didn't actually solve the problem.

As I said, this isn't too different from what I'd consider human performance on these problems, but it makes being able to trust the output (and the model's confidence in the output) even more important.

pfedak··on The genius of binary space partitioning in Doom (2019)
Do you know how much changed for the sequels? From some reverse engineering, Crash Warped relies on depth bucketing for dynamic triangles, while level geometry is streamed from the disk based on the camera position, already at the appropriate LOD and sorted and bucketed. Is the BSP logic you're talking about real-time, or part of a similar pre-processing step?
pfedak··on The History of ‘Ampersand’ (2020)
Indeed, this article is embarrassingly wrong. Not sure how anyone could write

> The letter I [...] would be referred to with the phrase I per se, I, which means in Latin "I by itself (is the word) I."

It's the letter I, not the word. It's like a half-remembered explanation

pfedak··on Can you be sure to clear a line at Tetris?
maybe https://randomascii.wordpress.com/2014/01/27/theres-only-fou...
pfedak··on Kaitai, binary format parsing web IDE
The concept is great, there are a handful of limitations that become more apparent with actual use. The main one is there is no encoding, just decoding. The generated code and representation of the parsed data also sometimes feel idiomatic to the language used, particularly in cases where I found I had to add extra levels of indirection to satisfy kaitai.
pfedak··on A stochastic method to generate the Sierpinski triangle
As others have pointed out, a generalization of this method (iterated function systems) can generate a large class of fractals. There's a some fun software for generating these ( see https://en.wikipedia.org/wiki/Fractal_flame) which also adds coloring based on the sequence of function applications, resulting in a pattern that respects the fractal structure.

Going a step further, changing the "functions" over time can create smoothly animated fractals. Electric Sheep (https://electricsheep.org/) is a screensaver version of this which doubles as a distributed computing network to generate them. It also mixes in non-linear transformations which makes for some impressive, mesmerizing patterns.

pfedak··on A digital museum of video game levels
I'm hoping to have the FFX particle system (mostly) implemented soon, which will make a big difference. If you join the discord, I'd be happy to help give you some help with that process. Compression algorithms themselves are often standard, but the underlying data formats can be more involved.
pfedak··on Implementing strict three-point perspective
One thing I didn't see mentioned in the article is the motivation for choosing the particular (exponential) mapping. If you imagine replacing your function with f(s)=1-1/g(s) for some g with g(0)=1 which goes to infinity as s does, then as long as g grows faster than polynomial you'll obtain the same properties. Something like x^x, or just 2^sqrt(x). 2^x certainly seems the simplest, but was there a further reason?
pfedak··on Implementing strict three-point perspective
I think a lot of this confusion stems from the author framing this project in a way that is, frankly, nonsense. Vanishing points have nothing to do with the clipping plane, and 3D computer graphics isn't trying to approximate the coordinate transform described in the post, it's trying to emulate real-life optics. The sense in which this definition is "strict" is based on ignoring that N-point perspective is just a tool for drawing lines parallel to the coordinate axes with correct perspective. If the author had framed this as just a fun "what if", making every line converge to the vanishing point, it might have been better received.

The observation that some lines look strange is about as meaningful as the same observation on an any given map projection. It's definitely true, but it all depends on the choice of mapping function, nothing inherent to spherical geometry.

I choose map projections for a particular reason: as has already been pointing out, there's no connection between this "strict" definition and an exponential coordinate transform. Any function mapping the axes that grows faster than polynomial would produce the desired behavior (essentially, you need the ratio between z and x on a line a*x + b*z = c to approach zero or infinity), but would produce different "line" shapes. This choice is entirely arbitrary, and is in fact equivalent to simply mapping the underlying space by a related transformation and then using a normal projective transformation.

pfedak··on Regex Cross­Word
You can scroll the letter bank. It all shows up in landscape for me, but that obscures the grid.
pfedak··on Chaos Ink
The main shader:

uniform vec3 mouse; uniform vec2 resolution; uniform sampler2D texture;

vec3 computeNormal( vec4 n ) {

  // pixel scale
  vec2 un = 1.0 / resolution;
  vec2 uv = gl_FragCoord.xy / resolution;

  // tex sample neighbour-4;
  vec3 n_r = texture2D( texture, uv + vec2( 1., 0. ) * un ).xyz;
  vec3 n_l = texture2D( texture, uv - vec2( 1., 0. ) * un ).xyz;
  vec3 n_u = texture2D( texture, uv + vec2( 0., 1. ) * un ).xyz;
  vec3 n_d = texture2D( texture, uv - vec2( 0., 1. ) * un ).xyz;

  // partial differences n-4;
  vec4 dn = vec4( n.z );
  dn -= vec4( n_r.z, n_l.z, n_u.z, n_d.z );

  // right - left, up - down;
  vec2 xy = vec2( dn.x - dn.y, dn.z - dn.w );
  xy += n_r.xy + n_l.xy + n_u.xy + n_d.xy;
  xy *= 0.89;

  float z = length(xy) * 0.1;

  return vec3( xy, z ) * 0.25;
}

void main() {

  vec2 uv = gl_FragCoord.xy / resolution;

  // normal sampling
  vec4 height = texture2D( texture, uv );

  float vel = height.a; // previous velocity
  float elasticity = 0.002;
  float viscosity = 0.06;
  vel += - (height.z - 0.01) * elasticity - vel * viscosity;

  // compute normal advection
  vec3 normal = computeNormal( height );
  normal.z += height.z + vel;

  float dist = distance( mouse.xy,  gl_FragCoord.xy);
  float mouseRadius = 10.0;
  float peak = 1.9; // max-height
  
  if ( dist <= mouseRadius ) {
    float dst = ( mouseRadius - dist ) / mouseRadius;
    normal.z += pow( abs(dst), 1.9 ) * peak * 2.5;
    normal.xy -= normal.xy * pow( abs(dst), 1.9 ) * 0.1;
    normal.z = min( peak, normal.z );
  }

  gl_FragColor = clamp( vec4( normal, vel ), -1.0, 1.0);

}
pfedak··on Low-cost measurement of facemask efficacy for filtering expelled droplets
The title of the first study is:

A cluster randomised trial of cloth masks compared with medical masks in healthcare workers

Not only is your presentation of its results in bad faith, you rely on people not reading the article.

pfedak··on Turning Off Autoplaying Previews
taste.io does Awful/Meh/Good/Amazing
pfedak··on Let's remove quaternions from every 3D engine (2018)
Could you elaborate more on interpolation and weirdness of composing quaternions? I thought a big selling point for quaternions was the ease and naturalness of just using slerp, whereas with euler angles a similar approach gives bad results. When you mention rotations about a vector, do you mean you decompose the desired rotation matrix into axis/angle? Otherwise I'm very impressed by your ability to visualize compositions of arbitrary rotations.
← PreviousPage 2 of 3Next →