1.  

    Very cool indeed, thank you for posting it.

    For people uncertain of where to go from the home page, may I recommend the Quick Tour? I was unfamiliar with (the Haskell? meaning of) sigils like :: or ++, so I couldn’t quite parse the twinPrimes example on the homepage; but the explained examples in the Quick Tour (including twinPrimes) are easier to follow.

    1. 4

      I’ve been able to solve most of this pain with regular old git and SourceTree’s “split view staging” where the staged/unstaged parts of the same file can be inspected separately. Changes that I’m still working on are unstaged, and when I think I’ve hit a minor milestone that doesn’t warrant a commit I drag them up to the “staged” area. This sets a checkpoint and if I make a mess, I can view only my subsequent changes in the “unstaged” area and revert them in isolation.

      1. 3

        Yeah, I do much the same thing, using hg commit --secret to create commits that serve as checkpoints. (“secret” means Mercurial won’t push them when I run hg push.)

        When I want to compare my current work in progress to some entirely other version of the file (also common), I create a copy in the working directory using hg cat -r 123 myfile.txt > 123.myfile.txt. Als always, Git has an (a) clumsier command that (b) does the same thing (emphasis on both parts): git show 1a2b3c:./myfile.txt > 1a2b3c.myfile.txt. (Using a hash here because Git doesn’t have local revision numbers.)

        Still, all these workarounds depend us on remembering to stage/commit or commit our edits at logical points. It’s a pity I don’t use Atom; but I’m really grateful to the author for their realisation, and I hope the tool will spread to other editors.

        1. 3

          That’s an interesting use of git staging. You can also do this in regular old git with git add, then git diff to show unstaged changes.

          1. 2

            I also rely on git. Sometimes just git commit -am asdfjkjl and later rebase/squash it all.

          1. 21

            In Neovim/Vim this is not hard at all:

            							*:ea* *:earlier*
            :earlier {count}	Go to older text state {count} times.
            :earlier {N}s		Go to older text state about {N} seconds before.
            :earlier {N}m		Go to older text state about {N} minutes before.
            :earlier {N}h		Go to older text state about {N} hours before.
            :earlier {N}d		Go to older text state about {N} days before.
            
            :earlier {N}f		Go to older text state {N} file writes before.
            			When changes were made since the last write
            			":earlier 1f" will revert the text to the state when
            			it was written.  Otherwise it will go to the write
            			before that.
            			When at the state of the first file write, or when
            			the file was not written, ":earlier 1f" will go to
            			before the first change.
            
            

            There is also a :later command.

            1. 9

              Yes, Vim’s :earlier/:later commands are nice; and so is Vim’s undo tree (especially with a graphical interface). But in both cases, you still have to flip back and forth between the historical version and your working code. Splitting the buffer doesn’t help, because :earlier affects all splits where that file (buffer) is open.

              The author’s Yestercode is a further improvement: it lets you pull up earlier states of your file next to the window where you’re editing it, so looking something up does not break the edit flow.

              1. 2

                This basically undo’s, so you won’t be able to use forward again when (accidentally) changing history. But yes, it is a nice feature, I use it as well!

                1. 4

                  Vim has branching undo though, so you can go back (forward?) to the original version, just not with :later.

              1. 4

                An interesting attempt to analyse the data by someone who has completely grabbed the wrong end of the stick.

                The age of citations is quite interesting. It definitely doesn’t reflect the velocity of cases through the system, but it might say something about memory of the aggregate legal profession.

                1. 2

                  the wrong end of the stick

                  What would be the correct end then?

                  1. 8

                    The end of the stick that doesn’t mistake ‘doing research-like actions’ for ‘doing research’, nor ‘graphs and statistics’ for ‘an understanding of the system’.

                    To quote xkcd: “Liberal-arts majors may be annoying sometimes, but there’s nothing more obnoxious than a physicist first encountering a new subject.” In this case, for physicist read ‘data scientist’. [edit 17:25 CET: use ‘data scientist’ instead of another phrase –SBB]

                    The dataset is incomplete in a very non-random way: it only includes transitive citations of Supreme Court decisions. Nowhere does the author betray any signs of realising that this affects the statistics, and therefore the conclusions they so confidently draw about, say, average duration of a judicial procedure.

                    I don’t have the time for a full fisking, so I’ll only address the most important idiocy:

                    The writer says “somewhere between 33% and 50% of all cases are completely trivial and could be easily automated away”. They base that only, I kid you not, only on seeing that somewhere between 33% and 50% of the judgements they gathered cite only one previous case or judgement.

                    No, the author doesn’t discuss how to recognise those supposedly trivial cases; nor whether the right to appeal can even be fulfilled by an automated system; and nowhere do they wonder whether ‘the judgement cites only one case’ is, in fact, a reliable sign that a case was trivial.

                    You have to understand the system you’re talking about! Even if you’re a data scientist! Especially if you’re a data scientist!

                  2. 1

                    I’d also like to hear more about the correct end of the stick from @Student .

                    I’m not a data engineer at all, could you describe what you consider a better approach?

                    1. 6

                      For starters, citations don’t mean what you think they mean. Cases are cited because they are a source of law under discussion.

                      You need to actually work with a domain expert to understand what the data mean.

                  1. 1

                    Dual nature, surely? Commits are stored as snapshots; they can act as snapshots (“please checkout version 123 of file X”); and they can act as diffs (“please rebase [the changes I made in] commit 123 onto commit 125”).

                    There’s more terms in Git that have a dual nature. For example ‘branch B’ can mean both all four of “the branch pointer B”, “the commit that B currently points at”, “that commit and all its ancestors”, or “all commits that are only ancestors of B, and are not also ancestors of another branch pointer.”

                    1. 33

                      Great story, but why do so many people think it’s a good idea to write entire articles on Twitter? It’s even worse than publishing them on Medium, and that says a lot!

                        1. 16

                          Because that’s where the readers are. (Same reason Willie Sutton robbed banks.)

                          I hate Twitter so, so much, and that’s one of the reasons. Even with the new supersize 280-char limit, it’s still such a choked, impoverished writing medium. Constraints can be good, but when they’re a choice, not when you’re forced into the constraint because it’s baked into the only platform that meets your needs.

                          1. 12

                            Writing is also pretty easy too for them. Each thought can be composed piecemeal and worked into a larger thread. It’s compatible with shorter attention spans for /writing/.

                            Maintaining a blog is ceremony/effort if you’re not actively committed to it. The next lowest effort/easiest distribution is Medium, and we all know what we think of that.

                            Constraints can be good, but when they’re a choice, not when you’re forced into the constraint because it’s baked into the only platform that meets your needs.

                            Many constraints were because of forced limitations. That was the post of many of them.

                            1. 3

                              Yeah, you’re right about forced constraints. I guess it’s that any one constraint is good for some things but bad for others. Twitter has been a great boon to standup comedians and haiku poets, I’m sure.

                              WordPress.com is pretty low-effort; it has issues but not so much as Medium. If it or something like it were more popular, people could write their tweet-threads there. Unless, as you say, they’re ADD enough that they’d get blank-page fright and never write anything.

                              (I’m trying hard not to start bemoaning the demise of LiveJournal again. It coulda been a contendah…)

                              1. 12

                                Another thing that might be interesting is that people can reply to the indivual atomic units of thought easily too. It’s really more like structured/permament IRC than it is a blog.

                                And yes, from the people who DO write mega tweet storms tell me, blank page fright is huge.

                                1. 9

                                  WordPress.com is pretty low-effort; it has issues but not so much as Medium. If it or something like it were more popular, people could write their tweet-threads there. Unless, as you say, they’re ADD enough that they’d get blank-page fright and never write anything.

                                  I don’t know; I suspect it’s more of a barrier-of-entry thing. Twitter is kind of ephemeral and “write and forget”, whereas writing on your personal WordPress site takes more effort, as it’s less ephemeral.

                                  The same with comments on e.g. Lobsters: I usually just write them, read over them a little bit, and post. Whereas on my website I tend to take a lot longer to write more or less the same stuff. If something’s on my website, I want to make sure it’s reasonably accurate, comprehensive, and written as well as I can. Usually this entire process takes up quite a lot of time for me. For some Lobster comment or Twitter remark, it’s a bit different.

                                  It’s really difficult to put my feelings on this in words; so I hope this makes sense 😅 But publishing something on my (or any) website just comes with a lot higher barrier of entry for me, and I’m probably not so special that I’m the only one.

                                  @calvin mentioned “blank page fright”; which is more or less the same thing in a way, just expressed different, I think(?)


                                  At any rate, Twitter is hardly my favourite platform for these kind of things, but if the choice is between “it would never be published at all” and “it’s published on a platform I don’t like”, then the second option is clearly the better one.

                              2. 4

                                Because that’s where the readers are.

                                Then Tweet a link.

                                Might be a great story, but I’m not reading it in 20 parts on Twitter.

                                1. 4

                                  And many people will not click a link.

                                  1. 2

                                    Plus clearly many, many people are. Writers go where readers are, and though you may not like reading things in this way on Twitter, there are enough people who do to make a market for this sort of material.

                                  2. 1

                                    The choked, impoverished writing medium is what makes it so much fun!

                                  3. 11

                                    For some people this is the answer.

                                    It’s easier to just write a set of tweets. When you publish a wall of text you gotta format it, you feel like proof-reading, etc.

                                    A tweetstorm is like…. whatever, just get it out there. Hell, type it in drafts and it’ll post the tweetstorm for you.

                                    This is like instagram stories: A way to reduce the barrier to sharing content. And some stuff is low effort, but some stuff is just high quality. It’s also, like other said, a way to share to people who are following you.

                                    1. 2

                                      you gotta format it, you feel like proof-reading, etc.

                                      I think there might be a reason why people do this.

                                      Ironically, this ‘article’ is more of a ‘wall of text’ than most blog posts, in that it’s just a collection of ‘text bricks’ stacked on top of each other, with no real structure. As a result, it’s practically unreadable.

                                      1. -1

                                        Thanks for pointing this tweet out, but I don’t buy that for a minute. If you have so much ADHD that you can’t do it any other way, you could still tweet your story and then copy-paste the sentences into a blog post. No one could be that debilitated by ADHD that he wouldn’t be able to do this basic thing.

                                        Also, a blog post is written once and read many times (ideally). It’s disrespectful to your readers to force this horrible format on them. If I were in this situation, I’d ask a friend to help me format a “tweetstorm” into a nice blog article. Even long texts wouldn’t take that much time.

                                        1. 11

                                          Uh, hey maybe don’t make comments that people with ADHD could do something when the evidence and statements of actual people with ADHD say they can’t. One of the key experiences of ADHD is executive dysfunction, meaning mental challenges around planning, problem-solving, organization, and time management. People with executive dysfunction (which isn’t solely experienced by people with ADHD) describe it in a number of ways that can be illuminating:

                                          Mental differences like this aren’t something you push through. Maybe sometimes you can (people with disabilities often describe experiencing fluidity in the severity of their challenges), but maybe sometimes you can’t. The experience of others demanding that they push through, or judging them for failing to push through, is one of the main challenges faced by disabled people. If you spend time listening to disability advocates, you’ll hear them talk about how they’re not disabled because something is wrong with them, they’re disabled because of limitations in the systems we all operate within, and the expectations and demands of our collective culture.

                                          So please, don’t toss out comments about how disabled people ought to function. They’re doing their best, and the expectations you’re putting out there are a core part of the challenges they face.

                                          1. 1

                                            Did you even read my comment before pasting your pasta here? Even disabled people ought to be able to ask for help, and in this case, I see no reason why someone with ADHD and executive dysfunction shouldn’t be able to ask someone for help in this regard.

                                            1. 6

                                              I did read your comment.

                                              I’m also flattered you think my post is a copypasta.

                                              Seems unlikely you’ll be convinced, but to hammer it home: saying “disabled people ought to be able” or even “disabled people ought,” is the problem. If you do not have executive dysfunction, you do not know what it’s like to live with, and should defer to people who do live with it when they talk about what is reasonably doable for them.

                                              1. 3

                                                I’m also flattered you think my post is a copypasta.

                                                Not taking sides here, but just wanna say, that is the best kind of rhetoric.

                                              2. 6

                                                Let me describe how I post on Lobsters. First, I think about what I want to post. Then, usually I don’t post it.

                                                If I do decide to post, then I commit myself to keeping a browser tab open for about half an hour while I write my post. I try to get my evidence lined up, opening additional tabs with each consideratum so that I won’t forget what I’m writing about.

                                                Paragraphs are usually written out of order. Entire sentences are written, rewritten, discarded, and written again. Phrases become semantically satiated and read wrong in my mind. I worry that I have used too many words. I worry that I haven’t used enough.

                                                I constantly feel disconnected from myself and also from my audience. I don’t understand how to relate to people, or how to ensure that my meanings are preserved. In fact, I am used to being horribly and hilariously misinterpreted.

                                                The help that I would ask from you is for you to reread the parent post and reconsider your stance. There is no universal way in which humans are supposed to interact with computers.

                                                Alternatively, take a programmer’s point of view: A module is not merely a collection of code snippets, and it is disingenuous to suggest that folks can simply collate code snippets into meaningful modules.

                                            2. 7

                                              Also, a blog post is written once and read many times (ideally). It’s disrespectful to your readers to force this horrible format on them. If I were in this situation, I’d ask a friend to help me format a “tweetstorm” into a nice blog article. Even long texts wouldn’t take that much time.

                                              But you’re not in this situation.

                                              1. 4

                                                You may not realise it, but this is what your post looks like from the outside:

                                                • You’re mistaking your personal dislike for a universal dislike.
                                                • You’re laying your personal preferences on other people as responsibilities.
                                                • You’re presuming you know what other people can or can’t do, or how they should or shouldn’t spend their energy and friend-favours.

                                                That is not how you reason your way to correct conclusions, and it is not how you win friends and influence people.

                                            3. 8

                                              No constraints, no glory!

                                              But really the real reason is that I put weeks of research and editing into my blog posts, in some case months… while I can hammer a tweetstorm out in five minutes.

                                              1. 4

                                                As much as I hate Twitter ‘articles’, I think they’re actually better than Medium articles, which is… impressive.

                                                1. 1

                                                  Agreed. This would be a pretty lengthy blog post, and this format is just awful. Really good war story though.

                                                1. 1

                                                  For the first task with “undeleting” files using Git you can go even shorter:

                                                  git ls-files -d -z | xargs -0 git checkout --
                                                  
                                                  1. 4

                                                    I would offer hg revert "set:deleted()", but then there’s no pipeline left…

                                                    1. 3

                                                      That’s a shell-golf hole in one!

                                                  1. 5

                                                    Yes, I work the same way, it helps me manage my ADHD.

                                                    Things that help me solve problems without needing to go online:

                                                    • As you say, keep offline copies of as many online documentation and other references as possible.
                                                    • I have a wget alias mirror to download a website for local viewing.
                                                    • Sometimes offline copies of webpages stay blank for 10 seconds because (a) they try to get Javascript from Google Analytics or some webfont server or Facebook or whatever, which (b) won’t succeed because you’re offline, but (c) it takes 10 seconds before the request times out. Solution: add entries to your /etc/hosts like 0.0.0.0 google-analytics.com www.google-analytics.com, so the request will fail quickly with ‘no route to host’. Bonus: this speeds up online surfing, too.
                                                    • Keep local copies, or even clones, of the source code of the libraries I interact with most. This allows you to solve questions the docs don’t answer.
                                                      • for interpreted languages like Python, the source is already present, so I bookmark the/a directory containing the source code.
                                                    • For command-line tools:
                                                      • Debianlikes default to not installing package documentation, but you can. The docs package for xxx is usually called xxx-doc, so run apt-get install xxx xxx-doc instead of only installing xxx.
                                                      • get comfortable with locate (find file anywhere in filesystem), find (find file under current folder), grep/rg (find files containing text, and less (displays files, including man manual pages).
                                                      • to make it easy to search inside man pages (usually rendered with less): keep a copy of this less cheat sheet

                                                    Things that help me look things up as little as possible: emprace the exobrain.

                                                    • I keep a ~/snippets directory for reusable snippets, rather than looking each one up in its own source.
                                                    • I keep a ~/sietselog file for reusable answers, rather than troubleshooting each time. When I have to solve something, I write the question there; when I’ve found the solution, I add the answer there; when I remember solving this problem before, I search that file.
                                                    • Any command invocation I find hard to remember (or even just annoying to repeat) gets a wrapper script in my ~/bin. Often the mere fact that I named the wrapper myself makes it easier to use and remember. Also, projects have to worry about unique and searchable names; but me, I have no qualms about about naming my Silicon wrapper code2png.
                                                    • Python-specific:
                                                      • import pdb; pdb.pm() starts a post-mortem debugger. When you get an error in an interactive session (such as a Jupyter notebook), this will jump to the scene of the error, let you inspect local variables, and let you walk up and down the stack. Ofter quicker than searching for others who got the same error message. pdb command reference. NB: ipdb and pudb are even better debuggers.
                                                    1. 2

                                                      The article doesn’t go into much depth, but it does focus on practical applications of computing, i.e. using IT to solve non-IT problems; I found that refreshing.

                                                      I had some trouble finding background links, but here’s one: the academic paper An Expert System for Raising Pigs.

                                                      1. 1

                                                        My compliments on your writing! I can’t judge it from a newcomer’s perspective, alas: I’ve been obsessively working through Ivan Bratko’s “Prolog Programming for Artificial Intelligence”, so I’ve had a lot of recent Prolog exposure, so I suspect my learning zone is perfectly situated to receive the post you wrote. But even if receptiveness is one thing, teaching is quite another, and I can say: (a) that PPfAI is a book that practically teaches itself, and (b) that your blog post gave me the same delicious “the author is installing new knowledge in my brain” feeling. Which I presumably owe to damn hard writing on your part. Enjoyable, and learnsome, and I look forward to the rest of it.

                                                        1. 1

                                                          Whoa, I just realised I can user-define this (albeit with less elegant syntax) in the Mercurial formatting language by adding this to my .hgrc:

                                                          [templatelalias]
                                                          # Example usage: hg log -r . -T 'text{maybe("bookmark", " >>", bookmarks, "<<")} more text'
                                                          maybe(mylabel, prefix, main, suffix) = '\
                                                              {ifeq(main, "", "", label(mylabel, prefix))}\
                                                              {label(mylabel, main)}\
                                                              {ifeq(main, "", "", label(mylabel, suffix))}'
                                                          
                                                          1. 5

                                                            My handwriting is absolutely the product of years of hand-written math note-taking since college. Notice the blackboard-bold and calligraphic fonts, which are also very common. Some of my own thoughts / habits:

                                                            • I can’t for the life of me write ζ or ξ. Many professors share this deficiency, making chalkboard lectures on complex analysis quite difficult to follow. Recently, I have been using the Japanese る and そ in their place, and no one even notices!

                                                            • For the purposes of communicating with others, I am overzealous with parentheses. I’d rather have them and not need them than need them but not have them. I also use whitespace quite frequently to group different parts of a longer expression.

                                                            • I never use the prime (’) symbol. Some authors use x’ (read “x prime”) to indicate a quantity which is conceptually similar to x, but I prefer to use numbers (x_0, x_1, x_2, …) or well-known letter groupings like (x,y,z) or (p,q) or (f,g) or (α, β) or (\phi, \varphi). I avoid using prime for differentiation as well, preferring the notation ∇_x f or D_x [ f ].

                                                            • Redundancy is good, and helps catch mistakes. Ideally, it should be possible to understand the gist of my proofs even if all the mathematical expressions are deleted.

                                                            • “Put a hook on the x to distinguish it from a times sign.” – not really needed

                                                            • “Put a loop on the q, to avoid confusion with 9”. – also unnecessary, since mathematicians use exclusively the digits 0, 1, 2 !

                                                            • The number two shouldn’t be written with a curl, otherwise it’s easily confused with δ or α. As long as the letter Z is crossed, there should be no ambiguity.

                                                            1. 5

                                                              Redundancy is good, and helps catch mistakes. Ideally, it should be possible to understand the gist of my proofs even if all the mathematical expressions are deleted.

                                                              Coming from a different background (implementing cryptography), I agree with this but for another reason: Readers of papers may not even have enough mathematical background to discern the notation because they come up from (possibly hobbyist) programming, rather than down from math. Therefore, having redundancy not only helps you catch mistakes, but also helps familiarize people with notation they’ve never seen before.

                                                              1. 4

                                                                Yes, absolutely! I”ve once spent two days debugging a point multiplication on an elliptic curve because x / 2 on an integer did not mean a division by two (bit shift) but rather the multiplication of the group inverse of 2. This was a really frustrating error although the solution to it proved to be quite gratifying.

                                                              2. 3

                                                                Could you post a direct link to the image? My browser is unable to render the Imgur web page.

                                                                1. 2
                                                                  1. 2

                                                                    thanks

                                                              1. 1

                                                                Doesn’t groovy formatting work the same way? I remember something along those lines when using Filebot title formatting.

                                                                1. 1

                                                                  Apparently?!! It seems Groovy placeholders are formed from an expression inside braces; and the expression can look like {title} but also like {"$title"} or {"this is the $title"}; and if the value title is undefined the entire placeholder {...} evaluates to the empty string. Which in the last example means the prefix “this is the “ also gets suppressed.

                                                                  I’m not sure the Groovy devs themselves are aware that you can use this to get prefix-only-if-value-is-defined behaviour … the docs don’t mention it! But Okam from 2012 figured it out, and wrote it in the only post they ever made on the Filebot forum. I can’t say we’re lucky to have Google, but we’re lucky to have search engines.

                                                                1. 1

                                                                  Installation page seems to have a dead link to http://bitbucket.org/sjl/hg-prompt/

                                                                  Does it play nice with evolve?

                                                                  It’s just dying messily with…

                                                                  hg prompt 'test'
                                                                  Traceback (most recent call last):
                                                                    File "/usr/lib/python3/dist-packages/mercurial/extensions.py", line 251, in _runuisetup
                                                                      uisetup(ui)
                                                                    File "/usr/lib/python3/dist-packages/hgext3rd/evolve/exthelper.py", line 149, in finaluisetup
                                                                      c(ui)
                                                                    File "/usr/lib/python3/dist-packages/hgext3rd/evolve/__init__.py", line 1278, in _setuphelp
                                                                      help.helptable.sort()
                                                                  TypeError: '<' not supported between instances of 'str' and 'bytes'
                                                                  *** failed to set up extension evolve: '<' not supported between instances of 'str' and 'bytes'
                                                                  ** Unknown exception encountered with possibly-broken third-party extension prompt
                                                                  ** which supports versions unknown of Mercurial.
                                                                  ** Please disable prompt and try your action again.
                                                                  ** If that fixes the bug please report it to the extension author.
                                                                  ** Python 3.6.9 (default, Oct  8 2020, 12:12:24) [GCC 8.4.0]
                                                                  ** Mercurial Distributed SCM (version 5.5.2)
                                                                  ** Extensions loaded: graphlog, strip, mq, extdiff, rebase, convert, purge, eol, churn, hgk, record, prompt
                                                                  Traceback (most recent call last):
                                                                    File "/usr/bin/hg", line 43, in <module>
                                                                      dispatch.run()
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 113, in run
                                                                      status = dispatch(req)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 303, in dispatch
                                                                      ret = _runcatch(req) or 0
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 479, in _runcatch
                                                                      return _callcatch(ui, _runcatchfunc)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 488, in _callcatch
                                                                      return scmutil.callcatch(ui, func)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/scmutil.py", line 152, in callcatch
                                                                      return func()
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 469, in _runcatchfunc
                                                                      return _dispatch(req)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1233, in _dispatch
                                                                      lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 917, in runcommand
                                                                      ret = _runcommand(ui, options, cmd, d)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1244, in _runcommand
                                                                      return cmdfunc()
                                                                    File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1230, in <lambda>
                                                                      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1867, in check
                                                                      return func(*args, **kwargs)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1867, in check
                                                                      return func(*args, **kwargs)
                                                                    File "/usr/lib/python3/dist-packages/hgext/mq.py", line 4226, in mqcommand
                                                                      return orig(ui, repo, *args, **kwargs)
                                                                    File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1867, in check
                                                                      return func(*args, **kwargs)
                                                                    File "/home/johnc/builds/hg-prompt/prompt.py", line 410, in prompt
                                                                      fs = re.sub(tag_start + tag + tag_end, repl, fs)
                                                                    File "/usr/lib/python3.6/re.py", line 191, in sub
                                                                      return _compile(pattern, flags).sub(repl, string, count)
                                                                  TypeError: cannot use a string pattern on a bytes-like object
                                                                  
                                                                  1. 2

                                                                    If you run Mercurial with Python 2, you won’t get this error. The error arises because (a) ‘…’ meant/means a bytes array in Python 2, (b) ‘…’ means an array of unicode code points in Python 3, and (c) hg-prompt dates from Mercurial’s Python 2 days. If the subject interests you, I can recommend this blog post that reflects on Mercurial’s 2-to-3 transition.

                                                                    The Python 3 fix would involve turning nearly every '...' string into a b'...' string (easy-ish). If you want to fix it for yourself,, that’s all. If you want to submit the patch upstream, you’d probably need to set up a testing harness to make sure it works in both 2 and 3 (not so easy). I see a two recent commits ([1], [2]) on this subject, so the interest is probably there.

                                                                    Hg-prompt plays nicely with evolve in the sense that it doesn’t crash, and treats hidden revs the same as non-hidden. It does not yet have keywords for topic-related info. I’ve got a draft patch for that, but I haven’t submitted it upstream yet. It defines keywords {topic} (the active topic), {revtopic|idx} (the changeset’s topic|stack number s0, s1, … even if another topic is active) and {stackidx} (stack id s0, s1, …, for the active topic’s stack).

                                                                  1. 1

                                                                    Installation page seems to have a dead link to http://bitbucket.org/sjl/hg-prompt/

                                                                    1. 1

                                                                      Yep, that’s https://hg.stevelosh.com/hg-prompt/ nowadays, since Bitbucket dropped Mercurial support.

                                                                    1. 26

                                                                      I’m sure I’ll be shouted down at the press club for this stance, but I think the solution to this sort of thing is just going to have to be an adjustment in how society treats naked photos. The amount of totalitarian infrastructure required to keep creepy fuckers from running this sort of software on images of their friends, colleagues, and celebrities is unconscionable.

                                                                      1. 7

                                                                        I understand where you’re coming from, but I don’t see it happening. Also there’s a difference between nudity and sex, and this is very much about sexualisation, not just nudity. See this subreddit for an idea of where this is going.

                                                                        1. 6

                                                                          going to have to be an adjustment in how society treats naked photos

                                                                          I agree there - but this isn’t “naked photos” as such, really. It’s non-consensual naked photos of people created from entirely non-naked photos and I don’t know how you get across to people that this isn’t ok regardless of how society treats nudity.

                                                                          1. 14

                                                                            It’s non-consensual naked photos

                                                                            It’s not naked photos though. It’s painting on top of fully clothed photos. Photoshop has long existed. This technology only decreases the cost.

                                                                            1. 5

                                                                              Australia’s Sex Discrimination Act 1984 defines sexual harassment as (emphasis mine):

                                                                              “… a person sexually harasses another person (the person harassed ) if: (a) the person makes an unwelcome sexual advance, or an unwelcome request for sexual favours, to the person harassed; or (b) engages in other unwelcome conduct of a sexual nature in relation to the person harassed; in circumstances in which a reasonable person, having regard to all the circumstances, would have anticipated the possibility that the person harassed would be offended, humiliated or intimidated.”

                                                                              I’d say telling an unwilling somebody “I photoshopped nude photographs of you” meets clause (b) in itself – you don’t even have to make the pictures. If you do make the photoshop/deepfake/painting/crude drawing, that’s not going to help your case.

                                                                              Also, the photographs don’t have seem real to constitute harrassment. Photoshopping your fellow (male) crew member’s face onto a pornographic image and then printing that on a mug will get you sacked after 15 years as a Royal National Lifeboat Institute volunteer.

                                                                              Or you could fall back on philosophy: Is it true? Is it kind? Is it necessary? (Sorry, can’t find out with certainty who said this.)

                                                                              Or other ethics: “who does it help? who does it harm? Is the benefit necessary? Is the harm necessary? Are the harm and the benefit in proportion?”

                                                                              1. 3

                                                                                Australia’s sex discrimination act has no bearing on my ethical outlook of the world.

                                                                                Is it true? Is it kind? Is it necessary?

                                                                                If it happened then it’s true, by definition.

                                                                                If it didn’t happen then you shouldn’t complain about it.

                                                                                Or other ethics

                                                                                You have to pick one. You can’t just pick whatever ethical position is convenient for you right now to defeat a particular argument you are up against.

                                                                                1. 2

                                                                                  Is it true? Is it kind? Is it necessary?

                                                                                  If it happened then it’s true, by definition. If it didn’t happen then you shouldn’t complain about it.

                                                                                  Interesting that you didn’t engage with the other questions. You seem to be selectively arguing here to things that you can defend against.

                                                                                  Or other ethics

                                                                                  You have to pick one. You can’t just pick whatever ethical position is convenient for you right now to defeat a particular argument you are up against.

                                                                                  I thought you were a libertarian? They were just asking a series of questions framed by different ethical views to you, most likely they were interested in your response. As are we all.

                                                                                  Right now, the impression I get from your responses in this thread is something along the lines of:

                                                                                  as a libertarian i dont want your society if i can’t deepfake my neighbor’s nudes and masturbate to it and maybe sell it idk while keeping the legal high ground

                                                                                  Would you care to change that impression?

                                                                                  As an individualist, we are all individuals, so therefore you must think there is no such thing as consent, because that requires cooperation, which cannot exist under an individual model. This is in line with your arguments in this thread. You ignore the consent and violation aspect, and prefer to create edge-cases that suit your point of view that, as an individual, you should be allowed to do what you want with no regard for other people.

                                                                                  Where does this philosophy end? If I repeatedly flick your nose, is that ok? After all, we are both individuals and I am free to do what I want. What would you do in retaliation if I used my right as an individual to ignore you? Hit me? Escalate the violence?

                                                                                  If I spread your posts in this thread around to the rest of the internet, traced down your alias by using your posts and the account tree, and showed your family and friends your response (Which is not something I am going to do, this is a hypothetical), would that be ok for me to do? Under your individualist philosophy? How would you choose to retaliate, as an individual? How can you retaliate against that?

                                                                                  It seems to me, the individualist philosophy seems to end in an escalating war of individuals, rather than any coherent societal philosophy.

                                                                                  If you bother to reply to this, which I cannot actually see you doing, I would like you to respond to each of my arguments. Not just a cherry-picked selection like you have above. Thank you.

                                                                                  1. 2

                                                                                    Interesting that you didn’t engage with the other questions. You seem to be selectively arguing here to things that you can defend against.

                                                                                    Which question did I not engage with? The part about somebody being sacked falls under the same grouping as the australian law argument and I would respond with the same argument: that people’s action and/or a country’s legal system do not and should not define what is moral.

                                                                                    Would you care to change that impression?

                                                                                    Sure. My stance is that any restriction on people’s freedom is inherently immoral.

                                                                                    Is it immoral for a person to imagine her neighbour naked?

                                                                                    As an individualist, we are all individuals, so therefore you must think there is no such thing as consent, because that requires cooperation, which cannot exist under an individual model.

                                                                                    non-sequitur. Individuals often benefit, mutually so, by cooperation.

                                                                                    The rest of your post follows from this foundation, and thus would not need to be responded to furthur.

                                                                              2. 4

                                                                                Creating a naked image of a normal person without their consent is a violation of boundaries and consent

                                                                                1. 3

                                                                                  Even if it is on one’s own computer? In one’s own mind eye?

                                                                                  I don’t wish to live on a world with such a view.

                                                                                  1. 2

                                                                                    What if you were to create an image of a naked humanoid robot with facial similarity to a normal person?

                                                                                2. 4

                                                                                  I’m not trying to say it’s OK, I’m trying to say it’s not going away. We need societal changes to reduce the harms of it.

                                                                              1. 2

                                                                                xml2 and 2xml. Converts XML to a flat file-path like structure, with the other application doing the reverse.

                                                                                This is the key application that allowed me to unlock a CLI-like pipeline for working with EagleCAD’s xml markup from the shell.

                                                                                Docs are incredibly sparse though. The best resources I’ve founed aside for personally playing around with it follow:

                                                                                1. 1

                                                                                  Oh, this is wonderful. Much appreciated!

                                                                                1. 16

                                                                                  Gron! It transforms JSON into greppable lines like path.to.items[3] = value, and if you like you can edit the result and use gron to transform the edited stuff back to JSON. This brings JSON structures into the line-oriented sed/grep/awk universe – I’m looking at you, Jupyter notebooks. I’ve only had gron for a few months, and it’s already my 13th-most-used command.

                                                                                  Example output (gron can read from stdin, files, and even URLs):

                                                                                  ▶ gron testdata/two.json 
                                                                                  json = {};
                                                                                  json.contact = {};
                                                                                  json.contact.email = "mail@tomnomnom.com";
                                                                                  json.contact.twitter = "@TomNomNom";
                                                                                  json.github = "https://github.com/tomnomnom/";
                                                                                  json.likes = [];
                                                                                  json.likes[0] = "code";
                                                                                  json.likes[1] = "cheese";
                                                                                  json.likes[2] = "meat";
                                                                                  json.name = "Tom";```
                                                                                  
                                                                                  1. 2

                                                                                    Thanks for mentioning this! I had no idea this existed, but is definitely in line with how my brain works vs jq. Even though I use jq almost daily, I can never remember some of the syntax.

                                                                                    1. 4

                                                                                      I created an alias for jq, called jqpath, that leverages fzf to give searchable output similar to gron, but that emits it in jq’s expected format: https://twitter.com/tednaleid/status/1302477635914739713

                                                                                      1. 1

                                                                                        Oh wow, I just noticed @mrcruz’s recommendation of xml2, elsewhere on this page, which does something similar for HTML and XML. Although for HTML I had hoped it would include element classes and IDs in the path — .../div/div/... is not useless, but .../div.comment#c_tez5vc/div.details/... would have provided more orientation points. Still, this is going in my toolbox; and I thought you might like it, too.

                                                                                        Part of the output of curl https://lobste.rs/s/eprvjp/what_are_your_favorite_non_standard_cli | html2:

                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/@href=/u/loc
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/img/@srcset=/avatars/loc-16.png 1x, /avatars/loc-32.png 2x
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/img/@class=avatar
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/img/@alt=loc avatar
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/img/@src=/avatars/loc-16.png
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/img/@width=16
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/img/@height=16
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/@href=/u/loc
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/@class
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a=loc
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/span/@title=2020-10-22 17:16:17 -0500
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/span=2 days ago
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= | 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a/@href=/s/eprvjp/what_are_your_favorite_non_standard_cli#c_tez5vc
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/a=link
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/span/@class=flagger flagger_stub
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/span/@class=reason
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/span= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/@class=comment_text
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/p=Thanks for mentioning this! I had no idea this existed, but is definitely in line with how my brain works vs 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/p/code=jq
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/p=. Even though I use 
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/p/code=jq
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div/p= almost daily, I can never remember some of the syntax.
                                                                                        /html/body/div/div/ol/li/ol/li/div/div/div= 
                                                                                        
                                                                                        
                                                                                    1. 1

                                                                                      I bounced over to Wikipedia, and no, it doesn’t make change ringing any easier to understand.

                                                                                      1. 1

                                                                                        Amen. It’s a very jargon-heavy fields; some of the jargon describes a place (whichever bell is in it), and some describes a bell (whichever place it is in); some jargon describes what a single bell does, some of it describes how an entire row changes; and some of it describes a pattern across multiple rows; and some of it describes repetitions/transitions of that pattern.

                                                                                        I think it’s actually hard to understand in a similar way that it is hard to understand how computers work: being simultaneously aware of what is happening at multiple levels of abstraction is difficult, and it’s doubly difficult when you don’t know *any* of the levels yet..

                                                                                        Perhaps it gets easier once your brain has practiced so much that it can recognise patterns at each of those levels? I wouldn’t know, I haven’t got that far.