HNHacker News
TopNewBestAskShowJobs

gtrevorjay

265 karma · joined February 1, 2016

submissionscomments
gtrevorjay··on Show HN: Jerrica, a 100% scheduled, Web Audio native, MOD player for JavaScript
Usually I associate that sort of problem with *stopping* a sample (since the stop will almost never happen at a point where the wave is actually at zero). Interesting that FF might have problems at the beginning, since most samples do indeed start at zero. I'll explore around that. Cheers!

Edit: midiano.com is excellent! Super useful to be able to visualise MIDI's that way.

gtrevorjay··on Show HN: Jerrica, a 100% scheduled, Web Audio native, MOD player for JavaScript
The lag happens because FF throttles the frame rate that's calling Jerrica when a tab isn't the center of attention. When used in a game, the developer could choose the lazy route I did in the demo or could stop calling Jerrica completely.

In terms of the clicks and pops, if it's not an imposition, could you let me know if you hear similar artefacts in the Newgrounds game listed in the FAQ? That MOD file was specifically modified to try and minimise that issue and I'd be interested in if it sounds better or worse on your setup.

gtrevorjay··on Show HN: Jerrica, a 100% scheduled, Web Audio native, MOD player for JavaScript
Ha. Thanks. Bonus geek/Marvel points if you understand the irony in Jerrica being 100% written on my custom one-handed keyboard named after Ruth Handler.
gtrevorjay··on Show HN: Jerrica, a 100% scheduled, Web Audio native, MOD player for JavaScript
Thanks! The demo is dumb stupid in terms of drawing the equalisers (canvas), but that actually makes it a better stress test.
gtrevorjay··on Show HN: Jerrica, a 100% scheduled, Web Audio native, MOD player for JavaScript
Author here. This is the major drawback of this approach. Since I'm tuning the sound tone by adjusting the playback rate, what algorithm the browser uses for up and down sampling is a major aspect of how playback sounds that I have no control over. I think one browser uses nearest neighbour and the other uses linear interpolation (I forget which uses which). Ironically, NN is more accurate in terms of sounding like an Amiga
gtrevorjay··on Show HN: The Handler: My Eight Key Handheld “Dream” Keyboard
Arduix uses chords but QMK has a more advance system it calls combos where it detects keypresses that are pressed sufficiently close together. There are actually layout shifts on top of that as well, so--for example--you can layout shift to "nav mode" and be able to use the arrows as single keypresses. There's a similar mode for using the keyboard as a mouse.

[edit] Here's a link to a reference sheet for Artsey.io, of which Ardux is a fork, it gives you a pretty good idea for how the board is used in practice: https://raw.githubusercontent.com/artseyio/artsey/main/layou...

gtrevorjay··on Show HN: The Handler: My Eight Key Handheld “Dream” Keyboard
What's really invigorated everything is cheap microcontrollers and USB/bluetooth. That lets you take your weird layout with you instead of depending on soft remapping.
gtrevorjay··on Show HN: An HTML endless runner under 900 lines without frameworks or libraries
A few people have asked via Discord why I chose to use `DeviceOrientationEvent`. As far as I can tell, it's the most supported accelerometer API. A cursory [Can I Use](https://caniuse.com/?search=DeviceOrientation) search is misleading because a few search entries combine `DeviceOrientation` and `DeviceMotion` APIs and because earlier versions of the API also have entries. If you search for [DeviceOrientationEvent](https://caniuse.com/?search=DeviceOrientationEvent) itself, you will see it's quite well supported. Mobile Firefox doesn't work, but I haven't been able to get any accelerometer API working on Firefox. The only issues I've really run into is that many Androids you'd expect to have accelerometers don't and that there isn't a canonical "up" for Android landscape like there is on iPhone (lock button is up). I was able to get the top negative reviewer up and running after realizing that he just had to turn his phone the other way around.
gtrevorjay··on Show HN: An Actually-Tiny Basic for Arduino
Not exactly? Structurally yes, in that before we had fancy tools like "ANTLR" the standard way to write an interpreter/parser was to in more or less a straight-forward way translate the grammar into something that would process a stream of tokens. No in that "Tiny Basic" is double interpreted. The idea was that instead of publishing a huge listing of "Tiny Basic" for a particular platform Allison instead would publish one written in an intermediate language where it would be obvious enough (at least to his audience) how to implement each of the "op codes" within the intermediate language. I wanted to keep with that tradition of pseudo-machine instructions and so I made way more use of Goto (for example) than you probably should.
gtrevorjay··on Show HN: SM510 (Game and Watch) Homebrew Games
Hopefully this will be the end of my semi-obsessive journey and I won't end up actually having to manufacture physical units. I guess that remains to be seen though. These were made with our own (bad) assembler: https://github.com/trevorjay/marios-binary-factory . Technical overview here: http://montrose.is/sketching/201808260123.html .
gtrevorjay··on Show HN: The Plainsight Collection – Play Games at Work Disguised as Ads
We just debuted this as an art piece at Brisbane's "Game On" event: https://www.facebook.com/GO423 as a commentary on advertising and the resulting laxity with which almost all sites serving third-party ads approach their Content Security Policy.

Disclaimer: The visual artist is my wife ( http://montrose.is/sketching/about.html ) and the project has no attachment whatsoever to my dayjob.

gtrevorjay··on Tiny Linux distro that runs the entire OS as Docker containers
In the case of system services, it is probably acceptable (perhaps even ideal) to leave the image management up to deb, RPM, or ostree. systemd shouldn't do everything :) .
gtrevorjay··on Tiny Linux distro that runs the entire OS as Docker containers
This is clearly a trend, though it remains to see if it will garner enough acceptance to actually be "the future". systemd supports launching container-based services via nspawn and already namespaces "legacy" services very heavily. In fact, systemd et al were among the heaviest early drivers of cgroup technology for cleaner starting and stopping of groups of processes.
gtrevorjay··on Things to avoid in Docker containers
That should be fine. The only "lingering" effects would be possibly suid or SELinux labeling oddities, but those are easy to watch out for.

And I should have been clear that a remapped root that drops drops privileges and/or transitions into another user is still better than an unremapped root doing the same. It's just that the remapping is not a panacea.

gtrevorjay··on Things to avoid in Docker containers
Some of us just can't face going back to writing start-up scripts.
gtrevorjay··on Things to avoid in Docker containers
The issue is one of process/collaboration/composition. Even at the largest of distros, package maintainers usually act with pseudo independence. They can change, QA, and push their packages basically at will. Images are collections of those pushes. Even with automation the aggregate nature of images makes them qualitatively different and---especially organizationally---provides a process challenge.
gtrevorjay··on Things to avoid in Docker containers
Value for each delta will vary, but every extra step (the need to install a keylogger) or dependency requirement (that this be an interactive node and someone eventually logs in) will decrease your overall chance of penetration.

Almost no one has the resources to stand up to a targeted attack from even a mildly capable hacker. Therefore, the risk profile most administrators are working against are attacks of opportunity. In that race, as in the old joke about outrunning your friend instead of a lion, you need only be be some small amount more difficult to crack than the next potential victim.

gtrevorjay··on Things to avoid in Docker containers
Given the possibility of a container escape, it's far better for the escapee to find himself on the outside as a normal user. Just like with kernel exploits, most escapes rely on access to esoteric, complicated, or poorly understood devices or functions. Obviously, there are fewer of those in userspace. Imagine, for example, an escape that required arbitrary network control. That would be much harder to pull off (if not impossible) from userspace.

There have been and will continue to be parts of the kernel hard-coded to respect UID 0. Until these are all found and fixed (likely many years from now) using usernamespaces to remap root will not provide all the safety one might assume. It is super handy for other users though.

Full disclosure - I am both a hatter and a sec guy.

gtrevorjay··on Things to avoid in Docker containers
In no way should the advice be taken to be never `yum update`.

Perhaps the article could have been clearer, but the advice is more subtle than it first appears. It ties into point 4 ("Don't use a single layer image"). You need to `yum update` at the right time to make good use of layering and to be able to control updates separately from builds.

Imagine you build both Nginx and Apache containers off the same distro image. Rather than having `RUN yum -y update && yum -y clean all` as the first step (which is easy to mess up or forget), you can instead build an "update" layer as a named image with it's own Dockerfile consisting solely of the `yum update`. Now your two application Dockerfiles can simply `from base-update-date`. This means you control when you get updates explicitly orthogonal to the application build and lets you run the two apps off slightly different versions, if there is indeed an issue you need time to resolve regarding backwards compatibility. This also means you get the most out of the caching mechanisms in Docker.

Full disclosure - I am both a hatter and a sec guy. [edit, spelling, grammar]

gtrevorjay··on McCabe's Cyclomatic Complexity and Why We Don't Use It (2014)
Been there. Did not get the t-shirt, but I did perform a [large empirical study][1] on McCabe's. It turns out that once you account for hetero-scedasticity it gives almost no more information than lines of code. Whether that reflects more on McCabe's or the average programming style, I (still) leave as an exercise to the reader.

[1]: http://www.scirp.org/journal/PaperInformation.aspx?PaperID=7... "Cyclomatic Complexity and Lines of Code: Empirical Evidence of a Stable Linear Relationship"

← PreviousPage 2 of 2