Threads for hjek

    1. 9

      The problem with this is names get too long. Eventually you have Java source with findAllWithUppercaseAndOrLowercaseIgnoringIndentation as a function, people need the common sense to not do that.

      I like this Ken Thompson take on the subject:

      Ken Thompson was once asked what he would do differently if he were redesigning the UNIX system. His reply: “I’d spell creat with an e.”

      1. 8

        Maybe the problem with your Java example is not the name though. Such long names are a good prompt to reconsider your design. Maybe ‘case’ should be a parameter, for example?

        This implies we should encourage long names because it makes design smells more visible.

        1. 4

          I agree. You could just call it findAll and have the rest be paremeters, like findAll(term, within, withUpperCase?, ignoreIndentation?).

      2. 3

        I pretty much agree with the article and programming would be a better place if people followed it, because having some variable names that are too long is less harmful than some variable names being too short.

        One additional reason is consistency: There is usually more than one way to shorten a term, but usually only one “full” spelling.

        Sadly the pendulum is still hanging pretty much in favor of short names.

        My personal rule is that nothing gets abbreviated until the abbreviation has

        • become almost a word of its own, and
        • the abbreviation is so commonly used that many people might have issues expanding it.

        So it’s fine to use HTTP, HTML, etc. but not much else.

    2. 3

      Those licenses are not very clear. On the front page the parity license is listed as allowing for-profit use, yet the license itself reads as if you’re not allowed to charge for distribution:

      This license lets you use and share this software for free, as long as you contribute software you make with it.

      Also, what’s up with this?:

      1. Contribute software you develop, deploy, monitor, or run with this software.

      So if I use a parity licensed text editor or shell, presumably I’d have to “contribute” (what does that even mean?) programs I write myself or programs that I run.

      Why would that make sense? Would that ever be enforceable?

      These are all clearly non-free licenses (unless optional relicensing is allowed), so it’s somewhat misleading to list them as having the “door open” to “open source”.

      1. 2

        The point of the license is to ensure that source is available, and that software developers hold onto power against massive corporations who are able to monetize more tepidly licensed open source software with their scale.

        If you don’t want to abide by the terms of the Parity license, you’re free to not use it, or seek a commercial license for your use of it; the License Zero site makes it easy for developers to charge for those commercial licenses.

        1. 5

          If I used a licensed program to monitor in-house closed-source software, what and how would I contribute?

          IANAL but I feel like someone wanted to take a crack at writing something cool for licenses but either didn’t think it through or didn’t verify it properly.

          Of course we’re all free to not use dubious software, but people do it all the time regardless. The world would be better off with clearer definitions and people who care more.

          Edit: just re-read the Parity text. I’d publish the monitored software on Github as a contribution to the monitoring software. Dunno how I missed that that’s what it actually means. Maybe I was in denial ;)

          1. 2

            I believe that the author of these licenses is a lawyer, and they were created very specifically to do what they do.

            1. 7

              Having read them I find that very surprising.

            2. 3

              There are a lot of blog posts on the site that go into the rationale behind the licenses: https://blog.licensezero.com/2018/09/14/free-to-take-freedom.html

              1. 3

                What I’m not following is why conflate licensezero (paid access to a commercial license in lieu of an open one) with very specific licenses for public distribution. There’s no reason licensezero couldn’t be applied to GPL code, for example. Obviously not every developer wants to license their software under the GPL (or Parity for that matter), but the concept of licensezero works regardless of the developer’s preference on the topic. Fixing it to specific minor licenses prevents licensezero from being a large scale offering.

            3. 3

              So what’s monitoring? strace or something that checks a network service is up? I guess you could bolt more terms onto it but then the little foundation becomes essentially irrelevant.

              Maybe the author is a lawyer but this feels sloppy.

              Though I didn’t look deep into how that Stripe thing should work. Maybe I missed the thing that makes it all complete, though I doubt it.

              1. 3

                The law isn’t code. It’s not meant to describe every possible use. It’s a philosophical statement and tool to advance a particular set of values, and enforcement will be done within the same human-driven, non-code system. So if you’re using a Parity licensed tool in contravention of its terms, the author would have to convince a court of their case.

              2. 3

                It said with this software. The interpretation I had is that you’re using the software that has that license to do one of those things. You’re benefiting from it with changes or integrations. So, you have to release under same license those changes or integrations. The author is trying to stop you from doing clever bundling to dodge the license. That’s a real thing I warned people about.

                Folks claiming licenses protect freedom keep ignoring such strategies. Whereas, License Zero author is trying to address all these dodges with the simplist license he can. Compare Parity to AGPL in terms and complexity.

                1. 5

                  The author is trying to stop you from doing clever bundling to dodge the license.

                  I can appreciate that about the license, and that’s a wonderful goal! I’m just in doubt how to interpret the exact implications are from those measures. If we take something like this:

                  1. Contribute software you develop, deploy, monitor, or run with this software.

                  If a Unix shell had this rule, then I must publish my shell history since those commands would’ve been run with the shell (and arguably also developed, deployed and monitored with it). I can see how this technically wouldn’t be a restriction on the use of software, but it would be quite impractical.

                  Also, if a browser was under this license, you’d have to publish all JavaScript your browser runs, “in the preferred form for making changes,” which would mean that such a browser wouldn’t be allowed to run non-free JavaScript (interesting!). Arguably you’d also have to republish any free JS script you’ve run “through a freely accessible distribution system widely used for similar source code.”

                  Yes, I’m being super pedantic here, but my impression is that so is law occasionally,; just look at the problem with the old BSD License. Surely the intentions of the author (and people who’d use this license) is not to go that far in stopping share dodgers?

                  1. 2

                    Ok, finally got just enough sleep to get back to you.

                    “If a Unix shell had this rule, then I must publish my shell history since those commands would’ve been run with the shell (and arguably also developed, deployed and monitored with it). “

                    That’s a clever example. Yeah, the license might not be appropriate for something like the shell. I’m sure that could take some thought to figure out how to improve the license. I might pass it on to License Zero author. Meanwhile, do remember that problems with licenses on a specific component might lead developers to re-license under a mix of them. Some things they might license as Apache, GPL, AGPL, etc with rest under Parity. Companies might try to freeload off whatever wasn’t under Parity. They still get less freeloading value given the developers were able to limit what they could take.

                    “Also, if a browser was under this license, you’d have to publish all JavaScript your browser runs,”

                    Is that really a bad thing in a license that intends to maximize free software? (nudge nudge)

                    Another good objection, though. Scripting engines were always a way to repurpose existing apps to make them behave quite differently. The modding scene for games comes to mind. He probably should think carefully about embeddings. If looking at commercial or non-commercial use, Javascript is a really, intriguing problem in how it’s used on the web. I think this is a case where he’d tell them to buy a proprietary license for whatever it is or the company would distribute the browser under non-free-as-in-speech license. Given existing ecosystem, Javascript might just be too messy to handle with a simple license.

                    That said, prior work inspires a simple solution: Parity-licensed browser with license exemption for Javascript that runs in it. Since Javascript isn’t fully-copyleft, they hypothetically might start building entire apps in web browsers from text editors to IRC-like setups to social media. Fortunes would be built off it with maintenance burden on browser developers. The response might be two fold: anything getting common (de facto standard) gets a nice, native implementation in the browser under Parity license; the exception allows JS for non-commercial use with for-profit sources having to pay for a license. The latter might check the certificates against an internal list or something. Complexity is still mounting, making a license exception most sensible so far.

                    Now, it might not be as difficult to deal with something like Lua or even Javascript that’s not a browser. These are usually in apps that are proprietary or distributed for free. If proprietary, they get a proprietary license like an acceptance fee and/or cut of sales in the 3rd-party app or plugin store. This is already a common practice. If free, Parity would make the 3rd-party apps/plugins/scripts as free as the project they’re built on. If the host is free, then why should the guests get paid? I know some wouldn’t like it but it doesn’t seem unfair in those situations. Finally, an exception might be allowed for 3rd-party content under paid or free terms. It could even be conditional on whether they themselves are paid or non-paid.

                    1. 2

                      Also, if a browser was under this license, you’d have to publish all JavaScript your browser runs,

                      Is that really a bad thing in a license that intends to maximize free software? (nudge nudge)

                      Nah, that wouldn’t be a bad thing at all.

                      But does this license really do that? If a JavaScript engine is licensed in a way that disallows running non-free JS programs, is that not then a usage restriction? Such a restriction would make the JavaScript engine itself non-free, at least according to the FSF definition, which includes: The freedom to run the program as you wish, for any purpose (freedom 0).

                      1. 2

                        is that not then a usage restriction?

                        It might technically not be valid. I think usage restrictions that are specifically about enabling commercial freeloading maybe should be counted as a negative in their definition. They’re trying to compromise in a way that ended up undermining their goals on contribution side.

                        Maybe we need a new phrase that represents about everything that’s otherwise considered FOSS but allows usage restrictions if the purpose is forcing maximal sharing of code. It goes a step further than the technical definition of FOSS.

    3. 7

      I feel like it’s worth mentioning that some people feel like using Beamer is a bit of a curse. Nothing makes a presentation less engaging than piles of equations, tiny source code, and bullet points, but that’s precisely what Beamer makes easy to add.

      I think some of the javascript libraries for presentations are a better fit as they make it easy to embed videos, animations and transitions that guide the eye to what matters. Unless you need to be able to send someone a pdf of the presentation, I’d hesitate to recommend using this library without large amounts of discipline.

      1. 9

        I think what’s going on here is that too many people have been sitting in university rooms listening to boring lecturers giving excruciating presentations made with Beamer and filled with hundreds of bullet points.

        Not that I’m the biggest Beamer expert out there, but I use it for all my slides and I think the results are pretty good.

        I think some of the javascript libraries for presentations are a better fit as they make it easy to embed videos, animations and transitions that guide the eye to what matters.

        Animations, videos and transitions can be abused exactly like bullet points. In an effort to escape the boring-lecturer-effect, we should be careful not to err on the side of entertainment and produce presentations filled with animated gifs and almost zero content (I’ve seen many of those too, lately).

      2. 2

        I think some of the javascript libraries for presentations are a better fit as they make it easy to embed videos, animations and transitions that guide the eye to what matters.

        Unless you want to print the slides..?

      3. 1

        Nothing makes a presentation less engaging than piles of equations, tiny source code, and bullet points, but that’s precisely what Beamer makes easy to add.

        At university this has become quite popular. Instead of lecture notes we just have densely populated beamer presentations, which seem neither to read during a lecture nor to read when learning.

        I think it’s a pity that many of the more interactive features of beamer beyond \pause are just forgotten, ignoring seemingly all principles of good presentation-making.

        1. 1

          I’m not clear even the advanced features really help. I think it matters what makes a tool easy to do.

        2. 1

          This is why I despise Beamer. Also it is a pain to use compared to alternatives.

      4. 1

        I totally agree! I have used reveal.js with pleasure and success, though I used only a bare minimum of the features, as I find most stuff in presentation software distractions not attractions.

      5. 1

        What javascript libraries do you have in mind? l’m a heavy (disciplined) Beamer user and, like @ema, think I produce quality slides, but I am curious about other tools for programatic presentation generation.

        1. 1

          Truthfully, these days I use reveal.js with Jupyter notebooks (https://github.com/damianavila/RISE)

          I’ve used deck.js, reveal.js and eagle.js. Aside from needing to futz with npm these have all been perfectly adequate. Thanks to MathJax, I can still put in an equation if it’s needed. For some of them you can even use pandoc to generate the html directly from markdown https://pandoc.org/demos.html.

          Like I said, if you are disciplined, Beamer can work really great. For me what counts is what the tools encourages you to do and not to do. From that standpoint, a lot of tools would have trouble outdoing sent

      6. 1

        That’s interesting to know. I’m in the process of converting my workshop slides from PowerPoint to beamer. Most of the slides are either code, short definitions, or diagrams, and I wanted to be able to easily find/replace my slides. They’re there to frame the live coding sections, so hopefully the plainness won’t be too much of a problem.

    4. 2

      Lovely colours, the themes look good and are still usable. Cool idea using image-q to generate a dynamic palette.

      That said, I’m a bit puzzled of the effort that goes into changing the colours of the top 1.5 cm of the Firefox window. I kinda wish it would have an option to colourise the whole browser window, like Dark Mode.

      Also, on my screen the date input field is too narrow and cuts off the day. And if you pick an image from another date, it switches back to the image of today after a seemingly random delay of a few minutes.

      1. 2

        Thanks for the feedback!

        The Dark Mode link is broken for me, but I’m aware of extensions like that. It’d be a lot more challenging for Picture Paint though because the colors can be any value. It’s hard for me to think of how to make generic colors look decent on actual websites, as opposed to just in the browser chrome.

        For the date input field issue, would you mind providing any more details? I’d be happy to look into it.

        For the issue with it switching back to the image of today, that’s occurring because the extension checks for a new image every ten minutes. It only locks to a specific date if you set it to do so on the preferences page. I’ll think about how to improve this case.

    5. 24

      Describing an electron app as “doesn’t suck” when there are multiple native macOS Markdown editors is a bit rich.

      1. 4

        Being native isn’t everything. Btw you’re going to need a HTML renderer anyway if you want to render Markdown notes. Some native apps, like Evernote, use the available engine, at least on macOS, and they have to check if their notes render the same way across platforms, and for some reason they show you a spinner before rendering even simple notes. Notable ships the rendering engine with the app, but at least it doesn’t show you the spinner.

        1. 5

          and they have to check if their notes render the same way across platforms,

          Doesn’t markdown typically render to all but the simplest of HTML elements? (e.g.,Lists, headers, paragraphs, links) I find it hard to believe that different platforms are going to render this dramatically different (aside from default fonts).

          1. 2

            You can put arbitrary HTML inside Markdown. For the most part maybe the result will be the same, but different engines don’t always render out the same thing, so you have to check.

            1. 3

              But do you regularly use random HTML in markdown when taking notes? I’ve never needed it. If so, what things are you using? And, how necessary is it? Does the amount of software complexity/bloat really create more value?

              1. 2

                I sometimes use the <kbd> tag and the <p> tag for centering images but not much else. You could restrict your support to a narrower syntax, but then that stops being a Markdown renderer for me.

                1. 2

                  For me, Markdown’s “can copy over HTML” is a mistake. I much prefer it with extensions, to do tables and things. That’s my choice though. Thanks for clarifying your choices.

            2. 3

              Does it matter if it renders out the same thing? Heck, even for actual websites some differences per target are expected (and at least by me, appreciated). Extreme example: lynx. Or user stylesheets or min font sizes, etc. One of the nice things about HTML is that it is somewhat flexible like that.

              1. 1

                I guess it depends on the difference, as long as the note is rendered “ok” the differences may be acceptable.

            3. 1

              You can put arbitrary HTML inside Markdown.

              Well, that depends on the markdown processor and output format, doesn’t it? If I use Pandoc to convert markdown to PDF via LaTeX, then I don’t expect to be able to put HTML in there.

              1. 2

                Of course it depends on your definition of “Markdown”.

                1. 2

                  That then refutes this point:

                  Btw you’re going to need a HTML renderer anyway if you want to render Markdown notes.

                  1. 2

                    I think he meant that if you define Markdown as something different than the common and original definition (text → HTML processor), then yeah, you can’t put arbitrary HTML in a Markdown document.

                    But this project uses the normal definition of Markdown, which allows arbitrary HTML.

    6. 4

      Without screenshots or a demo instance, it’s hard to be very interested, especially as someone with little PHP experience or interest.

      1. 3

        especially as someone with little PHP experience or interest.

        Yup, I was posting this more in spite of being in PHP than because of it. I’m interested in these Lobster-like sites (because I’m working on one myself), and the main deployment of Postmill appears to be Raddle, so check that one for a demo.

        And like Lobsters was created in objection to some HN policies, Raddle was created because of objections with the way Reddit is run.

    7. 1

      Reminds me of Dasher.

      1. 2

        Thank you so much for this! I’ve been looking around quite a bit for previous work. But haven’t been able to find very much.

        Do you use Dasher?

        1. 1

          Nah. It’s a method for using mouse instead of keyboard, and I’m quite comfortable typing. I’m more into methods for reducing mouse/touchpad use, so I find Vimium useful.

          On the topic of unusual input methods, you might also like Eviacam which lets you control the mouse cursor with your head.

          1. 2

            mm Vimium has been a great source of inspiration for me! I think there exists a fork that lets you control it with your left hand only. Basically I am trying to solve the same problem, but from a different angle. Instead of having the keyboard do all things, my idea is to limit the keyboard to half the size. No more back and forth.

            Please head to the site and click subscribe if you want updates! I have some new things that I want to add.

            Also I’m quite curious on what the audience is interested in. I have a thousand ideas but I suspect that what you guys are looking for is a fraction of those things. Without communication it’s so hard to figure out what people are looking for.

            Personally I am looking for two things:

            1. to be able to code from my coach
            2. To be able to use my mouse for tweaking settings in developer tools and to type code with my left hand *

            *) without that endless back and forth

            Chorded keyboard as in the mother of all demos: https://www.youtube.com/watch?v=t5WUBweOZA4

    8. 2

      id (excluding the reserved names , …, .., ..k, and ..k for non-negative integers k) or (var id) — matches anything, and binds id to the matching values. If an id is used multiple times within a pattern, the corresponding matches must be the same according to (match-equality-test), except that instances of an id in different or and not sub-patterns are independent. The binding for id is not available in other parts of the same pattern.

      I was pleasantly surprised by the way this works.

      (define (f xs ys)
        (match (list xs ys)
          [(list (list a b) (list a c)) 'heads-are-equal]
          [(list (list a b) (list c d)) 'heads-are-not-equal]))
      
      > (f (list 1 2) (list 2 3))
      'heads-are-not-equal
      > (f (list 1 2) (list 1 3))
      'heads-are-equal
      
      1. 1

        Yea, it’s like some kind of implicit binding akin to Prolog.

        Racket can sometimes be a bit verbose, and I was pointed to this when asking on the #Racket IRC channel how people deal with that. I’m new to pattern matching, but I find it more terse and understandable than multiple ifs and lets, and more flexible than anaphoric macros like aif and awhen.

    9. 1

      Python was my first programming language, and one of favourite things about it was its indentation syntax. It’s a great language, but I really wish things like recursion and lambdas were more painless in that language, because this looks like kind of an annoying quirk to keep in mind when writing recursive functions. It’s a bit sad when stuff you have to learn is not about learning interesting ways of expressing new ideas; but rather learning how to steer around the bugs and design mistakes.

      For me, I find that Parinfer gives that indentation syntax feel to lisps, and without the limitations from Python, e.g. not being able to write (list 'hello (if (world? 'here) 'world 'non-world).

      1. 2

        Counter point: I’ve been working with typescript and c# and, while the full flegged lambdas are useful, the kind of atrocities people commit with it make me miss the restricted lambdas from python.

        1. 1

          I’m kind of curious what such a lambda atrocity would look like? I’ve dealt with some lambda-heavy JS code, but I think that’s often more like callback hell, which is perhaps something slightly more specific. Do you have any good examples?

          1. 3

            It’s the holidays, so I don’t have any examples at hand. But my main issue is that people go overboard, writing pretty complex expressions inside lambdas inside other lambdas, all of them with one letter parameters that have no sense or consistency, and it’s hell to debug.

            When you pair lambdas with chained methods like the collection methods from typescript and c#‘s LINQ, it’s like a perfect storm of unreadable code. Enormous chains of methods, with very complex lambdas inside, stretching for over 150 columns. I find it pretty much impossible to read without breaking it and formatting first, in almost all cases.

    10. 8

      Prolog, and possibly use Tau Prolog for distributing apps.

      And more SQL.

    11. 5

      Good overview of Davis’ entire “career”.

      That whole thing with him recording messages for a semi-fictional Diana is just too much like Agent Cooper; and the tale of Davis as egomaniac bipolar genius who won’t take meds because it destroys his creativity reminds me of Bill Milkowski’s biography of Jaco Pastorius.

      Amazing this thing with his 48 hour cycle. Does anyone else do that? And a 12 hour live stream?

      He drinks a lot of caffeine and lives mostly on a 48-hour schedule: “I stay awake 162 and sleep 82.”

      I’m glad that some fans managed to meet up with him, and that his internet fame at least led to something else than trolling by 4chan’ers and kiwi farmers.

      I’ve seen discussions about TempleOS technical qualities but rarely about the aesthetics, but in my opinion Terry was a most amazing outsider digital artist; incomparable to many others who pretend to be just that. Those 16 color dithered 3D shapes rotating to the tune of atonal monophonic reverberated square wave melodies are psychotronic.

      1. 2

        “the tale of Davis as egomaniac bipolar genius who won’t take meds because it destroys his creativity”

        One of reasons I didnt take meds for PTSD. Too many people on mind-altering meds were telling me about side effects. I decided Ill keep my mind even if it’s painful.

        1. 4

          I find this to be an anti-pattern; Better Living Through Brain Chemistry is something that has made myself and several good friends able to actually survive and function consistently in the world. That said, it’s scary as heck to start tinkering with the thing that makes you be you, especially since everyone’s system is a bit different so the results are unpredictable.

          Nice thing though, you can always just stop and go back to what you were before.

          1. 4

            Addendum, since lobste.rs’s edit functionality seems borked: Though some things are way more treatable than others: depression and bipolar disorder, often manageable. Schizophrenia? Really hard problem to deal with. But I’ve seen the “I don’t want to risk becoming someone else” meme seriously scare people away from treatment when they could have really used it.

            1. 4

              Re: comment editing - I believe a comment is locked for editing after a number of hours.

              1. 2

                Comment editing is also broken here, right after posting, and the Preview button clears the text area. It’s only started happening very recently on Lobsters.

                1. 5

                  Comment editing was broken for approximately 24 hours from Saturday morning to Sunday morning CST. It’s now been fixed.

                  On Saturday morning we did a production release, catching up on quite a backlog. We’ve waited for a holiday weekend because of risk of regressions in some of the work, particularly Rails 5.1-related form handling changes in #527. It had however been long enough since the last release that we had gotten two reports for issues fixed but not deployed (#396 and #621).

                  The release did have regressions. A change to make testing a cron script easier broke said script in prod. @355e3b wrote commit 93440c for #622 after a user reported invitations could not be accepted. @pushcx wrote commit c6759f3 prevent a custom Rubocop rule from running in prod, building on previous work for the same.

                  By the time #624 came in last night I decided it was all right to wait until tomorrow for help from the usual suspects and see if a patch would come from evexoio or other folk active in the ticket system. Everyone had already had a pretty busy morning. @pushcx has now reverted the form regression (commit 3cc6ff7) and editing should be restored.

                  Thank you @gerikson and @hjek both for the problem report and getting it routed to the issue tracking system. I appreciate all y’all accommodating the regressions. It’s been a consequence of the extra help and interest in the codebase following a call for contributors. We’ll learn from the growing pains and would love to continue seeing new and continuing contributions.

                  1. 3

                    I thank everyone involved in fixing that. It was a huge pain. Then, tonight, it worked again. Thanks to everyone supporting the site and Merry Christmas. And just have a great week if Christmas isn’t your thing. :)

                  2. 1

                    Thanks for fixing this!

                    I like that Lobsters is openly and actively developed (in contrast to HN where the source was thrown over the fence a few years back, and that’s it), and it makes me want to dig into the code and learn more Ruby, although interestingly the longest file is JavaScript: select2.js, the input for selecting story tags. Lobsters has a lot more JS than HN has.

                2. 3

                  I’m sure a bug report would be appreciated: https://github.com/lobsters/lobsters

            2. 2

              “ But I’ve seen the “I don’t want to risk becoming someone else” meme seriously scare people away from treatment when they could have really used it.”

              It’s happened to me before with diet, not drugs. Healthy stuff, too. My brain stopped working at the level it does. I was mentally biased in favor of the diet expecting results. I got a loss thinking it was other things. Switched back to prior, eating habits to have my brain light back up. Got some good submissions in that week, too, with about nothing before that week. I’m thinking it’s that gut bacteria or whatever I keep reading about with my family consistently hit by stomach and immune problems. Gonna get some testing done in near future.

              Stuff like that mental change freaks me out. I’d rather not have the problems I have like anyone else. I also don’t want to give up what makes me unique compared to most people seeing what they don’t or avoiding problems they run right into. I have many flaws but some strengths discerning folks tell me are rare. They come from a combo of how my mind works, apparently my gut as well, and my environment (esp history and introspection). The good things might have not happened if I changed my nature. Probably not have happened for some things, actually.

              So, those changes will be a hard decision that I want to do incrementally with ability to reverse any one if the cost outweighs the benefits.

            3. 2

              But I’ve seen the “I don’t want to risk becoming someone else” meme seriously scare people away from treatment when they could have really used it.

              I think that “meme” is what is often called outcome resistance, when someone doesn’t want to be cured, because parts of their illness is helpful to them. If you have a strong fear of cars, getting rid of that fear completely could mean you could just walk onto a busy road and get run over.

              Terry Davis was hearing voices and the paranoid “FBI voices” are clearly harmful, causing him to drive his van out into the desert and tear it apart because he thought it contained hidden radio equipment. But the creative “voice of God” was telling him how to design his operating system with a 640x480 screen resolution. So it makes sense why Davis would refuse to take some drug that just removes all symptoms of his illness.

              Dr David Burns (who does CBT) argues that wanting to help often leads to therapeutic failure because of the patient’s outcome resistance, so Burns has an interesting way of dealing with this, which he calls paradoxical agenda setting.

          2. 2

            Im open to trying something in the future. For now, gotta be me for sure.

            1. 2

              MDMA has been shown to be quite helpful for PTSD (you’re probably aware, but figured I’d mention it just in case).

              1. 2

                With my memory problems, it doesn’t hurt to suggest stuff in case I forgot it. I also haven’t looked at this stuff for a long time. Maybe I never saw it. So, thanks for the tip! :)

                I actually manage it so well on most days that people are surprised I have it. They just notice occasional moments of weirdness, anxiety, and so on. I just tell them I’m prone to anxiety but mostly got over it. Sometimes out of it with my mind somewhere else. Or just extra tired or stressed from that week which is often true anyway. They’re familiar with those things. I go from an ultra-weird potential-threat to a kind of weird person they maybe have met and shrug at. I tell a tiny fraction of people the truth about me after being around them for quite a while. By that time, they usually are shocked thinking I might have made it up since they didn’t really see signs of it. Then, most forget about it later since I seem so unlike my condition. So, I have to remind them when they wonder why I (insert symptom here). They go, “Oh yeah” sometimes believing that or not.

                It’s strange and annoying. So many people with the condition are still trying to figure out how to combat its symptoms to get more normal. I solved that for my variant only to run into the problem of figuring out how to tell people I had a condition while still acting normal and them remembering it. I’m sold on not telling them ahead of time since it leads to discrimination, esp job-related. So, I just currently outperform most folks, esp on unpopular jobs, with a wise-guy style with cynical, shock humor since they accept that best. That’s so far at least laid foundation for them accepting the truth pretty well with minimal discrimination or weird behavior. Also a decent outlet with dark humor that teaches important truths and roasting the assholes that are here. I’m so much nicer on Lobsters given most of them are nicer. ;)

    12. 8

      Great writeup! Thanks for posting this. Reading about puzzle solving in Prolog makes me want to get more into that language.

      I’m quite new to Prolog, but just being vaguely familiar with the language often makes me think that would be so much easier in Prolog on real life problems. For example, a friend of mine spent 3 full weeks putting together a time plan for a festival using spreadsheets trying to account for people’s availability and the different tents, yet I’m fairly confident that problem could be solved in less than 100 lines of Prolog (which I intend to do before the next festival).

      That said, the definition of uniq_ppl looks rather clumsy, with its fixed number of arguments and all. Why not just use all_distinct?

      (Also, can we have a Prolog tag here on Lobsters, please?)

      1. 4

        I agree with a Prolog tag. I think the formal methods tag is very misleading.

      2. 3

        One common failstate I’ve heard for ‘computer assigned seating’ is that it doesn’t know enough about the more social elements, like that Alice and Bob are in a blood feud going back 10 generations, or that So-and-so is part of a group of friends that would be upset if they got split up. Probably you’d want to keep people near to who they were near last year, since it presumably worked out well enough.

        I didn’t get much further than “Hello, World” like a month ago; can Prolog rank & sort its output?

        (Also, hello lobste.rs!)

        1. 3

          I don’t remember if Prolog can rank solutions, but I know you can impose constraints like “person A should not be seated beside person B”. The map region colouring example in the article is a demonstration of this.

        2. 3

          There are definitely ways to rank output. One way would be to generate potential solutions as a list where each element is a pair of a potential solution and a score for that solution, and select for the maximum.

          (Caveat: I’m pretty bad at prolog, but I’m relatively confident that works).

        3. 1

          One common failstate I’ve heard for ‘computer assigned seating’ is that it doesn’t know enough about the more social elements

          Totally agree! I think however that that type of failing is more the fault of the programmer than the language, because there’s nothing preventing you from adding a hates(alice, bob). fact.

          1. 2

            That requires one of Alice or Bob to actually tell the guy behind the desk that they don’t want to sit together. Mining all the needed information is the hardest part of computer-assigned anything.

            1. 2

              That requires one of Alice or Bob to actually tell the guy behind the desk that they don’t want to sit together.

              Well, yes, that is correct, but that is an issue with a seating plan even when done on paper (although an issue like this is easier to tell to a human being than a GUI that doesn’t have an input for that).

              1. 2

                It’s also something a human may not “remember” up front, but be reminded of just before attempting that solution.

        4. 1

          Hello and welcome to Lobsters! Hope you enjoy it! :)

      3. 2

        I thought of all_distinct/1 there as well, but that’s actually a clp(fd) predicate that only works on integers. It would probably be nicer to use dif(A, B) instead of \+ A = B though.

        1. 3

          Here’s a general implementation of “these variables are unique”:

          pairs(Xs, Pairs) :-
              bagof(X-Y,
                    Other^(select(X, Xs, Other),
                           member(Y, Other),
                           X @< Y),
                    Pairs).
          
          uniq(Vs) :-
              pairs(Vs, Pairs),
              maplist([A-B]>>dif(A, B), Pairs).
          

          Example use:

          ?- uniq([A, B, C]), maplist([X]>>member(X, [1, 2, 3]), [A, B, C]), A = 1.
          A = 1,
          B = 2,
          C = 3 ;
          A = 1,
          B = 3,
          C = 2 ;
          false.
          
        2. 1

          Oops, yes, I missed that all_distinct is only for integers.

          Regardless, I think it a recursive definition is simpler and more general, for example like this unique relation.

    13. 20
      1. 4

        how often do you receive email that is HTML-only and what do you do when that happens?

        1. 8

          I pass it to w3m using a mailcap entry. It makes most HTML mails readable. For the ones that still don’t display correctly, I ignore them and ocassionally send a response back to the sender asking them to stop sending unreadable mails.

        2. 7

          I also use mutt exclusively.

          Typically, HTML-only emails aren’t actually emails I want to receive. If, for some reason, I do need to view the email in rendered HTML, you can have the HTML attachment rendered in your browser. But most of the time it’s good enough to just pass it through to w3m and render the content in mutt.

          1. 1

            Are you able to sync address books from IMAP servers?

            1. 3

              I use lbdbq from lbdb with Mutt’s query_command and then configure whichever backed I need, i.e. abook, finger, LDAP, etc.

            2. 1

              Mutt can use an external command/program to query for contacts. As long as you can get them out of whatever external system, mutt can use them.

              For example, here’s how you can set it up so that mutt reads from your contact book on OS X: http://stevelosh.com/blog/2012/10/the-homely-mutt/#contacts (I don’t use this particular setup, but it’s well explained).

              1. 2

                When I use any other email client such as Thunderbird with my institution, once I configure the IMAP and server, the client is able to automatically fetch the relevant addresses (from some LDAP server I guess) for my institution. Thus, it is able to autocomplete the addresses even if I had never emailed a person before so long as they are an employee of that institution. However, I am unable to figure out where exactly Thunderbird (or apple mail) is getting this information from. I do not see any LDAP configuration in its settings.

                So my question then is, how do I figure out which LDAP is associated with a particular IMAP, and is there any way to retrieve this information from other email clients?

                1. 1

                  That is something I’m unaware of. I’ve always configured my contact syncing (from whatever source) separately from my IMAP configuration.

        3. 4

          HTML-only is usually SPAM, but I have a server-side html2markdown filter to add a text part in these cases, which works out maybe half the time. In (very rare) cases when I need to read an HTML-only email where the filter didn’t produce something useful, I hit the button in mutt to open in firefox

          1. 2

            isn’t opening it in Firefox is worse than opening in a HTML-mail reader (like Thunderbird)? Firefox will run scripts, load remote images etc. Thunderbird disallows scripts and only loads remote resources through opt-in.

            1. 2

              What’s your threat model here? Do you think this hacker-ish setup is common enough to become a target? I think if a person is savvy enough to setup their email client this way, then they’re also savvy enough to quickly spot 99.9%+ of fraudulent emails.

              1. 2

                Mostly concerned about read tracking really. So this isn’t for targeted attacks but re-enabling the common threats

            2. 1

              On spam and newsletters? Yes. But those go in the trash long before getting opened :)

        4. 2

          I use mutt exclusively, but I do care about being able to read HTML.

          When I get an email that doesn’t render in mutt, I hit H and it renders the email in Google Chrome.

          I synchronise my email server (Fastmail) with mbsync, so I always have my stuff even if I’m offline. I use notmuch for searching.

        5. 1

          Non-sarcastic counter-question: Are people who read HTML email not worried about the privacy implications?

          1. 5

            I was under the impression that Thunderbird’s “don’t display images” feature is good enough to avoid this - please enlighten me if it isn’t.

            I get by with seeing only the HTML body sans external media 90%. For some rare providers I do allow to load stuff, but usually I can “click to open website” and yes of course, they can then track that I read that mail - but I signed up for that newsletter and I am actively looking, so I guess that’s fair then.

          2. 3

            I, for one, am.

            Honest question: do mutt or other non-HTML email systems handle typographical things you’d want from HTML? For me, the minimum would be underlining, italics, mono-spaced and proportional fonts. I’ve not yet discovered what to search in the manual.

            1. 3

              mutt itself doesn’t handle he html stuff at all: it just pipes the html to some other program which pipes back text to display. So you can do that if you want by piping it through a converter program and using a terminal that supports it, though personally I like not having any of those things. I like to be able to just read it.

            2. 1

              Honest question: do mutt or other non-HTML email systems handle typographical things you’d want from HTML?

              I generally don’t want those in my emails either. I prefer plain text.

              1. 3

                You may prefer that, but my desire for more is well-founded.

                The vast majority of systems for conveying textual information other than the limited world of terminals has supported the things I’m asking for, because they are useful. My personal most frequent use is monospace for referencing classes or code examples.

            3. 1

              mutt is a command line program, so whatever your command line can display is what you get in mutt.

          3. 3

            I use Fastmail’s web interface and the built-in Mail app on macOS and on iOS, and all of these have options to prevent images from being loaded unless and until you click a button to show them. My point being, defense against tracking pixels is a widespread feature at this point.

          4. 2

            Any modern email client doesn’t load remote resources (images) by default, there’s a “show images” button.

          5. 2

            I have disabled auto-loading external images in gmail

      2. 3

        How do you manage the address books? That is, are you able to hook into Gmail and other IMAP address books? (LDAP). This is the largest pain point for me

        1. 2

          I have a script that adds every email address I send email to to my mutt aliases file for easy tab completion

        2. 2

          I’m using vim-notmuch-address where CTRL+X CTRL+U completes email addresses (also works by name).

    14. 3

      The Life-Changing Habit of Tidying Up. I’m quite the neat freak and thought my end-of-year vacation (the first in 3 years or so!) would be best spent cleaning up. I’m hoping to learn some process, and maybe some new tricks. If nothing else, the book should set the mood for next week. :)

      Also 12 Rules For Life. I’ve been finding Jordan Peterson’s philosophy to be so much more insightful than what people online make it to be.

      1. 3

        Also 12 Rules For Life. I’ve been finding Jordan Peterson’s philosophy to be so much more insightful than what people online make it to be.

        I think JP has a particular talent for saying one thing while simultaneously denying that he’s saying that at all. A peculiar kind of double-think. And a unique ability to rapidly switch from something very agreeable (petting cats / skateboarding is cool) to something deeply horrifying (denying global heating / only eating cows and no plants, ever).

        An example:

        JP: Well, I don’t really have beliefs about climate change, I wouldn’t say. I think the climate is probably warming, but it’s been warming since the last ice age, so,

        HL: But It’s dramatically accelerated in the last couple of decades.

        JP: Yeah, maybe, possibly, it’s not so obvious, I spent quite a bit of time going through the relevant literature, I read about 200 books on ecology and economy when I worked for the UN for a 2-year period and it’s not so obvious what’s happening, just like with any complex system. The problem I have, fundamentally, isn’t really a climate change issue. It’s that I find it very difficult to distinguish valid environmental claims from environmental claims that are made as a secondary anti-capitalist front, so it’s so politicised that it’s very difficult to parse out the data from the politicisation.

        So, he doesn’t really have any opinion on climate change … oh, except that anti-capitalist claims are not valid environmental claims. And similarly he doesn’t advocate enforced monogamy, he is just “objectively” presenting an argument on why it’s a great idea:

        So, let’s summarize. Men get frustrated when they are not competitive in the sexual marketplace (note: the fact that they DO get frustrated does not mean that they SHOULD get frustrated. Pointing out the existence of something is not the same as justifying its existence). Frustrated men tend to become dangerous, particularly if they are young. The dangerousness of frustrated young men (even if that frustration stems from their own incompetence) has to be regulated socially. The manifold social conventions tilting most societies toward monogamy constitute such regulation.

        That’s all.

        No recommendation of police-state assignation of woman to man (or, for that matter, man to woman).

        No arbitrary dealing out of damsels to incels.

        Nothing scandalous (all innuendo and suggestive editing to the contrary)

        Just the plain, bare, common-sense facts: socially-enforced monogamous conventions decrease male violence. In addition (and not trivially) they also help provide mothers with comparatively reliable male partners, and increase the probability that stable, father-intact homes will exist for children.

        I find his “I’m not saying that” attitude a rather troll-like, and I wish more people would call him out on it.

        That said, I do agree with him that we should pat cats though, and that cleaning your room is probably a good idea, and that skateboarding is cool.

        1. 2

          I find his “I’m not saying that” attitude a rather troll-like, and I wish more people would call him out on it.

          JPs quote comes so close to being able to express the ways that social rules interact without passing judgement on them (as is essential to meaningful discussion of social change). Then, in the last paragraph he turns it around, stretching easily-defensible concepts into completely unsupported conjecture.

      2. 1

        Downvoted for “incorrect”. Either I’m not indeed reading those books, or people get emotional because of the author of a book I’m reading. Okay.

        1. 4

          I haven’t read anything by JP, nor have I listened to his lectures or his online content. I have skimmed the discussion around him however, and to me personally he sounds like a very unsympathetic character, with views that are very far from my own.

          Now, in an ideal world, one should perhaps separate the man from his works, and read his books in isolation from JP’s public utterances and views. And it’s possible that the contents of the book would be good and by following its precepts, people would change their lifestyle and be better people, for the good of all society[1].

          If JP were sincere in trying to reach as many people as possible, and thus make the world a better place, he would be happy to keep his toxic views to himself, to help more people feel comfortable in buying the book , and reading it in public.

          That is not the choice he has made, however. He has said and done things that would make me ashamed to be seen reading his book, and to avoid adding to his income by buying it.

          That said, I believe the downvote for “incorrect” is unneeded.

          [1] Yes, I’m purposefully comparing this book, which I haven’t read, with the great moral teachings of humanity, for the sake of a rhetorical argument.

          1. 2

            I’d find it hard to find the boundaries for that, beyond “what am i comfortable financially supporting?”. What’s the lowest moral level I’m willing to accept from the authors I read? Would I be willing to pardon people for being in a different zeitgeist (eg: being racist in nineteenth century America)?

            I think skimming the online discussion around any modern author would be enough to make us want to dismiss them entirely (particularly so if their field touches policy somehow — which is more and more likely to happen as more things get politicised). I think that says more about the kinds of discussions we have online than about the authors themselves.

            1. 3

              Each of us has a limited amount of attention to spend. Skimming online discussions is a semi-efficient way to prioritize.

              I’d like to expand the analogy to another example, closer to my usual reading interests. SF is my chosen non-fiction genre, and it’s very well-served by many authors. It can almost be seen as a fungible resource from a supply perspective.

              Some authors (for example, Orson Scott Card) have taken public political stances opposite my own. Now, I could spend the time to try to read Card’s works[1], despite me not agreeing with him personally, and perhaps I’d come to enjoy his works through their contents alone. But as it is, his political views have pushed his works far down the attention stack. It’s unlikely I’ll ever get around to reading him.

              I have read and enjoyed works by authors who I suspect are far from me politically (David Weber and Vernor Vinge come to mind). So it’s not an absolute criterion. Artistic merit comes into play! But from all reports JP is a pretty mediocre writer, so that’s another strike against him.

              [1] I tried reading Ender’s Shadow, it was pretty dire.

    15. 3

      satire, for better or worse, doesn’t appear to be the right tag for this. practices maybe?

      1. 1

        You know, I thought so too. Then I saw this post right before it https://blog.cleancoder.com/uncle-bob/2018/12/14/SJWJS.html

        1. 1

          Thanks for that link. That ranting about “SJWs” reminds me of ESR. Unsurprisingly no links or attributions for the (straw man) quotes, like this one:

          Then, sometime later, the software SJWs told us: “all the Agile/XP stuff (like pairing, TDD, etc) doesn’t seem to work for a heterogenous team” because: the Agile Manifesto was “developed by a bunch of white dudes”.

          Who is he even pretending to quote here?

          Regarding the manifesto,

          We, The Unoffended:

          • Are not offended by what you do, what you say, or who you are.

          Am I wrong if I read it like this?:

          You are not one of us if you are offended by what we say or do.

        2. 1

          Not satire.

    16. 4

      You can, but should you?

      1. 13

        It depends!

        For something like sum(), average(), max(), or the like, the answer’s an emphatic yes: despite doing “more” on the SQL server, you’ll actually consume less RAM (tracking a single datum of a sum/average/max/min, rather than building up a full response list) and send less over the network. That’s a definite win/win.

        For some of the other stuff in the article, the answer’s murkier. String operations in general, including the ones they’re mentioning (e.g. GROUP_CONCAT, which is specific to MySQL, but has equivalents in other databases) are fast in MySQL, but not necessarily in other databases. On the reverse side, some complex but amazingly useful queries (such as subselects) that are fast in SQLite and PostgreSQL are slow in MySQL, because MySQL’s design requires the generation of temporary tables (or at least still did as of roughly a year ago). PostgreSQL can likewise do some complex JSON ops server-side highly efficiently, and SQL Server can do similar stuff for XML, but I’m not sure I’d recommend doing that in, say, SQLite, even if you mechanically can (via extension methods), because it can defeat the query optimizer if not very carefully implemented.

        So: should you? Sometimes! Unfortunately, you need to learn your database to know the answer.

        1. 3

          Also, speed concerns aside, declarative languages are nice to read and write, as the author points out at the beginning of the article.

        2. 2

          String operations in particular seem to vary widely in how easy or hard they are between database engines. I remember being amazed at how few string functions MS SQL Server has - IIRC, substring and indexOf and that’s about it. Super clumsy to do anything but the most basic things. On the other hand, PostgreSQL has a full regexp find and replace engine and enough functions to do just about anything you could want.

      2. 4

        Another benefit is that you can put all your SQL code into stored procedures, and then the rest of your code can just call that functionality. Use multiple languages and it’s still all standardized in your stored procedures.

        1. 3

          Aren’t stores procedures a config management night mare? As in you distribute your business logic between code and and the db instance.

          1. 4

            I would argue that no business logic belongs in the stored procedures, but I’d further argue that making statements about your relations isn’t business logic. If you’re using a database as a source of truth, that’s basically all it should be worrying about: what is true about your domain, and what may be true about your domain (constraints).

            As for versioning- no, stored procedures aren’t a config management nightmare. It’s just that few organizations bothered to put any config management around them for decades. It’s not hard to implement versioned update scripts which roll the database schema forward or backwards. Honestly, it’s easier than some deployment solutions I’ve seen for application code.

        2. 2

          Dealing with a code base that uses the pattern of lots of logic in stored procedures being called by non-SQL code, this can go… too far. I am sad when I see stored procedures with multiple case clauses, calling other stored procedures, recursively calling themselves, making literal strings that are eval’d as other stored procedures and SO MANY CURSORS, and there’s no point in a test on the calling code because it doesn’t do anything.

          So… there are pros and cons.

          1. 2

            making literal strings that are eval’d as other stored procedures

            Other than that, it sounds perfectly sensible to me.

            there’s no point in a test on the calling code

            You could still test whether the functionality works or not, right?

      3. 2

        If there are going to be multiple consumers of the data, then it’s probably a good idea to make sure that the data as stored in the DBMS is correct under the definition of correctness you’re using. That can be a strong reason to pull much of the logic around the data into the DBMS itself. There are other concerns that pull in the opposite direction, of course, and perhaps you simply are using your database as a simple persistence layer. But if you expect ad-hoc reporting, for instance, or systems that depend on the data in the database being canonical, you are definitely a strong candidate for moving the logic into the DBMS.

      4. 1

        For small data that you are more frequently reading than writing (and you care about performance), you shouldn’t.

        Because then, it makes sense to cache it. Read everything once on a blue moon (whenever it changes) instead of doing many small reads in your fast path. Your own internal datastructures will easily outperform SQL: Simple lookups are the low-hanging fruit; then if you need the power of a relational database, I made a simple binary search based framework for left-joining tables of tuples in C++, and so can you.

    17. 2

      I hope they release a digital download version.

      1. 1

        Pretty soon:

        The free megawad will be released in mid- February 2019

    18. 7

      Our architecture: load balancer -> memcached -> memcached -> frontend server -> backend server

      insta classic

      1. 3

        That one about using Google Sheets as database on the backend server: It’s already been done, unironically.

    19. 4

      Haven’t read the entire piece yet, but I think the confusion arises from this: FSF started pushing free software as an ethical imperative, and later OSI started promoting this same model as a pragmatic community-oriented development model that results in higher quality software, which unfortunately causes people to conflate software licensing with development model, and thus assume that because Clojure is under a free license, it must then be open for community contributions.

      IMO the solution would be to talk more about the ethics of free software.

    20. 4

      While not podcasts as such, I like listening to Abelson and Sussman’s SICP, Harvey’s SICP[0] and Miller Puckette on Pd[0].

      I haven’t found any enjoyable techie podcasts, so I’m curious about what people will post in this thread. I have a dislike for shallow chit-chats about tech, and I often find uni lectures more rewarding. But Lunduke Hour is occasionally listenable.

      Favourite non-tech podcast:

      [0]: To get the YT lists as audio files do youtube-dl -f bestaudio $PODCAST_URL