wirelyre's recent activity

  1. Comment on An introduction to jq, the command-line JSON processor in ~comp

    wirelyre
    Link
    Great introduction, great structure. The "what I learned" sections condense the information really well. The final "what I learned" summary should be on the jq homepage. It took me a while to...

    Great introduction, great structure. The "what I learned" sections condense the information really well. The final "what I learned" summary should be on the jq homepage.

    It took me a while to figure this out: a jq filter applies to a sequence, or stream, of JSON values. At any point in a jq program there can be multiple values coming through, one after another. Not a single array, but multiple values. The filter processes them one by one.

    [0, 1]
    "a"
    
    > jq "." >
    
    [0,1]
    "a"
    

    So when you do something to an array (a single value), first you unpack it into a sequence of values:

    [0, 1, 2]
    
    > jq " .[] " >
    
    0
    1
    2
    

    … each of which goes into the next filter:

    [0, 1, 2]
    
    > jq " .[] + 1 " >
    
    1
    2
    3
    

    … which can finally be repackaged into an array.

    [0, 1, 2]
    
    > jq " [.[] + 1] " >
    
    [1,2,3]
    

    So + 1 is itself a filter that received three values in a row.

    And you might think that the select function works on arrays. Nope! It works on individual values in a stream. It emits zero or one values for each input.

    0
    1
    2
    
    > jq " select(. > 0) " >
    
    1
    2
    

    That's why select has to go inside map to process an array. You unpack the elements of an array, select some of them, then pack them back up.

    [0, 1, 2]
    > jq " map(select(. > 0)) " >
    [1,2]
    
    equivalent:
    jq " [.[] | select(. > 0)] "
    
    4 votes
  2. Comment on What's the best way to learn piano without an in-person teacher? in ~talk

    wirelyre
    Link Parent
    One thing that's easy to miss: teachers can help you contextualize your goals and successes. Sometimes you get hung up on challenges. You wrestle them what seems like forever until you overcome...

    One thing that's easy to miss: teachers can help you contextualize your goals and successes.

    Sometimes you get hung up on challenges. You wrestle them what seems like forever until you overcome them, but afterwards all you remember is how hard you worked. You can lose sight of what you accomplished — it had a purpose!

    Part of what a teacher is for is to give you feedback even when it seems like you're not making progress.

    You can get some of that without a teacher, though. You can celebrate small things by showing off 10 seconds to your friend, or by recording 10 seconds and listening back to it yourself.

    @tvl, the biggest advice I think I'd give is: let yourself be the four-year-old proudly showing off your painting; and also let yourself be the proud parent who puts it up on the refrigerator. The more little paintings you make, the faster they'll improve!

    6 votes
  3. Comment on ARM or x86? ISA doesn’t matter in ~comp

    wirelyre
    Link Parent
    I did a bit of high-performance programming recently, and it got me thinking: the predictions I had to make about how the compiler would transform the code are kind of like the predictions I had...

    I did a bit of high-performance programming recently, and it got me thinking: the predictions I had to make about how the compiler would transform the code are kind of like the predictions I had to make about how the CPU would run it.

    Also, when I started putting the computation on multiple cores, I kind of had to imagine the programming language and microarchitecture levels at the same time. 'Cause of cache magic.

    3 votes
  4. Comment on ARM or x86? ISA doesn’t matter in ~comp

    wirelyre
    Link Parent
    Huh, yeah, I guess Thumb alone is a better measure of the ISA capabilities at that level.

    Huh, yeah, I guess Thumb alone is a better measure of the ISA capabilities at that level.

  5. Comment on ARM or x86? ISA doesn’t matter in ~comp

    wirelyre
    Link Parent
    Right, so doesn't the fact that the same ISA works for both powerful and low-power chips mean that it's a nicer and more flexible design?

    Right, so doesn't the fact that the same ISA works for both powerful and low-power chips mean that it's a nicer and more flexible design?

  6. Comment on ARM or x86? ISA doesn’t matter in ~comp

    wirelyre
    Link Parent
    A cynical take: The article says that microarchitecture is the only meaningful difference between modern CPUs. The binary interface doesn't matter. So there's actually no reason to use anything...

    A cynical take: The article says that microarchitecture is the only meaningful difference between modern CPUs. The binary interface doesn't matter. So there's actually no reason to use anything except an open instruction set.

  7. Comment on ARM or x86? ISA doesn’t matter in ~comp

    wirelyre
    Link
    Are there x86 processors similar to the ARM Cortex-M ones? They use an instruction set that's a subset of larger ARM chips. Maybe that's a sign that the ARM ISA has a better base for today's...

    Are there x86 processors similar to the ARM Cortex-M ones?

    They use an instruction set that's a subset of larger ARM chips. Maybe that's a sign that the ARM ISA has a better base for today's requirements than a similarly small x86.

  8. Comment on What does analog have that digital doesn't? in ~talk

    wirelyre
    Link Parent
    I think it's probably related to older keyboard designs. Modern pianos are very resonant and sustain notes for a long time; on older instruments the effect is more subtle (aside from the...

    It's one of those things which probably wasn't intentional

    I think it's probably related to older keyboard designs. Modern pianos are very resonant and sustain notes for a long time; on older instruments the effect is more subtle (aside from the sustaining).

    Many pianos have a center "sostenuto" pedal, which sustains only the notes currently pressed.

    Do more modern electric pianos attempt to simulate these sympathetic vibrations?

    Their marketing materials say that they do! :-)

    Apparently some fancy ones try to simulate each string individually. I haven't played any of those in person, but I've heard virtual (MIDI) instruments that do something similar, and it's very convincing.

    The biggest difference for me playing electronic pianos is in the key touch. The force through different heights on a piano key is nonlinear, and it's quite distinctive. I know that recent electronic keyboards have more accurate mechanisms than just levers but I haven't tried one in a while.

    4 votes
  9. Comment on PAC-MAN 99 - Announcement trailer - Nintendo Switch in ~games

    wirelyre
    Link Parent
    Seems to be a theme with these retros royals. IIRC the details of Tetris 99's garbage and game speed mechanics were determined through frame-by-frame analysis.

    Seems to be a theme with these retros royals. IIRC the details of Tetris 99's garbage and game speed mechanics were determined through frame-by-frame analysis.

  10. Comment on What programming/technical projects have you been working on? in ~comp

    wirelyre
    Link Parent
    Very cool! Is the Roman alphabet already in the ROM or will you need to draw your own?

    Very cool! Is the Roman alphabet already in the ROM or will you need to draw your own?

    2 votes
  11. Comment on The revolution in classic Tetris - A younger generation is utilizing the internet to master the NES game in months, surpassing milestones that previously took decades in ~games

    wirelyre
    Link
    I wonder if retro games naturally produce healthier communities. There's a filter right away when the community grows from nothing, since it's mostly people coming back to a game for nostalgia...

    I wonder if retro games naturally produce healthier communities.

    There's a filter right away when the community grows from nothing, since it's mostly people coming back to a game for nostalgia rather than competition. The initial draw isn't that strong, so if the community isn't pleasant and constructive, people will just leave and it'll fizzle. The tone is kind of naturally selected from the start.

    5 votes
  12. Comment on Fortnightly Programming Q&A Thread in ~comp

    wirelyre
    Link
    Does anyone know of a good introduction / overview of LL parsers and table construction? I've got a library nearby, so I can go get a textbook if it has pictures, but I don't want to wade through...

    Does anyone know of a good introduction / overview of LL parsers and table construction?

    I've got a library nearby, so I can go get a textbook if it has pictures, but I don't want to wade through pages and pages of Greek letters and follow sets to get the intuition. I already did that with LR.

    2 votes
  13. Comment on Fortnightly Programming Q&A Thread in ~comp

    wirelyre
    Link Parent
    That's odd. Does the same thing happen if you slice f to be smaller? Is gz.read_to_string definitely std::io::Read::read_to_string? Does gz have more bytes available after the read_to_string call?...

    That's odd.

    Does the same thing happen if you slice f to be smaller?

    Is gz.read_to_string definitely std::io::Read::read_to_string?

    Does gz have more bytes available after the read_to_string call?

    Is the GzDecoder returning some io::ErrorKind early in its decoding?

    let mut gz = GzDecoder::new(&f[..1024]);
    
    Read::read_to_string(&mut gz, &mut s);
    
    2 votes
  14. Comment on The plus-size knitters who are solving an inclusivity problem in ~hobbies

    wirelyre
    Link Parent
    I'm disappointed by this comment thread. @eve, thank you for bringing your experience here. You clarified the relationship between knitters and designers for me, which I hadn't ever thought about....
    • Exemplary

    I'm disappointed by this comment thread.

    @eve, thank you for bringing your experience here. You clarified the relationship between knitters and designers for me, which I hadn't ever thought about. And it's good to know exactly how much the communities do or don't value size inclusivity. I certainly wouldn't know.

    Folks, we don't have to immediately problematize everything. This article is about a first step in fixing something that's obviously wrong. The whole point is that change is beginning. We get to celebrate that. We don't need to criticize baby steps.

    But now poor @eve is stuck defending the very concept of automatic tailoring?! Like she's automatically part of The System because she liked the article? This work is the cutting edge. You are witnessing the beginning of changes in the online knitting community. These same creators will be the ones figuring out the details brought up in this thread.

    I don't think anyone was writing in bad faith. But come on — talking about details like this automatically pits @eve against the ideas. Which is super uncomfortable because she just wanted to celebrate a small success. Also, she's not opposed to the ideas!

    Here's what I wanted to see from this thread: "Oh, cool, inclusivity meets yarn. Wait, I thought of some extra stuff they'll need to think about in the future." This way we all support the movement as trying to change the community, instead of somehow trying to fix the movement itself.

    Again, disappointing.

    4 votes
  15. Comment on What is a class in Python? in ~comp

    wirelyre
    Link Parent
    According to this article, even single-digit (single-word) CPython integers use 28 bytes (plus the reference pointer). In true single-kinded languages like Python, I think it's simpler to think of...

    According to this article, even single-digit (single-word) CPython integers use 28 bytes (plus the reference pointer).

    In true single-kinded languages like Python, I think it's simpler to think of integers etc. as "immutable" rather than "pass-by-value".

  16. Comment on Version 2 of Google’s Flutter toolkit adds support for desktop and web apps in ~comp

    wirelyre
    Link Parent
    Okay, that's comforting — I only remember trying out the canvas renderer. Maybe the sky hasn't fallen yet.

    Okay, that's comforting — I only remember trying out the canvas renderer.

    Maybe the sky hasn't fallen yet.

    1 vote
  17. Comment on Does anyone have, or has had, an addiction to music? in ~music

    wirelyre
    Link Parent
    Sometimes, and I swear this is real, I like to challenge my sensibilities. I put on headphones, turn on several different pieces of classical music at once, maybe with some nature noises too, and...

    Sometimes, and I swear this is real, I like to challenge my sensibilities. I put on headphones, turn on several different pieces of classical music at once, maybe with some nature noises too, and just sit back and try to experience the chaos as music. It has groove, it has direction, it has narrative. The parts interact sometimes.

    So like, this would be considered some real avant-garde BS if you did it in a performance. But it's not — it's just for me. :-)

    1 vote
  18. Comment on Does anyone have, or has had, an addiction to music? in ~music

    wirelyre
    Link
    I want to look at this differently. It sounds like you don't want to change anything about the music you listen to, right? That's not the problem. You want to establish a different relationship...

    I want to look at this differently.

    It sounds like you don't want to change anything about the music you listen to, right? That's not the problem.

    You want to establish a different relationship between you and music. You want to hear and treat it differently.

    You already know there's music you can like. I think that experience is still accessible to you, it's just challenging to find right now.

    I'd encourage you to really think about and change the way you consume music. Trying to reframe it as the experience of listening, rather than about the piece of music as an object that you can study.

    I wouldn't suggest you go cold turkey — actually I would judge that unhealthy. But maybe you could go on a diet. You might try setting a time in the evening for two songs, and only two. Cut out other music from your day, just that time in the evening. Sit differently from how you normally do, maybe put on some nice shoes, and try to let only the sound walk you along. Not thinking about lyrics, or history of the performers, or whatever: just the gentle pull of beats and harmony, however you experience those things.

    Man, I hope this comment is somehow useful to you. Sounds like you're in a tough spot.

    4 votes
  19. Comment on Version 2 of Google’s Flutter toolkit adds support for desktop and web apps in ~comp

    wirelyre
    Link
    Oh no. My experience has been exactly the opposite: Flutter's canvas rendering is very slow, and it feels totally unlike the native UI. I'd much rather have my browser dealing with text, rather...

    On the web platform, specifically, Sneath noted that the team deliberately started out with a very standard, DOM-centric approach. But while that worked fine, it also meant performance was held back by that, especially for more advanced features. Over the course of the last year or so, the team started working on what it calls Canvas Kit. This WebAssembly-based project takes the same Skia graphics engine that powers Android and Chrome itself and makes it available to web apps.

    Oh no. My experience has been exactly the opposite: Flutter's canvas rendering is very slow, and it feels totally unlike the native UI. I'd much rather have my browser dealing with text, rather than relying on every single web app to manually implement copy–paste.

    And this replaces all HTML elements with a single canvas. Not only is the code driving a web app impossible for users to read, now the entire display layer is hidden too!

    This stabilization seems terrible for the open web. :-(

    8 votes