1. 7

    Is the purpose of the ServiceWorker only to invalidate the cache of the home page? I don’t understand why that is needed.

    1. 2

      That’s where I was at; I could not figure out the why of … well, any of it. But that part in particular perplexed me.

    1. 4

      Learning to write a Slack bot.

      1. 5

        Also neat the clozure-cl is entirely open source now. You can download it via tarball or even Homebrew if you’re on OSX. It’s an extra step to build the GUI but pretty neat to get what used to cost metric tons of money for free.

        1. 3

          And on modern hardware, the GUI builds in under a minute!

          1. 3

            Yeah, I thought the same thing when I tried it out. Those of us who’ve been around a while remember waiting for seeming YEARS while Franz or similar CL implementations dumped images to disk :)

        1. 1

          How about hg amend --demux, as a function that applies a single set of changes to many draft commits could be analogous to a demultiplexer.

          1. 1

            Appears to be down at the moment.

            1. 1

              Use the cache, Luke.

              Though, unfortunately, it has images. And, now, it’s back up.

            1. 1

              An Introduction to Database Systems by C. J. Date

              1. 4

                Hey $COLLEAGUE, is there any function that takes this list and returns a list like this?

                I don’t think I’ve ever personally heard or asked anything like this question before.

                I’m not saying it’s not a valid question necessarily, but typically in software engineering, I find that the question is normally going from a high-level description of a process (e.g. process a shopping cart for checkout) and asking “how do I break this down into more concrete instructions that a machine can do?” (e.g. take the sum of each item price, compute the sales tax as X percentage of that sum, etc.) At that point, maybe it’s useful to have the computer figure out given an example that it should use addition for the subtotal? Though I think a human is likely well-enough equipped to do so her/himself.

                Can anyone give a better example than the ones provided in this write-up?

                1. 3

                  Since this is integrated in emacs, how about “Hey editor, make me a keyboard macro that has the same effect as these changes I just made”?

                  1. 3

                    As a way of matching inputs and outputs with possible functions, this is a neat way to learn elisp experimentally. Calling it “Example Driven Development” is really overselling it IMHO.

                    1. 1

                      “I have a List of Options but want an Option of a List” is a common problem when doing functional programming. I get asked for these functions very often.

                    1. 10

                      All aboard the pre Blackhat hype train! Every year, the same story. Tantalizing tales of dire destruction! Just enough detail to poop your pants, but not so much information that you can do anything more reasonable.

                      1. 2

                        New attack that cripples HTTPS crypto works on Macs, Windows, and Linux

                        At least it doesn’t (yet) have a catchy name, website and logo.

                        1. 2

                          Without branding, who will we venerate?

                      1. 3

                        Thank you! This is a much better resource than my current go-to for inspiration.

                        1. 10

                          The text editor Sam by Rob Pike. Not as a day-to-day editor, but to replace of one-off Awk and Perl scripts.

                          I find the combination of command language, visible history and structural regular expression support is very useful in parsing large datasets and log files in an interactive way.

                          1. 1

                            Neat! Is there a way to invoke this command in X any time a selection is made?

                            1. 1

                              It definitely made learning Objective-C much easier, with a similar syntax and message-passing semantics.

                              1. 3

                                This is fascinating! Is there any place the original tapes can be found online?

                                1. 2

                                  I don’t know if they are (I’ve had a look but not managed to find them), but there is a recording that summarises the project available from TUHS (TUHS is a great resource for this kind of stuff, BTW).

                                1. 11

                                  According to this Wired interview with Andy Hertzfeld from 2004, he made a bunch of money from an IPO in the 90s and is now retired. He just sounds like a private person.

                                  1. 6

                                    I really don’t get this. Why shouldn’t use such a thing as Ansible? This software is designed to easy provision new servers. From your base install to very complex installations, Ansible makes your life more easier, then self hacked scripts.

                                    Also the shear ugly-ness of of a curl | sh action. Uggg.

                                    1. 3

                                      Why shouldn’t use such a thing as Ansible

                                      Ditto. I get that these are throwaway machines for testing purposes but as others have said use a configuration management tool. Oh, and why on earth would you install Ruby like that on an Ubuntu system? It’s frustrating to read articles by “professionals” that promote far-from-ideal practises (FWIW, 65 people have starred the Github repo as of now).

                                      1. 1

                                        In his defense, it is being served over HTTPS, and has a verifiable SHA. But, if github was compromised, it’d be easy to fake the SHA in the URL. But, if github is compromised, you’re pretty likely f’d anyway, if you rely on them for anything meaningful.

                                        1. 1

                                          It doesn’t look like the hash of the file is being checked before executing the script.

                                          1. 1

                                            No. It is not, you are correct. The opportunity is there to do so, of course, which, based on his other articles, he might be doing and hasn’t documented. Maybe not, though!

                                      1. 5

                                        For anyone else wanting to look at the source: the download link on simon-listens.org leads to a SourceForge download of a text file that says this project is now at simon.kde.org. The latest update on simon-listens.org is dated 2012 where the latest blog on the KDE site is 2014. I’m assuming it’s a part of the KDE project now?

                                        1. 1

                                          IMHO, the term “Technical Debt” has an immediacy and urgency that “Shovelling forward” doesn’t have.

                                          1. 13

                                            I think the author is putting too much blame on the original developer and making too much out of their 26 years of experience. Everybody makes typos, and I’ve seen a lot of abbreviated variable names from people with a lot less than 26 years of experience.

                                            And judging by the variable names and the function name, it wouldn’t surprise me if the names were originally from an equation in a book, using subscripts (T<sub>tpfe</sub> and T<sub>tpre</sub>), so using those names may have been more clear at the time.

                                            It was a good catch, but no need to throw the original dev under the bus for making mistake.

                                            1. 5

                                              Every bug is a human mistake. It follows that every bug is preventable. Hence the popularity of “if you follow this magic rule, you’ll never have bugs like this”. Follow all the rules and your software will be perfect!

                                              1. 3

                                                no need to throw the original dev under the bus for making mistake.

                                                Especially when the identifiers were limited to eight characters!

                                                1. 2

                                                  And judging by the variable names and the function name, it wouldn’t surprise me if the names were originally from an equation in a book, using subscripts (T<sub>tpfe</sub> and T<sub>tpre</sub>), so using those names may have been more clear at the time.

                                                  I think that’s generally a pretty bad idea. I’ve inherited code from a control theorist where they made every variable in their 200-300 line function a maximum of 3 characters. That made it pretty difficult to decipher (what’s this theta variable and why is it not an angle?). Only after the fact, did I discover that his variable names were consistent with a paper. No one else knew he was following said paper, and he didn’t cite it in a comment.

                                                  If you are going to do this style, at least cite the source. I would still argue that’s worse than using descriptive names because it means a reader can’t take the code in at a glance.

                                                  1. 3

                                                    200-300 line function

                                                    Really big functions are more likely to fail a cyclomatic complexity anyway, so you have 180-280 problems and 3 letter variable names are just one.

                                                  2. 1

                                                    In a way it is fair game. It is all too common to hear in a code review that “a longer name will not make the code more readable”. Or “It has been named this way for 15 years”. Or “I am sure that this could have a btter name, but why change it now?”.

                                                    Saying “an experience engineer made this mistake” is a bit about saying “Look, this is not a rookie mistake, that makes it even more dangerous”.

                                                    1. 1

                                                      Yep, I’ve had way too many bugs where I just straight out typed the wrong variable name. push() instead of pop(), ++ instead of --, and so on.

                                                    1. 5

                                                      Just FYI, when viewing in Safari on OSX, the page goes completely blank after a few seconds.

                                                      1. 4

                                                        Hmm, same with firefox on windows. Looks like there’s some javascript error happening here.

                                                        OK, looking into it a little more. This is really strange. At first, the site loads with minimal styling, which is good in one sense, as it gets the content to the user in the quickest manner possible. Then it grabs some more styles and when it’s ready, renders those. I’m a little divided on whether this is the best way to do this, because the change is pretty abrupt. Not a huge deal though, we can live with that.

                                                        But then you realize that the Escher frontend framework is rendering all that content, and a single error is what causes the whole page to go blank. Here is the home page’s source code minus the javascript:

                                                        <!doctype html>
                                                        <html>
                                                        <meta charset="utf-8">
                                                        
                                                        <head>
                                                        </head>
                                                        
                                                        <link rel="import" href="pkg/Escher/basics.html">
                                                        <link rel="import" href="pkg/Escher/widgets.html">
                                                        <link rel="import" href="pkg/Escher/tex.html">
                                                        <link rel="import" href="pkg/Escher/codemirror.html">
                                                        <link rel="import" href="pkg/Escher/layout2.html">
                                                        
                                                        <body>
                                                          <signal-container id="root"></signal-container>
                                                          </div>
                                                        </body>
                                                        </html>
                                                        

                                                        What kind of atrocity is this?! Just looking at the HTML structure, the following problems are apparent:

                                                        • All those link tags belong in the head
                                                        • We have a closing div tag, but no opening tag
                                                        • There is absolutely no content in the HTML.
                                                        • Escher is using a non-standard signal-container tag, and injecting content into it.
                                                        • There are 2000+ lines of javascript ON THE INDEX PAGE (that’s more javascript than there is content, not even counting the linked javascript).

                                                        What good are web standards if you aren’t going to follow them? Why are you using javascript, a dynamic language, for static content, something HTML excels at? This disappoints me, as I was expecting something completely different coming from the Julia community, which seems to be interested in doing things the Right Way, for the most part.

                                                        The correct way to do this is firstly, put your content in the HTML. If you want to make it pretty with javascript, that’s fine, even dynamically applying the styles I have no problem with. Just make sure that the stuff that comes from the server could be potentially read (not necessarily has to be able to interactive) with javascript turned off. Especially for blogs and other read only sites. This guarantees that when your JS breaks, the content will still be there. And please quit abusing the DOM with fake elements that don’t exist. (I know, I know, web components are the future, Google said so, yada yada. The folks who actually designed ECMAScript disagree with you.)

                                                        Secondly, use the right tools for the job. Are web components actually necessary for a simple blog interface? Do you NEED 2000 lines of JS to render a blog post? You obviously care at least a little about loading performance, as you took steps to get the page to render quickly on slow connections, but you are defeating yourself by forcing the browser to download tons of JS before it can do anything. If you just put the content in the HTML in the first place, you give the user everything they need to read your article with only marginally more data served than the article text itself.

                                                        Progressive enhancement folks, when did it stop being a thing? Or was it ever a thing?

                                                        Gah, sorry for the lack of coherence there, but I’m fuming over here. This is why the ‘new’ web is getting itself a bad name. Not because it’s broken, but because the big players (Google, Facebook, Twitter) have made it uncool use it the way it was designed. If you aren’t building the next Facebook, you probably don’t need their technologies.

                                                        Just use Jekyll or something similar for your blogs people, there’s no reason to reinvent the wheel. Especially when that particular wheel works really, really well.

                                                        I’m sure Escher probably has a use for something… maybe. All I see though is another React/Angular-esque frontend framework, and I haven’t even bothered to look at the backend.

                                                        I’m just going to leave some frameworks here that actually get it right for the most part.

                                                        And I’m just going to leave this talk too.

                                                        Now I’m going to go take a long walk to cool off before I break something. I’m planning on writing a blog post on this once I get my thoughts more organized.

                                                      1. 13

                                                        If you want to try something Oberon-like, Acme from the various Plan 9 distros implement the same text-and-mouse UI. You can get it here.

                                                        1. 6

                                                          Yep. I enjoy most of the benefits of the Oberon UI every day in OS X using Acme from plan9port.

                                                          Unfortunately making some text programs behave and not output escape sequences for colors is a constant battle, so from time to time I switch to using Terminal.app instead of Acme’s terminal, which somewhat limits the usefulness (I’m looking at you bundler, git and a bunch of node shit).

                                                          The feel (as in look-and-feel) of Acme is quite different from OS X’s, but since the look itself is so different as well I have a good sense of place and it doesn’t trip me up anymore.

                                                          It took me like a month before I was truly comfortable. Pressing up and down was particularly jarring as they do page-up and page-down, but now whenever I try to use something else I come running back to Acme in about a week.

                                                          1. 3

                                                            Unfortunately making some text programs behave and not output escape sequences for colors is a constant battle, so from time to time I switch to using Terminal.app instead of Acme’s terminal, which somewhat limits the usefulness (I’m looking at you bundler, git and a bunch of node shit).

                                                            Included in plan9port is a filter “nobs” which filters escape sequences from text output. Maybe that helps you :) https://swtch.com/plan9port/man/man1/cat.html

                                                            And, at least with git you can disable the color with --no-color (I don’t know if that works with every subcommand).

                                                            1. 3

                                                              I thought nobs was for backspace?

                                                              git is actually quite well behaved with color, but the progress info on git-pull assumes your terminal can handle cursor control characters.

                                                              1. 3

                                                                It removes the bold, etc. stuff from manpages, which should also be escape sequences, if i remember correctly, but I may be wrong :)

                                                                1. 3

                                                                  The default man-style output from manual page tools (like mandoc, or the more traditional roff-based stuff) is actually an oddball character stream aimed at an honest-to-goodness typewriter. The only control character that appears in the output is generally the ASCII BS (backspace) character:

                                                                  • Bold characters are rendered by the typewriter carriage being wound back by one cell and the same character typed again, increasing the amount of ink on the page for that character.
                                                                  • Underlined characters are emitted by the typewriter carriage being wound back by one cell and an underscore (_) character being typed “over” (or, as it were, under) the character to be underlined.

                                                                  These encodings obviously don’t work in a video terminal, where overwriting a character simply removes all evidence of the previous cell contents, but by simulating a typewriter you can turn the stream of characters into a set of appropriate control sequences for, say, an xterm, or even into HTML. A simulation of this kind is also what tools like more and less are doing to make manual pages render on a video terminal with bold and/or underlined output.

                                                                  1. 1

                                                                    thanks for the explanation :)

                                                                2. 3

                                                                  nobs => No Bullshit.

                                                              2. 2

                                                                I’ve been meaning to try using acme as my standard editor, but the color scheme always turns me away. Is there a way to change it?

                                                                1. 7

                                                                  Short of editing the source (maybe here?), not really. Quoting Russ Cox from… elsewhere:

                                                                  At Bell Labs, Rob switched acme and sam from black and white to color in the development version of Plan 9, called Brazil, in the late fall of 1997. I used Brazil on my laptop as my day-to-day work environment, but I was not a developer. I remember writing Rob an email saying how much I enjoyed having color but that it would be nice to have options to set the color scheme. He wrote a polite but firm response back explaining his position. He had worked with a graphic designer to choose a visually pleasing color palette. He said he believed strongly that it was important for the author of a system to get details like this right instead of defaulting on that responsibility by making every user make the choice instead. He said that if the users revolted he’d find a new set of colors, but that options wouldn’t happen.

                                                                  It was really a marvelous email, polite yet firm and a crystal clear explanation of his philosophy. Over the years I have from time to time spent hours trying to find a copy of that email. It is lost.

                                                                  But I can say definitively, both as a matter of philosophy and because I did the lion’s share of the open source release work for both systems since color went in, that there have never been color theme files in the Plan 9 distribution, nor in plan9port.

                                                                  1. 6

                                                                    Not just any graphic designer, but artist and wife Renee French.

                                                                    Here is a good explanation that was posted to 9fans:

                                                                    the human system likes nature and nature is full of pale colors, so something you’re going to look at all day might best serve if it were also in relaxing shades. renee french helped me with the specifics of the color scheme (she’s a professional illustrator and my collar vision is suspect), once i’d figured out how i wanted it to look. there are still some features of the color system that i put in that i think no one has ever noticed. that’s a good thing, in my opinion; the colors should fade away, if you’ll pardon the expression.

                                                                    http://www.mail-archive.com/9fans@cse.psu.edu/msg13035.html

                                                                    1. 3

                                                                      Wow, of course, Tufte!

                                                                    2. 3

                                                                      Well, I guess that rules it out for me :(

                                                                      1. 5

                                                                        There’s honestly a lot about Acme that rules it out for a lot of people :/

                                                                        I’d say give it a shot and if the color is truly the only barrier, it’s probably one of the easiest things to change in the code. The behaviors or lack of features are a much higher barrier to entry.

                                                                        Or the need for a three button mouse.

                                                                      2. 2

                                                                        If the colors where chosen with color-blindness in mind I 100% support this.

                                                                        1. 2

                                                                          Color-blindness is not the only visual problem and not all are always in the same mode. I do, for example, suffer from bright colors (white!) quite often.

                                                                          Still, the solution for me isn’t theming (because my favourite websites don’t have it and have a white background), but shell-wide color inversion.

                                                                          1. 2

                                                                            Yeah I don’t agree with Mr. Pike’s reasoning either, I’m just lucky I’m cool with the default scheme.

                                                                          2. 2

                                                                            He said he believed strongly that it was important for the author of a system to get details like this right instead of defaulting on that responsibility by making every user make the choice instead.

                                                                            In a world of knobs and buttons, I find this to be an incredibly refreshing stance.

                                                                            When creating software I’ve always found one of the hardest decisions was around what control I retain. But I never seem to go wrong when I decide to remove a feature.

                                                                          3. 5

                                                                            It is possible to modify the source code and change the color of text, backgrounds, scrollbars, and tabbars, however syntax highlighting is not a thing in acme.

                                                                            1. 1

                                                                              The only way is to edit the source but doing so is actually pretty simple.

                                                                            2. 2

                                                                              I love acme, but the assumptions made by some cli tools about terminal capabilities really ruin the experience. It’s only half as bad when running a dumb shell inside emacs (M-x shell works roughly like win), since at least some control characters get interpreted correctly.

                                                                              The node ecosystem seems to have settled on the design decision that the unix shell is not a textual interface between small programs, but a retro-style color display with animated emojis. A loss, really.

                                                                              1. 2

                                                                                I hear ya: https://lobste.rs/c/zman75

                                                                                Reinvigorated by this thread I added a shell alias to de-colorize bundler. git is next. node stuff is harder, but I thankfully do a lot less of that.

                                                                                1. 2

                                                                                  I wish there were a standard environment variable one could set to get rid of all of that, instead of having to use aliases for every separate command.

                                                                                  https://twitter.com/jcs/status/524614835619635201