1. 3

    Moving! Time to get out of the rural life and back to city life. Was good while it lasted, but the boredom and isolation is real.

    1. 3

      Nearly all of my technical books are on paper. I don’t know why, but if I get a technical book on PDF I don’t actually end up reading it.

      1. 13

        Analog life tip: ask a librarian, or go to an actual book store (not a big box chain book store, if you can) and ask someone that works there.

        1. 2

          I don’t do this enough, but I do have a physical book store within walking distance of my house. Their little staff recommendations cards have been the source of several of my favorite reads over the last couple years. They don’t rotate enough to be usefull e.g. weekly but can certainly supplement other methods of recommendation gathering.

        1. 2

          Love this. So much about learning to program, for many people, is based around wanting to emulate something that already exists just for fun.

          My first programming endeavour was on my graphing calculator in high school. I ended up creating a map editor that read values out of a stored matrix, and drew a map on the screen based on those values (e.g. “1” meant fence segment, “2” meant bush, “3” meant rock, etc.)

          1. 6

            For over 10 years I’ve been a very ardent (some would say zealous) supporter of (n(eo))vim, carefully tweaking and updating my configuration to be as barebones or as feature-full as I needed and desired, and spreading the gospel of Vim to all those that would listen.

            About 6 months ago I tried out the vimagit plugin, which I found immediately useful. I then realized that this plugin was based off of the emacs magit package, which intrigued me further, and that sent me down a rabbit hole of trying out emacs with evil-mode (gasp! horror!).

            I’ve been a (spac)emacs+evil user since that day. It combines all of the muscle memory that I know and love (complex word motions, edit sequences, etc.) from vim, and gives me a TUI-based editor that has all all of the project/IDE based functionality that I had always spent far too much time configuring and fighting against in vim. I just don’t have the energy for that anymore.

            If you’re like me and love vim, and are looking to “revamp” your setup like the post describes, give Spacemacs a try. There are others, too (e.g. doom-emacs), and there are of course the DIY build-it-yourself setups that you can tinker with endlessly, but I was completely astounded by how intuitive and how short of a learning curve spacemacs with evil mode was.

            1. 2

              Yes, I saw magit from my colleague and that’s how I discovered vimagit. I’ve heard good things about evil mode but I’m not ready to try yet, though you’re sound convincing.

              1. 1

                The emacs magit package was the primary reason I tried the switch. After watching a few instructional videos & reading some documentation, I had to try it out. It’s every bit as good as I had hoped for.

                Using emacs+evil with some project-level plugins like helm for autocompletion and projectile for navigation has been fantastic. It took me a few days to get used to some of the different key combinations to navigate around, but that was quite minimal in the grand scheme of things.

              2. 2

                One of these days I’m gonna bite the bullet and try out emacs. I have so much invested into my vim environment that it scares me to leave….

              1. 9

                We’ve used Flask for the past 6-7 years, and written dozens and dozens of applications with it, everything from small silly sites to full blown global e-commerce implementations that handle millions of dollars of sales.

                The flexibility it offers, while sometimes a disadvantage, ends up being very useful to us when we have special/odd requirements to fulfill.

                1. 2

                  It seems pretty hard and time consuming to write e-commerce implementation in Flask. Don’t get me wrong, I like Flask, but it seems unsuited for such tasks due to the minimalist nature it embodies. I guess you guys have many in-house modules which you can reuse, which speeds development up quite a bit. How do you people manage?

                  1. 1

                    This was a very, very specialized task that involved gluing together a dozen different services from different departments within the same multinational company; one department built the product catalog, while the other built the product descriptions, while another was responsible for certain variants of each product, not to mention getting inventory from the fulfillment provider warehouses, or the department responsible for pricing, and many of the above was also on a per-country basis.

                    It was going to be time-consuming no matter how you sliced it, really.

                1. 20

                  mutt

                  1. 4

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

                    1. 8

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

                      1. 7

                        I also use mutt exclusively.

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

                        1. 1

                          Are you able to sync address books from IMAP servers?

                          1. 3

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

                            1. 1

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

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

                              1. 2

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

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

                                1. 1

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

                          2. 4

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

                            1. 2

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

                              1. 2

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

                                1. 2

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

                                2. 1

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

                              2. 2

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

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

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

                                1. 1

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

                                  1. 5

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

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

                                    1. 3

                                      I, for one, am.

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

                                      1. 3

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

                                        1. 1

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

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

                                          1. 3

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

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

                                          2. 1

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

                                          3. 3

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

                                            1. 2

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

                                              1. 2

                                                I have disabled auto-loading external images in gmail

                                            2. 3

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

                                              1. 2

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

                                                1. 2

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

                                              1. 21

                                                It takes a significant amount of effort to write a technical blog post or create an interesting project.

                                                It takes almost no effort for someone to criticize it, as is shown every day on that orange site. The anxiety over making a slightly inaccurate statement or not creating the perfect example code to illustrate a problem has prevented me from doing a lot of writing over the years, even though I know that it shouldn’t bother me.

                                                1. 7

                                                  My usual desktop

                                                  I’m on OS X, and use a tiling window manager called ChunkWM with a hotkey daemon.

                                                  There’s NeoVim with a variety of syntax/editing plugins on top right, a currently active PDB session on bottom right, various IRC channels and servers via Weechat on bottom left, and Mutt top left.

                                                  With the combination of hotkey daemon, window manager, and the variety of CLI-based tools I use, I essentially never use my trackpad/mouse. Not shown is Firefox with a vim-like set of keybindings so that I can navigate with the keyboard.

                                                  I’m also a huge motorsports fan, so the wallpaper usually rotates between various Formula 1 or World Endurance Championship scenes.

                                                  1. 4

                                                    How do you find ChunkWM? I’ve batted around the idea of installing it on my Mac at home, because I am a fan of tiling, keyboard-driven wms when forced to spend time in X; but I worry that it’d end up being a case of fighting the platform, a neither fish-nor-foul hybrid that manages to combine the worst of both worlds.

                                                    1. 4

                                                      It’s actually not that bad – there are a few configuration-level things that you need to setup to get things working smoothly, but once it’s going I really don’t have to touch it. I’m actually a bit lost when I need to use a computer that is not my own due to all the built-up muscle memory from the skhd hotkeys.

                                                      But, it does have some flaws.

                                                      1. When switching between single monitor & multiple monitors, sometimes windows don’t reposition themselves correctly and I have to hide all windows and then bring them to the foreground to get the chunkwm daemon to recognize them and resize them. It’s not a big deal, but it can be jarring the first time it happens to you. Also, this seems to have almost disappeared in the most recent versions of ChunkWM.
                                                      2. When resizing windows, you can sometimes see redraw artifacts (edit: on further thought, this might be an issue with iTerm2 - I don’t ever see redraw artifacts on non-console windows). You can even see that in my screenshot that I took (it looks like an extra letter in the self parameter in the top right window, first line). The artifacts disappear when the window in question has to redraw itself again for some reason (e.g. you typed some text), but is supremely annoying.
                                                      3. The default keybindings in skhd might be a tad annoying for non-English keyboards. I know when I need to type French accented characters, I have to go a circuitous route due to the use of the option key as the main skhd modifier.
                                                      4. Some menubar applications will need to be added to the chunkwmrc config file as a “do-not-touch”, since chunkwm tries to tile floating menubar windows that appear, and it really just goes a bit nuts. This seems to have been resolved in the most recent versions of chunkwm, but I’m still a bit wary about it.

                                                      Overall, though, for software that is at 0.4.x level of completeness, I’m very happy with it, and deal with the warts because the productivity it provides me is worth so much.

                                                      The author of the software has gone through a few iterations of building these hotkey daemons & window managers for OS X, and seems to have taken a lot of knowledge and experience from past implementations.

                                                    2. 2

                                                      Another tiling window manager: https://www.spectacleapp.com/.

                                                      1. 1

                                                        +1 for Spectacle

                                                    1. 7

                                                      Trying to make meaningful contributions to some open source projects that I know and use, under the guise of Hacktoberfest, by implementing features or fixing tricky bugs.

                                                      Sadly (or perhaps just disappointingly?), it seems like most people contributing to projects for Hacktoberfest are simply making pull requests for minor or almost irrelevant changes to things like README files.

                                                      1. 3

                                                        ’tis what happens when you gamify something.

                                                        I’d say, if someone does this seriously, from a cold start, they’d need to pick a small bug for the whole month and get pointers from experienced coders on the project. At that point it would not benefit the project so much (because of the time it took away from the experienced coders).

                                                        A useful way would be for experienced coders to pick an open source project they regularly use and have some familiarity with and use the month as an excuse to do bug-fixes or documentation improvements.

                                                        But you know open source, community driven development: ’tis a miracle anything gets done at all.

                                                        1. 3

                                                          A useful way would be for experienced coders to pick an open source project they regularly use and have some familiarity with and use the month as an excuse to do bug-fixes or documentation improvements.

                                                          This is essentially what I have done, and it’s been nice to make some OSS contributions again. I used to be quite involved in a few OSS communities, but life happened and I had to scale back my involvement for the past few years.

                                                          I mostly feel bad for the maintainers that have to deal with all the somewhat irrelevant/bothersome pull requests that are fixing spacing or adding punctuation. Don’t get me wrong, I’m not against those fixes in general, but many are PRs for the sake of being a PR at this point.

                                                          I know what it’s like to maintain an open source project, and you’ve only got a fixed amount of mental capacity to handle things, and clogging that up with a dozen or so trivial pull requests is a great way to burn out a maintainer.

                                                          Oh well. Hopefully there are more people attempting to be truly helpful than not!

                                                      1. 6

                                                        That number is the total number of “upvotes” you have received on all comments and stories you posted on the site. Its the same number as your “karma” on your profile.

                                                        1. 1

                                                          Aha! Thank you. I had no idea those were counted.

                                                          1. 4

                                                            To clarify, it’s not the “total number of upvotes”, but rather (upvotes - downvotes), which gives you your net karma.

                                                            1. 1

                                                              It’s in your profile, too, along with an average.

                                                          1. 3

                                                            Having used RCS/CVS/SVN/Git in professional environments, it’s astounding to see just how far version control has come.

                                                            Sure, git/mercurial/etc. aren’t perfect, but you no longer have to wrangle RCS/CVS for projects with thousands of files (often where almost every file under control is at a different version number!), or wait 15 minutes (!) for a SVN merge to complete.

                                                            1. 1

                                                              Haha you are history INCARNATED! I was posting this not only because I like the quick summary and the poster but also because I’ve never, ever touched those legacy systems!

                                                              1. 2

                                                                They were simpler times, but perhaps that’s just the past being analyzed through rose-tinted glasses.

                                                                I do distinctly remember the incredible frustration with having to deal with a CVS repository shared by hundreds of people, distributed around the world, and wishing that there was a better way to do things.

                                                                1. 1

                                                                  If you want to feel how modern VC feels now, you should try Plastic SCM.

                                                            1. 4

                                                              The article makes several good points, but it appears as though the author has a particular bone to pick with protocol buffers (mostly the map type, it seems) and comes off as more rant-y than constructive.

                                                              While only anecdotal, I’ve been working with protobufs for communicating with an embedded device with very restricted memory space, and after having evaluated the usual players (Avro, Capnproto, Thrift), protobufs was the only serialization protocol that was feasible to use. I would have preferred to use capnproto, but the lack of C-based support was a deal breaker.

                                                              In our particular use-case, protobufs made all the right trade-offs, even though I do sometimes curse at some imposed constraints.

                                                              1. 1

                                                                Did you consider ASN1/DER?

                                                                1. 2

                                                                  Briefly, but I have 1) had bad experiences with some AS1 encoders/decoders in the past (some of them are terrible, and make seemingly unnecessary allocations), and 2) we are already pushing the boundaries of what the embedded chipset is capable of in terms of throughput, and serialization/deserialization speed and resulting payload size is legitimately a concern given how much data we are pushing per unit of time.

                                                                  Also, the documentation for ASN.1 is… lacking, at times. If you’ve ever tried to figure out how to implement tags to support some kind of forwards/backwards compatible type definitions, you know what I mean.

                                                              1. 7

                                                                This is a fantastic post. I’ve been meaning to try out some non-trivial PostGIS functionality, and this is amazing.

                                                                It’s also a little disheartening for someone like myself to start a project such as this, mostly due to the fact that a huge amount of the setup involved is finding the right shapefiles for what you’re hoping to accomplish.

                                                                1. 6

                                                                  I did a project last year where I finally had a good reason to knuckle down to learning some PostGIS, and I found out exactly those two things:

                                                                  (1) PostGIS is amazing, especially with the QGIS integration. It allows you to perform what seems like magic in terms of processing times on layer calculations compared to the ArcGIS or QGIS+python-script world, spitting back out perfectly-transformed QGIS layers in double-quick time. It’s also surprisingly approachable; from a standing start, a lot of it does seem like magic, but once you get your head round the fact that it’s “just” a bunch of clever hashing and smart indexes, and all just in SQL, meaning you can do some really interesting stuff by “just” joining on those fields and using those provided functions, the magic fades away and you can get what previously seemed like really complex stuff done pretty quickly.

                                                                  (2) Oh man, yeah, the dearth and spottiness of public availability of data for this kind of regulatory stuff is really, really painful. The sheer fact that most US stuff is broken down into totally irregularly-sized and -scaled legislatures is bad enough, let alone the fact that each one makes its own call about what data to publish and how. Don’t even get me started on LA cities and counties. Let alone the Valley.

                                                                  But seriously, the fact that there are so many GIS-vs-SQL wizards actively involved in the ongoing development of an open-source tool like PostGIS is a pleasure to behold. That sort of thing really is the pinnacle of what a technologically advanced civilisation is about. (Excuse me, I think I have a speck of sentiment in my eye.)

                                                                  1. 4

                                                                    I fooled around with some shapefiles a few years ago for a personal project, and it legitimately took 10x more time to source the shapefiles (or other formats that I then had to figure out how to convert to shapefiles) than the very simple thing I was trying to accomplish in the first place.

                                                                1. 1

                                                                  Oh eval, such a blessing and a curse.

                                                                  1. 1

                                                                    Thanks @jperras for your very interesting example.

                                                                    I tweeted your “small caveat” citing you: https://twitter.com/pauloxnet/status/1049973313467011072

                                                                    1. 2

                                                                      My pleasure! Happy to spread some arcane knowledge gained through experience when I can. And thanks for the shout out!

                                                                    1. 2

                                                                      The biggest mistake people make is mocking something out in the wrong place. You always need to mock the thing where it’s imported TO, not where it’s imported FROM.

                                                                      Small caveat, there: If you’ve got an import scoped within a function (or anything that isn’t module-level, really), you actually do have to mock it from the import location and not the import destination.

                                                                      His note about mocking decorators is a good one. They’re often annoying to mock correctly, especially for more complex decorators that interact directly with the method/function being mocked, or mutating attributes on the self of where the decorator is applied.

                                                                      Something which I find trips people up is mocking, say, a specific attribute that is part of a return value of a function. While this is usually indicative that the code might be in need of refactoring due to overstepping the law of demeter (or that you should be mocking the entire return value instead of bits & pieces), sometimes it’s the easiest way to introduce tests into code that doesn’t have any at all:

                                                                       class Result:
                                                                          some_key = 'foobar'
                                                                          some_other_key = 'bazbing'
                                                                      
                                                                          def additional_data(self):
                                                                              return 'good-data'
                                                                      
                                                                      
                                                                      def process():
                                                                          return Result()
                                                                      
                                                                      
                                                                      @mock.patch('myapp.process')
                                                                      def test_function(self, mock_process):
                                                                          # Mock an attribute of the returned object
                                                                          mock_process.return_value.some_key = 'bleepbloop'
                                                                      
                                                                          # Mock the value of a method on the returned object
                                                                          mock_process.return_value.addtional_data.return_value = 'bad-data'
                                                                      
                                                                      1. 5
                                                                        • Bread baking I’ll do everything from Pullman loafs to French-style sourdoughs, to baguettes. It’s easy to learn, and takes years to master.
                                                                        • Motorsports I race in a few local karting leagues, and I also participate in ChampCar (used to be called ChumpCar) for a few races a year.
                                                                        • Winemaking I pick my own fruits and ferment for 12-18 months to make wine. It’s more involved than that, but you get the idea.
                                                                        • Powerlifting I’ve competed in several events, and have managed to get quite a lot stronger than I ever thought I could be.
                                                                        • Learning languages This is a new one, but I’m learning Portuguese. I already speak fluent French and English, and have a modest grasp of Spanish. I’d like to get to 6 languages before I’m 40 (currently 33).
                                                                        1. 3

                                                                          Literally every single one of my personal projects. Sigh.

                                                                          1. 3

                                                                            I’m Joël, and I write about math and weird things I find while writing software.

                                                                            https://nerderati.com

                                                                            Sadly I don’t write more than ~3-4 posts per year.

                                                                            Side note: I wrote a blog post about 7 years ago summarizing some stuff in the ssh_config man pages that I found useful, and I’m (to this day) the no. 1 search result for “ssh config”. Just a fun fact that makes me smile :)