HNHacker News
TopNewBestAskShowJobs

n3k5

434 karma · joined July 11, 2019

submissionscomments
n3k5··on Kaboom: an unusual Minesweeper
There were other possibilities, but you were punished for taking a guess when there were guaranteed-safe squares. Guessing is only supposed to be safe when you have to do it.
n3k5··on Dithering in Games, Part 1: Simple Quantization (2016)
That's the one; thank you very much!
n3k5··on Toward a Grand Unified Theory of Snowflakes
Also see … I mean hear: Radiolab's piece on the early days of snowflake photography (featuring Pope Kenneth, of course): https://www.wnycstudios.org/podcasts/radiolab/segments/25720...

> […] how it all began in a cold, snowy farm in Vermont in 1880, when a kid named Wilson Bentley put a snowflake under a microscope and started a lifelong quest to capture perfection. […] But his crystal-clear vision of reality was tied to a set of ideals that ultimately blinded him from the cold, hard facts in front of him.

Don't miss the companion blog post: https://www.wnycstudios.org/podcasts/radiolab/articles/25728...

n3k5··on Dithering in Games, Part 1: Simple Quantization (2016)
I usually think of dither as trading spatial or temporal resolution for dynamic range. This quote reminded me that this isn't the full picture:

> these computers […] performed more accurately when flying on board the aircraft […] the vibration from the aircraft reduced the error

Just yesterday I came across a similar story without realising that it's another example of dither. The latest episode (#300) of NSTAAF [0] contains a bit about photorefractive keratectomy (the predecessor of Lasik). I don't want to spoil the punchline too much more, so I'll just say that Dr. McDonald, the first surgeon to try this on a living human, coined the term "trash compactor patients".

Another thing I meant to reference would have been that page with those stunning visual examples of what can be achieved by combining ordered dithering with error diffusion in clever ways (it's not unlikely I got there via HN not more than a month ago). You know the one I mean? Bummer; unfortunately I didn't manage to find that link right now. But you can find interesting papers by looking up 'structure-aware error diffusion' and 'hybrid dithering'.

[0] https://www.nosuchthingasafish.com/

n3k5··on Best Illusion of the Year Contest - 2019 Finalists
Another technique for tuning into the perception of horizontal motion: Use your hands or forearms to block your view of most of the picture, leaving only a narrow horizontal slit. For me the effect persists upon expanding my view to the full picture again. To 'switch back', look at a thin vertical strip of the picture for a moment.

As soon as I manage to see the motion as left-to-right, the dots look yellow — though the impression is really close to flickering between red and green. How readily your visual system will merge individual strobes into a coherent, moving visual impression depends a lot on how awake/alert you are at the moment. So you could also try again when you're more tired. Another thing to try: Change the playback speed to 2x. Though I'm not sure if that will increase the frame rate to 60Hz or skip frames. In this case you want the former; it may be necessary to download the video and play it back locally to achieve that.

By the way, I once managed to produce a similar illusion completely by accident: I had made an engine for rendering totalistic 2D cellular automata (a superset of Conway's Game of Life) that randomised the state-transition rules upon a keypress. After a while of browsing random rules, I found one with a tendency to produce neat tiny gliders: A sequence of three distinct colours (and therefore states, I thought) racing across the screen — something like a cyan dot trailing a purple one behind it, with a pink one sandwiched between them. But then I looked closer and saw that the pattern was only two cells wide. Taking a screen-shot and looking at the freeze-frame confirmed that the gliders only occupied two neighboring cells, with two different colours, at any given point in time.

n3k5··on Software Library: MS-DOS Games
> I would like something that works uniformly across Windows, Linux desktop (such as XFCE, GNOME, KDE), and macOS.

Löve [0] has a great approach to cross-platform deployment [1]. It's not exactly constrained when you compare it to QBasic, but of course using only a subset of its modules is no problem :)

Of course the closest equivalent is … DosBox! Runs on basically every system, does graphics and sound and not much else :) Btw., Watcom in Open Source now [2]. IIRC Retro City Rampage 486 was made with that.

[0] https://love2d.org/ [1] https://love2d.org/wiki/Game_Distribution [2] https://github.com/open-watcom/open-watcom-v2

n3k5··on Things end users care about but programmers don't
> When someone does figure out the pattern, they waste a couple minutes moving their mouse very slowly across every square inch of the screen in search of more.

Ableton Live (a DAW) has an interesting solution for this: There are no tool-tips at all. Instead, you can open an 'info' box in the corner of the window/screen that instantly shows a quick explainer and relevant keyboard shortcuts for the control you're currently pointing at (and its name), without obscuring anything.

It's not perfect (e.g. there's no way to hyperlink to more information in the on-line help), but on top of being easily discoverable and put-away-able, it can do another nifty thing: For controls that are user-configurable, the 'info' text is user-editable as well. It's like source code comments, but for the GUI. E.g. instead of "Macro 3", you can have: "Glitches the wubs. Don't forget to wax the sidechain!"

n3k5··on Things end users care about but programmers don't
2019:

"The ellipsis character (…) means a dialog or separate window will open and prompt the user for additional information or to make a choice."

https://developer.apple.com/design/human-interface-guideline...

2005:

"An ellipsis character (…) after a menu item indicates to the user that additional information is required to complete a command.

http://www.idemployee.id.tue.nl/g.w.m.rauterberg/lecturenote...

1995:

"The ellipsis character (…) after a menu item means that the command needs more information from the user before the operation executes."

http://interface.free.fr/Archives/Apple_HIGuidelines.pdf

1987:

I couldn't quickly find a PDF I could link to (on archive.org it's "currently on loan"), but AFAICT it says essentially the same thing.

So the guidelines are super consistent. How strictly they've been followed is a more difficult question. Here's a screenshot of GS/OS (to which the 80s version of the HIG is supposed to apply) where they got it wrong: https://en.wikipedia.org/wiki/Apple_GS/OS#/media/File:AppleI...

Ditto on Macintosh System 1: https://archive.org/details/mac_Paint_2

n3k5··on DrumBot: Real-Time ML Drummer
TL;DR: If drumbot.glitch.me doesn't work for you, try running it locally [2]. It's surprisingly effortless!

First attempt at trying this out: 502 Bad Gateway.

Second attempt: I thought I didn't want to mess with Node, so I downloaded Magenta Studio [0] instead. When trying to load the Max patch, my potato promptly lost its will to Live. (Ba-dum tss [1].) Maybe loading a 900MB .amxd when you only have 1GB of free RAM isn't a great idea? Anyway, I'm not keen on risking another reboot today, so I'm putting this off for now.

Third attempt: Localhosting DrumBot [2]. Five minutes ago, I didn't have Node installed (I didn't even recall ever touching Node directly at all), but now (npm install … added 247 packages from 284 contributors … found 4 moderate severity vulnerabilities … npm start) the tensors are flowing already! Whoa, Node is so easy, any idiot can use it — even musicians ;)

I peck in a simple melody:

  Fly me to the moon
  Let me play Fly me to
Oops, this started looping at an unexpected point. I guess I should have stuck to a 4/4 time signature? DrumBot is equally confused and lethargically bangs out wonky shit like it's attempting to cure carbon monoxide poisoning with ketamine. Meet my new band: Tourette's Horse Tranquilizer.

I start over, this time with a proper MIDI keyboard plugged in. Initially this fails: MIDI Off messages trigger notes in the same way as MIDI On messages. This is easily fixed by routing the MIDI through a DAW. (Why? No idea.) I play a standard Boogie riff, except slowed down to 100 BPM (because I can't really play keys; I just have this controller for inputting notes). DrumBot analyses this (100% correctly) as a Chicago Blues turnaround and, apparently knowing that six and two is eight, immediately channels Casey Jones[3].

Dear fellow scholars: what a time to be alive! [4]

Btw. @notwaldorf: I just had a go at routing DrumBot's output back into my DAW and obtained good results by dragging parts of my custom drum kit onto the MIDI notes that seemed most relevant. Then I changed the input and now DrumBot is hitting notes I haven't mapped yet. I guess it's using the standard GM drum map? Implementing that in its entirety would involve setting up over 40 separate instruments :/ But I'm not supposed to go quite that far, right? Is there some documentation telling every monkey how to make DrumBot king of the bongo bong? [5]

[0] https://magenta.tensorflow.org/studio/ [1] https://www.ableton.com/en/live/max-for-live/ [2] https://github.com/magenta/drumbot [3] https://youtu.be/RSTF6GJ23LY [4] https://www.youtube.com/playlist?list=PLujxSBD-JXgnqDD1n-V30... [5] https://youtu.be/cfLIlP-GAmg

n3k5··on Why databases use ordered indexes but programming uses hash tables
For the purpose of making a tree data structure, all linear orderings would be equally useful. Hashing only provides a partial order, so it's important to choose a hash function that won't assign the same hash to large batches of items.

But it only needs to have this property for hashes of one particular size, whereas a hash map requires a function that behaves well for a variety of hash sizes. So there's an opportunity for using a cheaper hash function.

n3k5··on How “randomizers” are breathing new life into old games
It's set up so all contestants get the exact same set of mods. Finishing in world record time in such a competition is indeed meaningless; it's just about winning the race.

So this isn't necessarily what you'd call a randomiser — often the mods aren't randomly generated at all, but carefully curated by the event organisers. But it's à propos in terms of 'new experience every time'.

One neat aspect of this approach is how unexpected the mods can get; e.g. your player character could be swapped out for a character from a different game. Then there's the extreme variant of mystery races, where the runners don't even know which games they're going to play.

n3k5··on AWS Wavelength: Deliver ultra-low latency applications for 5G devices
> 5G is about throughput, not latency.

For now. But in the longer term, the telcos are promising lower latencies. I think the magic search term for entering the relevant rabbit-hole is URLLC.

Seems like the main factor in Wavelength's latency reduction is edge computing; from a technical perspective, that should work just as well with 4G user equipment. But once you have a single-digit ping, shaving off an extra couple of milliseconds becomes noticeable. So while the strong emphasis on '5G' may largely be marketing hype, it's at least not complete bologna.

n3k5··on The next generation of wall chargers
You have to look at the plug in combination with the socket.

https://en.wikipedia.org/wiki/Schuko#Safety_features

n3k5··on Only eat oysters in months with an 'r'?
No, silly, it's only in months with an ɹ.
n3k5··on Wrapping Images Around Fractals
> Maybe one day I will revisit this project and properly rewrite the whole thing.

I recommend doing it in GLSL. It's very little effort to implement (about 30–50 lines of code) and even on a modest GPU it'll run fast enough so you can explore different parameters interactively. As a bonus, you can get MIP-mapping for basically free — no more aliasing!

In case you don't want to learn OpenGL or Vulkan, you can use a tool such as Shadertoy.

n3k5··on Brave launches 1.0
In some ways, this looks promising: Maybe in a few years, they'll be supporting many more countries and payment providers. I'm not overly skeptical about Brave being able to become a viable alternative to my current go-to browsers either — though I hope Safari and Firefox will keep ramping up privacy-protecting features, and I think for the purpose of getting Brave Rewards to critical mass, it would be best to provide plug-ins for integrating that functionality with other browsers as well.

But I see one big problem: For a significant amount of media, a browser isn't the most desirable content delivery mechanism. Take Youtube, for example. The web site is great on PC, but on mobile, the native apps are much better. There's no way those will add support for Brave Rewards, and the chances of the browser-based version catching up don't look so good either. Similarly, there's music streaming, podcasts, F2P games …

I don't want to be in a situation where I have to choose between accessing content in the way I prefer and jumping though hoops for the sake of shuffling those precious BATs around.

Equating the value I'd assign to a creator's work with the time I spend on perusing it seems quite iffy, too.

Meanwhile, Patreon already has most of these issues solved; in a super simple way.

I used to be interested in Brave because of their pro-privacy stance. The more I think about that BAT stuff, the less attractive I find the entire project. I can give them the benefit of the doubt and assume that they're idealists striving to build an ecosystem where everyone can help to create valuable on-line content, rather than entrepreneurs trying to syphon a portion of existing revenue streams into their accounts. But then I'm inclined to question their competence.

n3k5··on Purple Doesn't Exist
People who have a bit of a clue about how human colour vision works know that the "purple doesn't exist" factoid is bullshit. No, that's not facetious; that's the proper technical term: "Purple doesn't exist" isn't wrong — it's not even wrong. It's a writing prompt for pseudo-scientific blog spam; it's bullshit.

Ideally, you'll have had a high-school education featuring a biology teacher explaining the stuff with the rods and the cones and an art teacher explaining colour theory, so you can just put two and two together. But if you haven't had that privilege, there's good news: Instead of enduring a harried rant by some random HN commenter, you can just lean back and watch a short lecture from an excellent science educator: Why you can't take a good picture of a rainbow by Steve Mould.

https://www.youtube.com/watch?v=HauiF_AQUIY

n3k5··on Demoscene guidebook (2018)
> Intrinsic Gravity by Still

This one is fun to watch on a 3D display. (As much of it is black & white, anaglyph should also be worth a shot.)

Most of the effects could have plausibly been rasterised or blitted into a flat plane; alternatively, all of it could be done in a pixel shader which just colours in two triangles that fill the screen. But (as I discovered to my delight one day when I happened to have access to a Windows machine with a 3D monitor) it's all 3D geometry with a perspective projection.

For example, the wibbly-wobbly cone[0], viewed in 2D, could just as well be a flat bunch of sinusoidally gyrating discs all XORed together. But these discs are properly stacked along the Z axis.

The demo doesn't natively support stereo displays, so you have to find a tool that can inject itself into the graphics pipeline and modify the projection matrix for each eye. I don't remember which one I used when I tried that, but it had a nifty feature you should seek out: Hotkeys that let you adjust the mapping of depth to the stereoscopic shenanigans (separation and convergence) on the fly. Being able to make such tweaks on a scene-by-scene basis helps a lot with a production that was only designed for cyclops mode originally.

The same technique can be applied to many PC demos, but usually it only amplifies a 3D effect that was already there in the first place. In the case of Intrinsic Gravity, it gives you an extra dimension of 'whoa'.

Bonus recommendation for those who can't be bothered with any of that and just want to watch a neat recording on Youtube: Stargazer by Orb & Andromeda[1]. Nothing earth-shattering; just a personal favourite with a modern take on old-skool demoscene aesthetics and neat effects that don't fall apart in a video capture with limited bit rate.

[0] https://youtu.be/-ZxPhDC-r3w?t=67 [1] https://youtu.be/xgtghVdWlVY

n3k5··on Amish Counter Top Kitchen Appliances Run Off Compressed Air (2012)
There's a problem with this proposal: As cooling down the entire fridge via this method is not feasible, you'd have to thermally insulate the can from the outside case of the fridge. As in a normal household fridge, the can would have to give off its heat to the surrounding air inside the cooled chamber. The more of that air you pump out, the more that process slows down.

Instead, you could just take an ordinary mini fridge and replace the electric motor with a hand crank. Or maybe an exercise bike.

It could measure how much work you have put in and show you an estimate of how much longer you need to pedal/crank until you have expended as many calories as the beer contains.

n3k5··on Fractional Brownian Motion for Terrain Generation
You missed that the noise function is given n-dimensional coordinates as an argument. Rather than picturing an RNG, you can think of it as a texture unit that samples from an n-dimensional image of some noise with certain characteristics.

The order in which sample values are retrieved doesn't matter — of course it doesn't! It's important that fragments (think 'pixels' in case you're wondering what fragments are) can be evaluated independently and in any order, as computing fragments is supposed to be a massively parallel operation.

It this context, you have to throw out the concept of 'previous' sample values and replace it with 'nearby' values.

n3k5··on Privacy Fundamentalism
Yeah, pretty cool, if you're into cypherpunky solutions to an extent where you don't mind the accompanying dystopia.

I get why some users need Tor, many of them for agreeable reasons, and that they would benefit from more people using Tor (and having more nodes available). But I think making it the default way of using the internet for everyone would be stupid. If the average connection goes through n hops, the entire infrastructure would have to be multiplied by that factor. Just the environmental impact (in terms of increased energy consumption and hardware production) would be significant. And when Tor is the only effective option you have for escaping unwanted tracking, you're disadvantaged as soon as you want to use a service that doesn't work well with he increased latency.

There has to be a better way. Not that I could say what exactly that would be, but what would be really cool to see is a world in which everyone has worry-free internet access. Multiplying the cost doesn't seem like the best approach.

n3k5··on Fewer Than Half of Google Searches Now Result in a Click
> The difference between a product and a feature is nothing.

Granted, but the comment you replied to was about the difference between a feature and a company.

n3k5··on Fewer Than Half of Google Searches Now Result in a Click
That's depressing, but I will remember that when I come across an unnecessarily AMPified URL, I shouldn't blame the publisher for making this possible in the first place.
n3k5··on Fewer Than Half of Google Searches Now Result in a Click
> If I search "Non-standard evaluation in left-hand side of mutate command R", it's a bit weird that I'm expected to click the first StackExchange rather than getting a canonical answer excerpted.

Are you saying that there's no excerpt at all above the search results, when you expected one; or that there is an excerpt, but it's not from the most appropriate/relevant source?

It's annoying when there's a page that has all the information you might need, but to find it, you first have to scroll past a bunch of Stack Overflow posts that are more suitable for dilettantes who prioritise trying a quick fix over learning best practices. But when you do make the effort to find the most promising link and your browser allows the search engine to record your choice, you at least get a vote regarding how the ranking should be adjusted. When users just look at the results but don't interact with them any further, that feedback vanishes.

A win for Google isn't necessarily a win for Google users.

n3k5··on Shepard Tone
> variations in timbre

Good insight, but these variations are correlated with variations in pitch. It's a single note in the sense that it's always a C; not necessarily always the same octave.

> horns [...] can only play one note

A piece in bugle scale doesn't sound like one note to an average listener, nor does playing such an instrument feel like staying on one note. I'd rather compare this to a didgeridoo than a horn.

But if I concede that we don't need to adhere to lower grade music theory and that the performer will not use advanced techniques that can alter pitch without the use of a slide or valve, what argument could be made to support the "one note" claim?

To clarify what I'm looking for, here's an example of such an argument (but I don't know how much, if at all, it applies to actual fixed-length horn instruments): If the exact frequencies of a note's overtones deviate from a pure harmonic series, one could make a distinction between pitch-shifting a note and varying the timbre. I.e. playing the next note above the instrument's fundamental pitch doesn't multiply the individual frequencies by a constant factor, but repeats the exact frequencies of the fundamental's overtones, thus reordering the frequency ratios between adjacent overtones.

n3k5··on Shepard Tone
In this context, the term is just used to tell you to think in terms of pitch classes — where all notes that are separated by an integer multiple of an octave belong to the same class — and not expect actual Shepard tone trickery related to absolute pitch.

However, the relationship between absolute pitch and frequency isn't always trivial. The latter is a physical phenomenon, but the former is psycho-acoustic. When you have sounds with a normal set of overtones that align with a harmonic series, the perceived pitch matches the fundamental frequency. But that frequency doesn't actually need to be audible. By weighting the amplitudes of the partials in a certain way, you can also construct a sound that will be perceived as different pitches by different listeners, or by the same listener under different circumstances.

With sounds whose frequencies aren't all harmonic, assigning a pitch can get more complicated.

n3k5··on The Door Problem of Combat Design
Exploiting choke points to optimise your tactical positioning is a recurring trope. Some games just expect you to do that anyway. As mrob mentioned [0], roguelikes are notorious for this; but I wouldn't call that bad. It's more a matter of taste. Particularly in roguelikes, you'll also encounter situations where the tactical advantage is subverted by enemies that can teleport or spawn minions behind you.

One common, but somewhat clunky countermeasure is to start the fight only once you're inside an arena and lock down the exits until the adversaries are defeated. It's present in many genres, from metroidvanias to ostensibly tactical action (e.g. the Metal Gear Solid series).

In a Quake-style FPS, having power-ups not just available, but regularly re-spawning in exposed locations is a tried and true mechanic that maintains an exhilarating ballet between risk and reward. But how could one translate the elegant flow of this gameplay loop to a more realistic (or less artificially 'gamey') setting? As Andrew says in the article, you could make more linear and scripted encounters. Which is fine for story-driven games, but limits player agency.

If you'd prefer more organic, emergent game-play, there are other options. Instead of initiating combat only upon the player approaching a set piece, opening a monster closet, or crossing a trigger, you can instruct enemy AI to patrol the potential avenues a stealthy player might take and guard the choke points a speed-runner might attempt to barrel through. From there, you can temper the utility of the player retreating. There could be speedy mobs you wouldn't want to turn your back on. Level design that enables flanking — implement a nav mesh that guides your agents to split between chasing the player down and heading her off at the pass.

But none of that is objectively superior to more predictable fights. Nor is it guaranteed to to be perceived as more enjoyable than comparatively random encounters. Ultimately, what you really should avoid is a ruleset that keeps players from having fun because the interesting game play loops you intended to happen end up being trumped by dominant strategies that are obviously better for approaching the victory condition, but more boring and tedious to execute.

The actual problem isn't with players figuring out how to exploit doorways. It's rather that moment when they resign to repeating the same move ad nauseam.

[0] https://news.ycombinator.com/item?id=20663044

n3k5··on What Does a Coder Do If They Can't Type?
Tavis Rudd's Using Python to Code by Voice [0] is also interesting.

Looking up that URL, I came across the more recent Coding by Voice with Dragonfly [1]. Haven't seen that one yet, but just quickly skimmed through. Unfortunately the live demos are silent (you can't hear speaker Boudewijn Aasman talk to the computer), but it seems worth checking out if you're interested in setting up some recent voice recognition software with your own custom voice command syntax.

[0] https://youtu.be/8SkdfdXWYaI [1] https://youtu.be/P5DCDiCv4TE

n3k5··on Show HN: Beatboxing for Kids – Teach Your Child to Beatbox Using Everyday Words
Desktop Safari doesn't play them either. I guess it's because Apple still doesn't like Vorbis?

For iOS users who have a compatible player installed (I think VLC should do the trick), here's the direct links, in order of appearance:

https://beatboxingforkids.fun/boots_n_cats_words.ogg

https://beatboxingforkids.fun/boots_n_cats_beatbox.ogg

https://beatboxingforkids.fun/dog_dog_keys_words.ogg

https://beatboxingforkids.fun/dog_dog_keys_beatbox.ogg

https://beatboxingforkids.fun/bud_d_daughter_words.ogg

https://beatboxingforkids.fun/bud_d_daughter_beatbox.ogg

https://beatboxingforkids.fun/goose_kid_d_words.ogg

https://beatboxingforkids.fun/goose_kid_d_beatbox.ogg

https://beatboxingforkids.fun/buff_double_puff_words.ogg

https://beatboxingforkids.fun/buff_double_puff_beatbox.ogg

n3k5··on Every Noise at Once
Filthstep didn't sound anything like what I was expecting. But I didn't really know what to expect. So then I selected some genres for which I could confidently propose an exemplary piece. Ragga jungle: precisely correct. Chicago blues: nailed it. Ragtime: the very archetype. Schranz: maybe that's the intro of a track that eventually meanders into schranz, but the clip on hand is way off. Swedish pop: pretty good. Glitch hop: no way. Gospel singers: US centric, but OK. Nigerian Hip Hop: yeah that's sort of valid in the sense that 2Baba is a Nigerian hip hop producer, but that sample is neither especially Nigerian nor particularly hippy-hoppy. Electro swing: all thumbs up. Bury St Edmunds Indie: A truly sublime blend of Sudbury angst and Lavenham melancholy, virtouosly caramelised in Ipswich je-ne-sais-quoi. (Yes of course I'm joking about that last one; the combination of specific location with vague genre is just absurd.)

This seems like a useful tool for discoveling new sounds, but when it comes to finding out what Polish free jazz really sounds like, I wouldn't trust it one bit.

← PreviousPage 4 of 5Next →