1. 3

    Given an [i32; 2] point on a boxy spiral starting at [0, 0], I wanted to be able to: wind it to the next point on the spiral, unwind it to the preceding point on the spiral, get its index, and the position from an index. By printing out diagrams from under cargo watch, I was able to get instant feedback.

    1. 2

      We can agree, surely, on the utility of minimizing the complexity of the kernel. The primal syscalls are basically optimized to be very easy for userspace, at the cost of imposing complexity in the kernel. Totally unnecessary, libraries can handle this.

      I’ve noticed that the Linux kernel seems to do a lot of busywork with piping around streams of bytes. It might be better if syscalls worked exclusively on memory pages. So, instead of using an argument of &[u8], you’d use &[(Range<Cow<Page>>, Range<usize>)]. This makes 0-copy the default.

      There’s a gazillion IPC mechanisms in Linux. One is all you need if your IPC syscall passes in a state machine parameter. The other ends would have to pass in the same state machine in order to connect. There would probably be a library of very standard machines, like pipe, which you’d pass in as "/lib/ipc/pipe". An important function of the specialized state machines would be to verify the well-formedness of all messages, so the userspace program can trust that it’s safe to cast whatever it just read.

      1. 1

        The typical tokenizer/AST pipeline throws away the visual grouping information contained in whitespace, much to nobody’s benefit. I hope for the exploration of fixed-format languages. Does it treat doubled spaces as an error? That’s absolutely the sort of typo I make.

        1. 1

          The smart TVs could still hardcode IP addresses. You could pipe your internet through a router that scrambles IP address space, and provides a DNS server that gives out encrypted addresses. Any application broken by this is not your friend – excepting the ones that actually are your friend, like p2p and Firefox w/ DoH, but being your friend you could configure them to use a proxy. As a further measure, (eg, against a malicious TV scanning the entire ip4 address space to find its control server) the firewall can block any address that wasn’t first requested via DNS.

          1. 4

            Programmable shaders all over again.

            1. 1

              You think it’ll be that revolutionary? Damn, I better start learning how to use io_uring then.

            1. 5

              On my wishlist: A way to block all the bloody “Subscribe to my spiffy mailinglist”-popups that has infested the web.

              1. 2

                Big same. I was working on a browser plugin to turn position:fixed/etc elements into display:none, but it ran into a wall of

                1. literally the first wild website I tested it on hit an infinite loop
                2. javascript permission errors when trying to introspect style sheets

                I suspect dealing with it robustly would require hacking up the browser renderer itself.

                1. 2

                  The No, Thanks extension gets rid of some of them. Enough that I’m willing to pay its subscription fee because those stupid things make my blood boil, but it still misses a bunch.

                  1. 1

                    Thanks, I’ll give it a spin.

                  2. 1

                    The unfortunate reality is that they work. I remember reading, I think, Andrew Chen (A16Z) who mentioned that he feels sorry for these popups but he has to keep them on his blog since they work.

                    1. 3

                      Andrew Chen doesn’t have to have these annoying popups on his blog, he could perfectly well choose to have a button or a link. Truth is that he chose the annoying popups because he values the number of subscriptions more than the wellbeing of his audience.

                      1. 1

                        Do you have the source / data for the that? I’m not even sure how you’d measure how well they work. I assume you’d have to do some A/B testing, but while you can measure the number of people who sign up for your newsletter, and possibly even track whether the emails cause them to come back to your blog, you can’t measure the people who are unimpressed or get annoyed and don’t come back or recommend your blog to others.

                    1. 12

                      One of the smaller pain points on the Mac is that there’s no built in paint tool. I want to use it just often enough that I miss it, but not enough that I want to learn what’s out there and/or pay money for a sophisticated tool.

                      I realize there’s some subjectivity to this, but I think a simple paint tool ought to be part of what’s comes included with every “normal” machine.

                      1. 5

                        I’m using Acorn for MacOS, after seeing a recommendation or two. It’s light, fast and easy (for me) to understand. It was also cheap. I don’t do much - just cropping, copying, pasting, drawing an arrow, etc.

                        1. 3

                          I also endorse Acorn, it’s a great tool. One under appreciated aspect of it- you can open an image, modify it, command + s and it saves it over the original file. No “export as” or “save for web” nonsense.

                          1. 1

                            Boxy SVG is really nice and free.

                            1. 1

                              This one? https://boxy-svg.com/

                              Looks great, but not free to use (15-day free trial is available though). Restricted version is available for free on Linux, but only snap (which I don’t want to use)

                              1. 2

                                That’s the one. I guess I’ve just been so used to using it that I completely forgot it wasn’t free.

                                I’m using the Mac version. I guess since I got it from the MAS and didn’t have to go through the license activation rigamarole, it was easy to forget.

                                Sorry about that.

                                1. 1

                                  sure no problem, the suggestion is still a good one :)

                                  1. 2

                                    No worries. I’ll definitely be more careful about double checking things from a while back or qualifying them.

                            2. 1

                              I second Acorn recommendation, although it’s not really a Paint clone. It’s more like a “subset of Photoshop that a Paint user would recognize”.

                            3. 4

                              there’s definitely money in it! after trying a bunch of paint alternatives I settled on (not even joking ) renting a $5/mo Windows compute server from Azure for the sole purpose of using MS Paint…

                              1. 1

                                You can run MS Paint using Wine. Super easy to install with WineBottler too.

                              2. 3

                                If your goal is to draw over a screenshot or an existing picture, you can use Preview for this. It’s not exactly a “dumb” image editor like MS Paint but it has a couple of additional features like recognizing the shapes you draw by hand. It’s very convenient for annotating screenshots if you use “File > New from Clipboard”. Otherwise you can use Pages or Keynote as a vector graphics editor.

                                1. 2

                                  I’ve used Preview for existing screenshots, but I’d also like to be able to start from scratch and scribble.

                                  I didn’t realize that Pages and Keynote were free until just now, but they’re not built-in, so they still fail one test. I’d also suggest that using a document editor to do scribbling/painting is a little surprising and not the thing that comes to mind so easily.

                                  1. 1

                                    Mmm, I don’t think they have a mac flavor, but the best thing for screenshots is flameshot.

                                2. 2

                                  I’m with you on this. Both macOS and Linux need a good Paint clone. The other way I battled for hours with Inkscape to do a basic image manipulation with cutting and pasting, something that would take seconds on Paint. Not because Inkscape is a bad application, but rather because I haven’t learned it and don’t have the need to do it for my daily tasks.

                                  1. 4
                                    1. 2

                                      kolourpaint.

                                      1. 1

                                        I wouldn’t use inkscape, it’s more of a vector thing, I use GIMP for images. It doesn’t matter though because I think your point still stands, the learning curve is steep.

                                        The closest I have come to something simpler out of the box is Krita.

                                      2. 1

                                        I had the same complaint, and apparently I installed this: https://paintbrush.sourceforge.io/. Although I can’t remember when I last used it.

                                      1. 3

                                        Patching ls to write annotated output, and trying ensure there are no observable behavioral differences.

                                        1. 1

                                          Maybe you can look at https://github.com/ogham/exa instead. I use it as replacement of ls.

                                        1. 4
                                          1. The sender’s server sends the email, and the receiver stores it.
                                          2. The receiver responds with 1MB of pseudo-random noise generated from a secret message-specific seed.
                                          3. Every hour, the receiver says “append this additional MB, and return the hash”.
                                          4. Once enough challenges have been passed, the message is moved to the inbox (or spambox!).

                                          The two servers negotiate ahead of time what the proof-of-care profile will be. The recipient can decide arbitrarily what the profiles are, and multiple profiles can be made available. A trusted sender can be accepted with a low cost. If the email’s author set some priority option, the sending server might choose the “1 GB every minute 10 times” profile instead of the more economical “20 MB every hour 24 times”.

                                          Either server might have downtime. This is fine. The sending server polls the recipient.

                                          To reduce bandwidth costs for the recipient, the proof-of-care profiles could include delegation to a third-party — a bit like a CDN, a trusted 3rd party might be in the sender’s data center. Heck, the sender could delegate also, and perhaps they both choose the same 3rd party… (The sender must not get a discount from this.) Note that the only metadata the third parties can glean is “this server sent a message to that server”. Batching might reduce metadata leakage further.

                                          This scheme can induct itself onto the existing federation. If the sender server doesn’t spaken la francaise, a bounce message can say “write a complaint to your server admin, and keep this webpage open in your browser for an hour”.

                                          This protocol could be useful outside of email, so it should be independent of SMTP.

                                          1. 4
                                            mpv --wid=0
                                            

                                            Will achieve the same thing.

                                            Playing on a loop is also possible with:

                                            -loop
                                            
                                            1. 4

                                              Oh my.

                                              xeyes & mpv --wid=$(xwininfo | grep "Window id" | sed 's/ /\t/g' | cut -f4) ./Hayao\ Miyazaki\'s\ thoughts\ on\ an\ artificial\ intelligence-ngZ0K3lWKRc.mp4
                                              

                                              Wayland was a mistake.

                                              1. 2

                                                wayland

                                                Indeed. I wish nitpicker (from tud:os then genode) was adopted instead. But NIH syndrome is a thing.

                                            1. 6

                                              This reminds me of an infinite-distance teleportation exploit that we found in Minecraft since, for a few updates, Mojang were only checking for NaN values on the X and Y axes, checking the X axis twice.

                                              You could teleport from [orig_x, orig_y, orig_z] to [orig_x, orig_y, NaN] and then to [desired_x, desired_y, desired_z] and since the Euclidean distance between any two consecutive position vectors would be NaN, dist >= kick_threshold always turned out to be false.

                                              1. 1

                                                Which versions were those? Minecraft’s been rather uniquely plagued by this issue, tho I suppose it’s gotten better in more recent versions.

                                                Due to the difficulty of trusting a JVM without value types to have reasonable performance when allocating vectors at a Mississippian rate, vectors were nearly always passed around decomposed. Doing crap like world.getBlock(x + dx, y + dy, z + dz) gets tiresome very quickly, and expressive power is not a noted property of Java. You might make wrapper types, but then find that you run into an issue akin to function coloring, or C++ viral constness. You’re still going to have to compose or decompose the vectors at some point, and there’s still the performance concerns. A script called xyz, which turns x + max, into x + max, y + max, z + max, allowed me skip past the traditional copy-paste bugs.

                                              1. 4

                                                Maybe some masking tape would solve the trackpad problems.

                                                1. 2

                                                  Or fingerless gloves? Heh.

                                                1. 1

                                                  Thank you for writing about this, I’ve been wondering about its practicality.

                                                  If you know that your users are using gmail on desktop, you could send your authentication email with a random nonce and forward your users to https://mail.google.com/mail/u/0/#search/in%3Aanywhere+from%3Amy_website+random_nonce . So long as Google doesn’t straight up bitbucket your email, ending up in spam would be no problem. But this is still fairly fragile and hard-coded; some new mailfrom: URI sounds ideal.

                                                  1. 9

                                                    Lots and lotsa gaming! And coding! The second Winter!


                                                    Be positive. :)

                                                    I invite everyone to join our UT99/UT2004 discord https://discord.gg/QjvEvb and to join a game that’s still loved by many. If you are also part of a smaller community, please share your hangouts with us. It’s important there are people to talk to and have fun with in these times.

                                                    Edit: Other fun relatable communities are:

                                                    • ##programming on irc.freenode.net
                                                    • #lobsters on irc.freenode.net

                                                    Want a fun challenge? Try beating my Devil Daggers score of 421 seconds.

                                                    1. 1

                                                      Omg UT99 … loved that game! Too bad it still doesn’t run on Linux properly. :-(

                                                      1. 1

                                                        It you refer to the simultaneous keypress issue, export XMODIFIERS="@im=null" will fix it.

                                                      2. 1

                                                        Try beating my Devil Daggers score of 421 seconds.

                                                        657 ;)

                                                        1. 1

                                                          Hehe, that is ultra impressive. My goal is to beat the 500 mark. I will never beat you X)

                                                          1. 1

                                                            I was stuck at about 496 for a while, but rather suddenly got that score. I did lots of practice directly on the gigapedes, the leviathan, and the orb. Which requires hacking the game, or using spawnsets (easier to setup but have much slower iteration time).

                                                            As for the rest of you, I heartily recommend Devil Daggers. It’s wildly fun. See if you can kill that big ol’ spider that spawns in at 40 seconds. (You will probably need to carefully watch your replays to figure out what is going on.)

                                                            1. 1

                                                              I did lots of practice directly on the gigapedes, the leviathan, and the orb. Which requires hacking the game, or using spawnsets (easier to setup but have much slower iteration time).

                                                              Yep, the past 3 months I’ve been doing that too X) I can get there no problem in-game… those gigapedes are just a crazy wall of difficulty. I’ve been able to kill 2/3 quite frequently but not good enough.

                                                        2. 1

                                                          Wait, wat? I used to be a big UT99 player. I may join you there!

                                                          1. 2

                                                            I’m more of a UT2004 regular but UT99 is popular amongst the older ones. X)

                                                          2. 1

                                                            That’s funny, I was just thinking about unreal tournament :) - Do people still play the monster hunter mode?

                                                            1. 3

                                                              1 year ago I saw someone playing RPG yes. There are probably still guys.

                                                              If anyone is interested we could start a lobste.rs server(s). I don’t mind spinning up a droplet. Hopefully others can contribute some compute too.

                                                          1. 1

                                                            This may be the best introduction to compiling simply due to how well it avoids all complexity – tho it could certainly use an update. Python’s the new Pascal?

                                                            1. 3

                                                              Apache doesn’t, with HTTP, say “userdirs are enabled, so the origin of this resource should be /~username rather than /”, and Firefox doesn’t say “the URL path starts with /~, so set an origin just to be safe.” Ah, oh well.

                                                              Isn’t this fundamentally an in-band signalling problem?

                                                              1. 4

                                                                Apache doesn’t, with HTTP, say “userdirs are enabled, so the origin of this resource should be /username rather than /”, and Firefox doesn’t say “the URL path starts with /, so set an origin just to be safe.” Ah, oh well.

                                                                Isn’t this fundamentally an in-band signalling problem?

                                                                No.

                                                                Apache doesn’t say the origin is anything; it is Firefox which makes the decision what the origin is by looking at the URL, a few infrequently-updated databases shipped with Firefox, and a complex set of rules for applying the two together.

                                                                1. 2

                                                                  There is no such feature in the web stack. That’s not how it’s supposed to work. The concept of the origin is universally defined, and can’t be changed on per-response basis.

                                                                  At best the server could lock things down with CSP headers, but even CSP itself thinks in origins.

                                                                  1. 1

                                                                    Well yes, because the concept of the Origin is fundamentally broken, and was from the beginning. Userdirs existed before JS, so JS has to be changed, not userdirs.

                                                                1. 6

                                                                  The animated cursor looks like a gimmick, but I have a feeling that it would be really useful.

                                                                  1. 6

                                                                    It felt like a silly addition to me, and then I realized how often I do jkjkjkjkjk to see where my cursor currently is after searches and jumps. I’m looking forward to trying this.

                                                                    1. 5

                                                                      It definitely pleases me. Whether it reduces the number of times I lose track of the cursor is hard to tell ¯\_(ツ)_/¯ my impression is yes, but your mileage may vary

                                                                      1. 3

                                                                        I’ve been using this to help keep track of the cursor:

                                                                        set relativenumber
                                                                        set number
                                                                        highlight LineNr ctermfg=brown
                                                                        highlight CursorLineNr ctermfg=yellow
                                                                        
                                                                        1. 2

                                                                          Neat! My vimrc has something in a similar-ish vein with the following line:

                                                                          :nnoremap <Leader>s :set cursorline! cursorcolumn!<CR>
                                                                          

                                                                          Leader s will highlight the current row and current column, creating a “crosshair” over your cursor. I use it all the time when pairing to show someone where my cursor is and as way to “point” at code.

                                                                          Plus it’s a toggle. So when I lose my cursor I can just quickly toggle it on and then off with the same binding. Easy for it to become muscle memory.

                                                                      1. 1

                                                                        Maybe the stories of new users could include a tally of the domains they’ve linked to.

                                                                        1. 1

                                                                          That might just encourage posting from multiple sites you’ve been paid to post from ;)

                                                                        1. 2

                                                                          Extreme limits on flow control. In Rust, a sufficiently perverse foo() can allocate memory, recurse, spawn a thread, close stderr, panic, never return, and shoot your dog. The compiler must give consideration to these possibilities. Not so in GLSL.

                                                                          1. 1

                                                                            Playing around with this declarative ui thing using v9 ideas/the One Name Rule:

                                                                            let mut window = Window::new("Hi");
                                                                            
                                                                            // Window holds the app's state.
                                                                            // You want as many discrete objects as possible.
                                                                            struct Count {
                                                                                n: i32,
                                                                            }
                                                                            window.register(Count { n: 0 });
                                                                            
                                                                            let button = window.add::<Button>();
                                                                            let label: Id<Label> = window.add::<Label>();
                                                                            // Same as (PhantomData<W>, u64)
                                                                            
                                                                            window.on(event::Press(button), |count: &mut Count| {
                                                                                count.n += 1
                                                                                // The mutable reference means that the Count object may have changed.
                                                                                // So any dependencies will need to be updated.
                                                                            });
                                                                            window.set0(label, |widget: &mut Label, count: &Count| {
                                                                                // This closure uses &Count, so we infer `label` to be a dependency.
                                                                                widget.text = format!("Count: {}", count.n);
                                                                            });
                                                                            window.set1(label, |count: &Count| -> String {
                                                                                // We can do this better.
                                                                                // &mut Label is very broad, so instead of modifying the entire object,
                                                                                // we could modify just one particular sub-object.
                                                                                // `Label` implements a trait that allows it to handle `String` objects being thrown at it.
                                                                                format!("Count: {}", count.n)
                                                                            });
                                                                            window.set2(label, |text: &mut String, count: &Count| {
                                                                                // We could modify the sub-object by reference; not allocating is nice.
                                                                                text.clear();
                                                                                write!(text, "Count: {}", count.n);
                                                                            });
                                                                            // It's also acceptable to have a 0-argument closure.
                                                                            window.set3(button, || String::from("Increment"));
                                                                            // It doesn't need to be a closure, and it doesn't need to be a String.
                                                                            // (These sorts of niceties would be specially provided by Widgets.)
                                                                            window.set4(button, "Increment");
                                                                            // (These set functions could all be overloaded to just `set`, but maybe not both set0 and set2.)
                                                                            
                                                                            window.run();
                                                                            
                                                                            1. 1

                                                                              Interesting ideas, I want to look into this more closely. How would you describe the advantages and disadvantages of this approach as opposed to what druid does?

                                                                              1. 1

                                                                                IIUC druid must diff everything. This could be pretty bad for something like MS Word, where you’ve got a lot of state on screen, and the user is typing events at a rapid pace. With this other approach, the system can see more specifically what you’re changing. It could still run a diff, on a much smaller state, or just not bother & update always. With this setup the flow of control becomes less obvious, and there’s the possibility of an endless loop if diffing isn’t done.

                                                                                1. 2

                                                                                  It diffs from the top of the tree, but absolutely doesn’t need to touch all state while diffing. This is what the lenses and immutable data structures are about - they should be able to deliver a fine grained delta (at modest cost, usually O(log n)) when not much has changed. But we don’t know yet just how well this will work.

                                                                                  In any case, I think it’s possible to build a UI more along the lines you suggest, and I would like to understand better how that would work.