1. 7

    Yeah! I had a very similar idea, only I did it in bash: https://github.com/mikemccracken/hs

    I’ll have to look for some good ideas to steal. I guess better tab completion would probably be nice, but maybe that’s just what I get for using bash. Mine does tab-complete script names…

    One difference is that mine keeps your snippets in a git repo, stores execution times and return codes as git notes, and auto-commits any edits - so you can try to keep snippets in sync across machines.

    1. 4

      I’ve seen linters that raise warnings about cyclomatic complexity in individual functions, and sometimes it seems worthwhile but I’m not convinced.

      One measure of complexity I’d like to see is on average, how many different files I need to look at to understand what a given line is doing. I’ve read some Golang code that makes pretty heavy use of interfaces that feels like it’d rate highly on that, and (because of loose typing) a lot of Python code takes tracing through many files to understand what an object actually could be - can it be None? is it always one type? Better check all the callsites…

      1. 1

        I have seen those too and I think cyclomatic complexity is a bad measure for standard linters.

        The reason is that I have seen more than one example where it has been used to increase complexity (in the way of making it harder to reason what it does). You have some switch statement for mapping some valued where it’s clear and obvious what’s going on. But your cyclomatic complexity check of course hates that switch statements.

        The problem here is not the check itself. It makes sense. The problem is that it’s not an exact measure for CCL and there is for example the mentioned case where it’s obviously wrong for measuring CCL. It very much stands out for that type of code.

        However once you make exceptions it leads to another problem. Early in my career we started to use liners to clear up some messes. So we each took a project with the goal of applying style and linting changes so we could better reason about stuff. We finished. We both had all checks pass. Only days later I realized that one fixed then by simply changing all the settings to fit the code, not vice versa.

        What I wanna say is that linting where warnings are sometimes okay lead to problems creeping in very quickly, because these warnings will be silenced and then they change from a very useful tool to more of a burden because you cannot be sure if you really don’t have that kind of code/problem anywhere.

      1. 1

        Company: Cisco Systems

        Company site: cisco.com

        Position(s): Senior Software Engineer (roughly 5-7 yrs experience)

        Location: ONSITE San Jose, CA (WFH for now) or REMOTE in US time zones.

        Description: Join a team that builds linux cluster platforms for datacenter networking products. We actively work on every level from the kernel to container infrastructure and building services on kubernetes. Our work is the base for multiple shipping Cisco products and the list is growing. For an example, see the recently announced Cisco Nexus Dashboard Platform.

        We are looking for capable generalists with experience in microservices, kubernetes and related tech - the top end of our stack. Ideally we want people who take pride in shipping, and shipping quality.

        Familiarity with software-defined networking concepts is a plus but not strictly necessary.

        Tech stack: linux, go, kubernetes, lxc, shell, python, etc.

        Contact: DM me here.

        1. 1

          I have used a lot of things for notes, including years with org-mode, but recently I’ve settled on Bear.app, it supports a subset of markdown (they’re working on a more featureful editor), and syncs well with my iPhone.

          Usable Mobile syncing was the main reason I moved from org-mode to Bear + Things. I still really miss the ability to intermix notes and TODOs in org, and despite how daunting it could be to get a good org agenda config, nothing else is as powerful.

          1. 2

            A programmatic diagram / graphic builder, like Processing that also lets you edit the diagram with a mouse, like OmniGraffle, and the source updates as you do.

            I’ve had to draw diagrams with lots of repeating pieces in omnigraffle, which gets tedious to edit if you need to make a change that isn’t just a property change. It should be a function that can be repeated in any location, and then updates live everywhere when I change it. And of course most editors aren’t nearly as great at helping you select things - I miss being able to select e.g. all dotted lines, when I’m not in omnigraffle.

            In the other direction, drawing lines between boxes, and making selections are much better with a mouse.

            While there’s lots of examples of graphics languages, there are clearly some interesting issues about how to translate common mouse operations through into source. I’d like to dig into it, but really I just want to use it - I came up with the idea because I want to make more better diagrams about the things I’m actually working on.

            1. 2

              I just use Google Photos and pay for a storage plan there.

              I have tried so many other methods. I’ve written a bunch of software, set up a home NAS, used Picturelife backed with a personal S3 bucket, experimented with git-annex…

              Life’s too short to be worried about how hot my NAS is getting, or trying to convince family members to conform to a process dictated by some script I wrote.

              My family all has Apple products so I’d probably use iCloud except I don’t fully trust it, and I don’t know a good way to just download all the content if I ever want to migrate. Google Photos does let you download, so that’s good enough for me.

              1. 1

                emacs does have mouse support. I have used it to resize windows and even to click on menubar choices sometimes. you can probably do a lot more with it than I do, for example I don’t bother using it to select text, that’s much faster with the keyboard.

                IMO the real killer feature for emacs mouse support is scroll wheel support - being able to scroll file contents up and down is something I use all the time.

                PS, screen (and tmux) history / copy mode also lets you use scroll wheels.

                (I’m using MacOS’s Terminal.app, and you have to enable “Allow Mouse Reporting “ in the View menu to get this to work - it’s handy to know that you can disable that and get the regular MacOS mouse selection behavior when you want to e.g. scroll up in the local screen buffer instead of the remote one, or select a rectangular area with option-shift-select)

                1. 2

                  Since people have already mentioned emacs and magit, I’ll share something a little more idiosyncratic:

                  I have a bash history with a lot of suboptimal things like "make clean ISO && remote-install cluster5 && send-phone-notification "done" " etc. So I wrote a bash tool for saving frequently reused commands into a git repo of “snippets” that I can push and share around between systems. I use it very often. There’s more info in the README: https://github.com/mikemccracken/hs

                  The other related thing that’s saved time in the past when I used to use fresh cloud images more often, is saving all my dotfiles in git using vcsh: https://github.com/RichiH/vcsh

                  1. 2

                    Where can I get this very useful-sounding send-phone-notification script?

                    1. 2

                      It’s pretty custom and a little janky, but the basic idea is that it uses Prowl, an iOS app and service, via the official perl client (download ) - I have my personal apikey saved in the script, which looks basically like this:

                      echo "Sending notification: $msg";
                      ~/bin/prowl.pl -apikey=$MYKEY -event=CLI -application=CLI -notification "$msg";
                      

                      so I tack that onto the end of long-running commands so I get the notification on my phone when it’s done and I can stop checking email or whatever I’ve been doing while I waited for the important thing to finish.

                      This has been really useful in keeping me productive, and I’ve used versions of it for years - here’s a blog post I wrote in 2008 about having X forwarding pop up a dzen notification on my local screen when something on a remote server is done. I like the phone notification better, because I can go make coffee and still be in touch.

                  1. 2

                    Why don’t you have the reviewers merge it?

                    1. 2

                      Because sometimes a multiple reviewers are needed. In addition, PR might become outdated so it needs to bring in the latest changes from the master (to avoid merging semantically conflicting PRs).

                      1. 2

                        Using automation to rebase and then merge without any human reviewing any of it sounds like a recipe for disaster.

                        Because sometimes a multiple reviewers are needed

                        I’m not sure what you mean by this, can you explain?

                        1. 2

                          Using automation to rebase and then merge without any human reviewing any of it sounds like a recipe for disaster.

                          Not necessarily, if the tool doing it checks if: 1) there are no merge issues, 2) all tests still work. I haven’t had seen problems because of automated merging in the previous 3 companies. Have you encountered the issues with such approach in the past?

                          Because sometimes a multiple reviewers are needed

                          We use CODEOWNERS feature from GitHub. That means different parts of the repository are “owned” by different teams. When there is a cross cutting PR, it requires approval from every owner whose component has been affected.

                          1. 1

                            You’re right, if testing is appropriately covered before it is merged, it’s not usually an issue. It’s rare to see projects with 100% functional test coverage though.

                        2. 2

                          You can set the number of required reviewers for a branch on GitHub. If you ware worried that certain people (e.g. more junior developers) merge pull requests, you can restrict who can merge reviewed PRs. You could create a CODEOWNERS file. This notifies code owners when a PR changes an affected path. But you can also require that the code is reviewed by at least one of the code owners:

                          https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

                        3. 2

                          Sometimes a test suite takes a while, so being able to review a PR, approve it, then forget about it and know that it’ll get merged once the test suite passes, is nice.

                          1. 2

                            Exactly that. When CI times take 20+ min, one should not babysit PRs :)

                        1. 11

                          For those interested in distributed sqlite, you may also want to look into ‘dqlite’, another raft-based distributed sqlite project. It was developed to support LXD’s clustering features, and is in use in that context.

                          I haven’t used it myself, but I used to work with those guys, which is how I know about it. I know they initially looked at rqlite, but decided they needed to roll their own. I think the reason was related to the first limitation listed in the rqlite README: “Only SQL statements that are deterministic are safe to use with rqlite, because statements are committed to the Raft log before they are sent to each node.”.

                          The lead dev, Free, gave a detailed talk at FOSDEM last month about it.

                          1. 4

                            Rqlite has an open issue about that, solving it will involve parsing incoming SQL statements, executing any time, rand, etc functions once, and modifying the committed statement to use their values. MySQL has been doing that for ages in its statement-based replication afaik, so it’s a solved problem that “just” needs some legwork.

                          1. 5

                            This looks like a really handy tool, I was a little disappointed to read through to the end and see that it’s not available to the public (yet?)…

                            1. 5

                              This is the second time I’ve seen marketing material for nodes posted here or hackernews, and it wasn’t available then either.

                              Their tech does indeed look cool, but without any info about availability, pricing (if there will be an open source/nonprofit free version), etc. it’s hard to feel any excitement.

                              1. 1

                                Seems like something you’d wanna lead with.

                              1. 2

                                This is good netiquette advocacy and I support it. Now for the usual nitpicking:

                                I’m not really clear why this says that macOS Mail doesn’t support bottom posting - what’s the criteria?

                                I use it in plaintext mode, and I often use it to reply inline and edit the quoted text of a message. If you have a part selected when you hit “Reply”, it only quotes your selection, too, which can be handy.

                                Also, just for “fun” you might want to add an anti-recommendation for the Microsoft “Outlook Web App” which is not regular Outlook and does not support any kind of plain text. What’s worse, if you reply inline using a sane client, someone using the OWA will not see your reply text unless they know to click the little ellipsis and look through - all the lines will be the same color, but some will not have the quote mark.

                                But, if your email has the word “congratulations” it will animate confetti when you open it. Congratulations!

                                1. 11

                                  I used Vala briefly, and my impressions were that it was generally pleasant to work in, and seemed reasonably well designed. At the time I was coming from writing desktop UI code in Python with PyQt and Twisted, and Vala seemed refreshingly more sane. However it’s a relatively thin layer on top of GObject, which IIRC means that you have a ton of great libraries to use, but they’re all just wrappers, so you really do need to understand GObject to use Vala because none of the docs are written with Vala in mind. At least that’s how it was ~6-7 years ago…

                                  1. 1

                                    I started working on BibDesk, a reference manager / research notes DB for BibTeX and LaTeX, sometime in January 2002, possibly even earlier. There’s probably some of that code still around in the current version, so that puts it at a little over 17 years.

                                    It’s a little sobering to think of how much other code before and since has come and gone.

                                    1. 2

                                      I’d be really interested in whether there’s a similar thing for diagrams & schematics - still generated by code, but less art and more illustration / explanatory diagrams.

                                      I’ve done some diagrams for papers & presentations using Processing, and while that’s been successful, it’s a little clunky, and hard to share. Ideally I’d be able to both generate diagrams with code, and also adjust them with a mouse UI, with the changes being reflected in the code. Long experience with Omnigraffle makes me appreciate a good UI for finishing a diagram, but I always wanted to start out by generating with code…

                                      1. 1

                                        This is really interesting - Some of these lines overlap so much that it’s hard to follow. I’m particularly curious to see what the lines coming from ZOG all go to, since I have a personal connection there. Is your dot file public?

                                        I’m specifically curious about the reasoning behind the links, I see they have some annotations but it’d be interesting to hear more. It’s also interesting that KMS has no influenced systems while ZOG apparently has several. I remember more about KMS than ZOG, since I’m only about as old as KMS. So for example, I remember they thought the way that KMS showed a visual three-button mouse that supported chorded mouse actions was a new and powerful idea - I originally looked to see if KMS was there and if that feature had been assigned any influence. But maybe ZOG had it too? The old PERQ-2 systems did have three button mice, but the ZOG techreport that wikipedia has doesn’t mention it.

                                        1. 1

                                          The dot file is here.

                                          For the sake of this graph, I’m assuming that most 1970s and 1980s card-based hypertext systems with jump links got the card orientation model directly from ZOG instead of from things it influenced, but info is a little thin on the ground and I haven’t had a chance to research them deeply (the whole graph thus far was made in one day, & most of the hypertext stuff added in the latter half of that day), so I expect the connections there to change as I get more information.

                                          Mouse chording with three button mice is something that’s included in the graph – Plan9 and Oberon have it, possibly from NLS directly – but I didn’t realize KMS had it.

                                          The plan9 section should be broken up, because there seems to be a lineage between BLiT, MUX, Help, Acme, and Rio that’s interesting independent of the connection to the plan9 base system.

                                          Since what I’m working on isn’t a history of hypertext per-se but a survey of unusual-but-interesting UI systems that can easily be run or emulated by readers, card-based hypertext systems probably won’t be covered (except perhaps hypercard) – I’m on the fence about whether or not card-based hypertext in general is unusual enough to cover. As a result, the family tree with regard to the lineage of these systems can be even more impressionistic: while I’m endevouring to make it basically accurate and non-misleading for folks who are completely unfamiliar with most of the systems mentioned (or more likely, everything but Macintosh and Android), the primary function is to illustrate the vastness of possibility space in this domain & give hints to readers about what might be worth looking up, as well as giving a general feel for further research paths when a reader already likes a particular model & would like to see similar systems.

                                          However, I’m also a hypertext nerd & although I mostly stick to Xanadu’s cohort, I’d be interested to hear anything you have to say about ZOG and KMS. (ZOG is hard to research because searching for it produces mostly antisemitic conspiracy theories.)

                                          1. 1

                                            Thanks for the dotfile link.

                                            Rob Akscyn’s new project Expeditee is based on KMS, and runs on MacOS & linux, so I just tried it out - it has mouse chording but it doesn’t do the thing I remember from KMS, where the cursor was a graphical representation of three mouse buttons. Expeditee just shows a menu along the bottom of the frame like `“L: go back M: draw line R: Draw Rectangle LR: vertical format. I haven’t dived too deeply, but Expeditee is actually pretty fully-featured from what I can tell. Its navigation setup is identical to what I remember from KMS, and it’s causing some extreme nostalgia.

                                            As for what I have to say in general about ZOG and KMS, I actually don’t have a lot of first-hand technical knowledge. Don McCracken is my dad, so I remember him working on KMS, and I did play with it occasionally but he moved on before I was old enough to really get into it. I remember more about the graphics demos of the PERQ machines he ran KMS on (and the impressive bigger-than-an-LP-sized hard disk platters we pulled out of a broken one) than anything really about KMS. If you have any specific questions though, I could probably forward them along.

                                            1. 1

                                              Thanks! I’ll check Expedite out.

                                              Is there anything particularly notable about the PERQ machines specifically, aside from running KMS? PERQ keeps getting referenced on various GUI timelines but a cursory look at it didn’t indicate that they had anything that other machines at the time weren’t already doing – but for the time period, I would expect every architecture to have some interesting idiosyncracies.

                                              1. 2

                                                I don’t have great context for this off the top of my head. PERQs had powerful graphics for the time - specifically they had hardware-accelerated graphics. I think they had better graphics than the other workstations available at the time. I was certainly impressed by full-screen black-and-white dithered animation. :)

                                                There’s a lot of detail in this collection of PERQ notes I found. There’s also a ton of historical detail in this history of a defunct UK computing lab that used PERQs. I also found a video on youtube showing off the Sapphire window manager on a PERQ. It’s pretty cool to see it live again, I’d only seen screenshots the last few times I looked.

                                                I think they used them for ZOG and KMS because they were good workstations, but also because 3RCC was also a CMU spinoff, so they knew those guys. Later on, KMS was ported to Suns, Apollos, DEC Alphas (I don’t know if they used VMS or not) and I’m pretty sure SGIs.

                                                1. 1

                                                  Thanks!

                                                2. 2

                                                  Looking a bit further into the final ZOG writeup, it says they moved to PERQs for the trial on the USS Carl Vinson aircraft carrier. There’s some background about the usage of PERQs with the carrier in this Navy report.

                                          1. 1

                                            I really like the ideas of separate sheets of meta-code that inspect and plot the current values in scope in the main code, but are temporary, like live whiteboard sketches. Very cool.

                                            1. 2

                                              This kind of thing is why lxcfs exists, it’s a FUSE filesystem that provides container-aware files to bind mount over /proc/ files and get the right value for inside the container.

                                              1. 1

                                                I agree with “Item 4: Use incremental search for Navigation”, but I’d go further - look into helm-swoop and ace-jump mode. Moving around efficiently is a rich mine of ideas and things to try. And it’s worth it!

                                                1. 0

                                                  I’ve recently switched from ace-jump-mode to avy and I can really recommend it – one can decide to jump to charachters, words, subwords, lines. It’s also available in the standard ELPA repo, which is another plus.

                                                  Addition: My current setup is just

                                                  (use-package avy
                                                    :config
                                                    (avy-setup-default)
                                                    :bind (("C-z C-z" . avy-goto-subword-1)
                                                           ("C-z z" . avy-goto-char)))
                                                  

                                                  This sets up all they keys to use the home-row (I previously had to change avy’s behavior not to use numbers) and turns on jumping to avy from isearch (that’s the (avy-setup-default)) part. If anyone wants to check it out this might server as a good start. The only thing I’m still looking for is how to configure (or if necessary add) the ordering to use less letters the closer is it to the cursor.

                                                  1. 2

                                                    Thanks, yeah avy looks much nicer. A few extra tweaks to get you there faster, nice.

                                                    https://github.com/abo-abo/avy to save people a search :)

                                                1. 1

                                                  Sounds like a good time to finally set up my bouncer. If only there were one that had good Emacs compatibility.

                                                  1. 4

                                                    I just run weechat on a server and connect to the weechat relay with weechat.el. There’s a few bugs in weechat.el (e.g. nicks go out of sync) and some things missing (e.g. nick list), but that’s a small price to pay for replacing another standalone app with emacs :)

                                                    1. 1

                                                      I did this at the beginning but quickly switched over to ZNC because of bugs like that, the inability to have per-client history rollback, and other little details… I still use Weechat half the time on the client side though :) (I also use Textual on macOS, and Palaver on iOS).

                                                    2. 1

                                                      Ive used znc with Circe, works great

                                                      1. 1

                                                        What did you find in Circe that made it better than ERC or Rcirc?

                                                        1. 2

                                                          In case it’s useful - I used to use ERC, and I switched to Circe long enough ago that I can’t exactly remember, but I think the issue was that I wanted to connect to both freenode and an internal IRC server at the same time, and ERC made that awkward or impossible to do. It may well have improved in the last 5 years though.

                                                          1. 2

                                                            It was easy for me to setup and use so I stick with it. Never tried those other two

                                                        2. 1

                                                          Znc is what I use with erc

                                                          1. 1

                                                            I’ve been trying to set this configuration up for half a year now, but I never get anything I’m satisfied with. The ZNC documentation is quite bad and confused, imo. And when I manage to set it up, even using ZNC.el it won’t work with IRCnet. Switching between multiple servers is another annoyance.

                                                            But maybe I’ve just messed up somewhere.

                                                          2. 1

                                                            I used to use znc, seemed to work just fine with ERC.

                                                            Now I use weechat (a bit more features, nice Android app), again with ERC. There is weechat.el, but I prefer ERC (connecting to what weechat calls an “irc relay”, instead of using the weechat protocol). I use https://gist.github.com/unhammer/dc7d31a51dc1782fd1f5f93da12484fb as helpers to connect to multiple servers.