HackerLangs
TopNewTrendsCommentsPastAskShowJobs

NobodyNada

no profile record

Submissions

Greg KH: Untrusted data in Linux – How Rust is going to save us [video]

youtube.com
2 points·by NobodyNada·30 дней назад·0 comments

Binary patching live audio software to fix a show-stopping bug

jonathankeller.net
2 points·by NobodyNada·7 месяцев назад·0 comments

comments

NobodyNada
·8 дней назад·discuss
> Beato doesn't do much hour-long unscripted talking to the camera. Those videos are typically only about 10 minutes long.

The videos are heavily edited with many cuts. So, I'd guess the production process is "have him talk for an hour, then edit it down to a 10 minute YouTube video".

> In any event, Rick Beato seems like a normal human being, albeit a somewhat goofy dad-rock oldie. 12Tone comes across as an aspie weirdo. I'd rather have more of the former.

And that's...kind of the point I'm making? The amount of effort put into the content of Beato's videos is quite low, with probably a couple hours at most of time put into research, coming up with talking points, and recording. But a lot of effort is spent on production, in order to make content that feels relatable and punchy and palatable to a mass market. It's junk food, and junk food sells well.
NobodyNada
·8 дней назад·discuss
> "The Real Reason Music is Getting Worse"

As a musician myself, and as someone who enjoys watching music and music theory content on YouTube, I can't stand watching Rick Beato because of stuff like this. There certainly are valid criticisms to be made against the music industry, but those videos are like 90% ridiculous cherry-picked comparisons and vague, superficial justifications. It's low-quality nostalgia-driven engagement bait that's optimizing for clicks and comments.

I really like this video by 12tone addressing Beato's schtick about modern music [0]. 12tone is an example of someone who I consider produces much higher quality content than Beato, and obviously puts a ton of time and effort into the videos (writing scripts, drawing the visuals, recording and editing, and making moderately-clickbaity titles and thumbnails). But I'd guess it's probably a one-person operation.

In comparison, Beato's channel strikes me as low-effort content (pick a topic and spend an hour talking unscripted in front of a camera) with a ton of money spent on production, editing, and algorithm hyper-optimization to maximize ROI. It's such a straightforward case of something that would not exist without YouTube's monetization system that it's rather ironic for the parent to use it as an example otherwise.

[0]: https://www.youtube.com/watch?v=tODG4Xt45bU
NobodyNada
·15 дней назад·discuss
The PPU (and variants of it) was used in quite a few arcade machines, in addition to the NES.

I don't know if there were any actual machines that used dual PPUs, but the functionality was likely intended for creating an arcade machine with dual-layer background graphics.
NobodyNada
·16 дней назад·discuss
It is also heavily associated with humans writing about things which bear load (in an xkcd #2347 sense) :)
NobodyNada
·16 дней назад·discuss
10 years ago, GitHub had a far better reputation and the Rust ecosystem was much smaller and less load-bearing, so "what if someone doesn't have a GitHub account" was a theoretical concern for most people. So the issue was a low-priority backlog item that everyone agreed would be nice-to-have but there weren't enough people willing to volunteer their time to it over more important and more impactful work.

Obviously, the situation has changed in recent years, so it's now considered a much higher priority by many people and some of them are actively working on it. But it's a lot of work to be done by volunteers, so it takes time.

That's the reality of open-source projects: things get done when they are important enough to motivate someone to either fund it or work on in their free time, not according to idyllic roadmaps and schedules.
NobodyNada
·17 дней назад·discuss
> Using "if" or "unless", whichever is more appropriate, is far more readable than "guard".

How is a different (and longer) keyword "far more readable"? That's just a matter of preference and familiarity. The reason for choosing a different keyword is that it's not quite equivalent to an unless as the {} block must exit the surrounding scope. You read it like an assert statement with a custom handler.

> Moreover, there are many languages where an assignment or an initialization can appear in any place where an expression can appear. Such general rules are always better than special rules like allowing new bindings in a "guard", but not in an "if".

You can introduce bindings in an if too. The special thing about guard is that you can introduce a binding which is valid for the remainder of the scope outside the {} block (where the condition is true) but not inside (where the condition is false).
NobodyNada
·17 дней назад·discuss
guard is an inverted if statement, with the additional requirement that the branch must exit the parent scope. It's useful sometimes for readability, particularly for avoiding the "pyramid of doom" when you have a lot of preconditions that need to be checked:

    if fooOK 
        if barOK {
            if bazOK {
                // do something
            }
        }
    }
can be written as:

    guard fooOK else { return }
    guard barOK else { return }
    guard bazOK else { return }
    // do something
Obviously there are other options (like writing a negated if), but sometimes guard is more readable. It's a style thing.

The more important use case for guard is that 'guard let' statements can pattern-match and introduce bindings that are valid for the rest of the scope:

    guard let foo = someOptional else { return }
    print(foo);
This is useful enough that Rust copied it in the form of 'let ... else {}' statements (but did not bring over boolean guard statements).
NobodyNada
·19 дней назад·discuss
Most people without absolute pitch have some level of "pitch memory", but it's not comprehensive or reliable. For instance, if you ask people to sing a pop song, they're significantly more likely than chance to sing it in the original key.

I know the Super Mario Bros. theme starts on an E, so I can identify an unknown pitch by recalling that theme and comparing using relative pitch. But that's quite a slow and unintuitive process, and it's easy to make a mistake. People with absolute pitch just hear the pitch without having to "recall" a reference note to compare to like that.
NobodyNada
·19 дней назад·discuss
I'm a musician who doesn't have absolute pitch, but does have very strong relative pitch. My understanding is that perfect pitch is neat party trick, but actually a hindrance instead of a help in most musical circumstances. Relative pitch, on the other hand, is incredibly useful (and fortunately you can train and develop it later in life).

Because most people don't have perfect pitch, (Western) music is built on the relationships between pitches rather than the absolute pitches. So with absolute pitch, you can play something by ear; with relative pitch, you can play something by ear in any key.

Learning to think of the notes you're playing relatively instead of absolutely is already a difficult leap for most musicians, and my understanding (though I don't have absolute pitch so I can't compare from experience) is that absolute pitch makes this skill significantly harder to acquire, since you have to retrain your ear in addition to your hands.

If I were offered a choice to trade my sense of relative pitch for absolute pitch, I most certainly would not take it. I know well the feeling of incongruity when my muscle memory is stuck in the wrong key, and absolute pitch would mean I'm stuck there all the time instead of being just able to shake my head, focus on the new key, and clear my mind of the old.
NobodyNada
·23 дня назад·discuss
The engineer who wants the build to be reproducible and the engineer who wants to have the build time in the compiled binary may not be the same person.
NobodyNada
·24 дня назад·discuss
The reason for this is to ensure stack overflows are detected. The OS places a guard page above the top of the stack, which will cause a segfault if accessed. That way stack overflows are guaranteed to crash rather than stomping on valid memory that belongs to something else. However, if a stack frame is larger than a page (say, because it includes a large buffer), then it is possible for the program to "jump over" the guard page and access memory beyond.

In order to protect against this, the compiler inserts some dummy reads or writes as needed to ensure every page is touched in order from bottom to top. This ensures the guard page is hit before the application has a chance to write to memory beyond it.

Here's an example: https://godbolt.org/z/oTbzTczM6
NobodyNada
·в прошлом месяце·discuss
The headphones are from AIAIAI: https://aiaiai.audio/headphones/tma-2-studio-wireless

Loopback looks nice, but I prefer to keep the routing entirely within my DAW (or my interface where possible) to keep latency to a minimum, particularly since I'm already using wireless headphones that add 10ms latency.

Another mitigation I now have is to use an aggregate device that has BlackHole on the first two channels rather than the main outputs. That way, if I accidentally start playing audio, it gets harmlessly sent to the void; and it also means I can easily capture and forward it in my DAW if I actually want to play PC audio (for example, listening to a recording during a rehearsal).
NobodyNada
·в прошлом месяце·discuss
I needed something like this a few months ago. I use my MacBook to run my (musical) keyboard rig for live performances, and use low-latency wireless headphones for monitoring. The headphones have a transmitter dongle that plugs into my laptop, and the dongle sends a "play/pause" command if I press a button on my headphones...causing Music to launch and begin playing audio out of my default output device. It doesn't even care whether my headphone transmitter is selected as the default output device; in a complex multi-device setup, I can press a button on my headphones and it will happily play audio out of some other device.

This is problematic because if I were to accidentally hit the button in the middle of a set, and it decides to default to whatever interface is connected to the P.A. system, then now I've just started blasting some random song at full volume to everyone in the venue.

(It's not an immediate problem for me anymore because I've reworked my hardware setup such that the dongle connects through my audio interface rather than directly to my laptop, meaning my laptop no longer receives "play/pause" commands from it. There were additional reasons for this rework, but preventing this misbehavior was absolutely part of the consideration.)

It's absurd that a premium device marketed to creative professionals has unconfigurable behavior like this which is so unacceptable for a live show.
NobodyNada
·в прошлом месяце·discuss
(Not the parent, but I'm faceblind as well)

The interaction described goes like this:

"Hi there, I'm ABC, nice to meet you, what's your name"

"...Huh? I'm XYZ. We've met before."

"Oh right...sorry, I promise I remember you! We knew each other from there, and we've worked on this and that together, and etc. etc. etc. I'm just terrible with faces, I'm so sorry!"

It's not "you know things about them without recognizing them"; it's "you don't recognize them at first, it gets awkward, and so you recite facts about them prove that you didn't forget who they were"
NobodyNada
·в прошлом месяце·discuss
I recently learned that I have some level of face-blindness (I took the CFMT online and scored 43).

It's something I've had my whole life but only recently realized wasn't "normal". It's not like I can't recognize people at all, but rather that faces aren't very distinctive to me compared to other identifying characteristics (such as hair color/style/length, clothing, skin tone, height, voice, gait, mannerisms, etc.) It takes me a while to learn to distinguish everyone in a group of people (especially people who are similar along all of those attributes), but once I know someone well I will usually recognize them without problems.

The only real issues are when someone changes their appearance (e.g. getting glasses or shaving a beard), or when I run into someone in an unexpected context (like randomly meeting someone I know on the street). A few months ago I ran into my cousin at an event in another city, and didn't recognize her until after 20 or 30 seconds of conversation.

It's also not usually too hard to mask. I realized I have a subconscious habit of never greeting people by name because I'm always afraid of getting it wrong, and it's easy enough to bluff through "oh hi, how are you, good to see you, what have you been up to" pleasantries until I figure out who I'm talking to. The most awkward situations are when I'm unsure whether or not I know someone and have to risk either mistaking a stranger for a friend, or accidentally ignoring/reintroducing myself to an acquaintance. Also, starting a new TV show sucks.

Now that I know it's an actual condition with a name, I'm not sure yet whether it makes things better or worse if I try to explain it to people to excuse my mistakes.

If any other face blind people have useful tips or experiences, I'm all ears :)
NobodyNada
·2 месяца назад·discuss
They gave a detailed talk last DEF CON: https://www.youtube.com/watch?v=KhWtkZmOPn4
NobodyNada
·2 месяца назад·discuss
> My only gripe is that a lot of it is feeling a bit kick-starter-y

IMO the term "project goals" is quite misleading for what this actually is. A project goal is a system for one person (or a small group of people) to express that they'd like to work on something and ask for Rust project volunteers to commit ongoing time and effort to supporting them through code review, answering questions, etc. It doesn't mean that the Rust project itself has set the goal, or even necessarily endorsed it.

So it's not quite right to treat it as a formal roadmap for Rust, just a "there are some contributors interested in working on these areas".
NobodyNada
·2 месяца назад·discuss
> if optional were a general sum type you wouldn't be able to make these optimizations easily without extra information

Rust has these optimizations (called "niche optimizations") for all sum types. If a type has any unused or invalid bit patterns, then those can be used for enum discriminants, e.g.:

- References cannot be null, so the zero value is a niche

- References must be aligned properly for the target type, so a reference to a type with alignment 4 has a niche in the bottom 2 bits

- bool only uses two values of the 256 in a byte, so the other 254 form a niche

There's limitations though, in that you still must be able to create and pass around pointers to values contained within enum, and so the representation of a type cannot change just because it's placed within an enum. So, for example, the following enum is one byte in size:

    enum Foo {
        A(bool),
        B
    }
Variant A uses the valid bool values 0 and 1, whereas variant B uses some other bit pattern (maybe 2).

But this enum must be two bytes in size:

    enum Foo {
        A(bool),
        B(bool)
    }
 
...because bool always has bit patterns 0 and 1, so it's not possible for an invalid value for A's fields to hold a valid value for B's fields.

You also can't stuff niches in padding bytes between struct fields, because code that operates on the struct is allowed to clobber the padding.
NobodyNada
·2 месяца назад·discuss
There are lots of unstable things in Rust that have been unstable for many years, but this isn't one of them. openat() was added in September, and the next PR in the series implementing unlinkat() and removeat() received a code review three weeks ago and is currently waiting on the author for minor revisions.

> As long as it's unstable it's totally fair to say Rust's stdlib does not expose them. You might as well say it's fixed because someone posted a patch on a mailing list somewhere

Agreed. My comment was intended to be read as "it's planned and being worked on", not "it's available".
NobodyNada
·2 месяца назад·discuss
openat() is there, but it's unstable (because the dirfd-related syscalls are not all fully implemented and tested across all platforms Rust supports yet): https://doc.rust-lang.org/std/fs/struct.Dir.html#method.open...